Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public class GuiScreenConfigureChannels extends GuiContainer implements IGuiScre
private GuiTextField key, value;
protected int guiTop, guiLeft;
private List<String> info;
private boolean wipePending = false;
private long wipePendingTime = 0;
private static final long WIPE_CONFIRM_TIMEOUT_MS = 3000;

public GuiScreenConfigureChannels(Container container, ItemStack trigger) {
super(container);
Expand Down Expand Up @@ -346,9 +349,17 @@ protected void actionPerformed(GuiButton btn) {
ChannelDataAccessor.unsetChannelData(trigger, key.getText());
break;
case WIPE_BTN:
ChannelDataAccessor.wipeChannelData(trigger);
key.setText("");
this.value.setText("");
if (!wipePending) {
wipePending = true;
wipePendingTime = System.currentTimeMillis();
btn.displayString = I18n.format(I18N_PREFIX + "wipe.confirm");
} else {
wipePending = false;
btn.displayString = I18n.format(I18N_PREFIX + "wipe");
ChannelDataAccessor.wipeChannelData(trigger);
key.setText("");
this.value.setText("");
}
break;
}

Expand All @@ -369,6 +380,10 @@ public void updateScreen() {
super.updateScreen();
key.updateCursorCounter();
value.updateCursorCounter();
if (wipePending && System.currentTimeMillis() - wipePendingTime > WIPE_CONFIRM_TIMEOUT_MS) {
wipePending = false;
getButtonList().get(WIPE_BTN).displayString = I18n.format(I18N_PREFIX + "wipe");
}
}

@Override
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/structurelib/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ item.structurelib.constructableTrigger.gui.add=Add
item.structurelib.constructableTrigger.gui.set=Update
item.structurelib.constructableTrigger.gui.unset=Remove
item.structurelib.constructableTrigger.gui.wipe=§4Clear
item.structurelib.constructableTrigger.gui.wipe.confirm=§4Sure?
item.structurelib.constructableTrigger.gui.channels.from=§rMod: §9§o%s
item.structurelib.constructableTrigger.gui.info=Many multiblocks support some degree of variation in their structure and a sub channel allows indication of which variant to use.\n All sub channels have a sequence of lowercase characters as key and a positive integer as value. Most known sub channels should be available as typeahead completions.\n You can also drag and drop items from NEI to set the corresponding sub channel value. These items all have a tooltip of "§oIndicates§r §ovalue§r §oX§r §ofor§r §osub§r §ochannel§r §oY§r".

Expand Down
Loading