aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2021-06-25 14:49:25 +0800
committerGlease <4586901+Glease@users.noreply.github.com>2021-06-25 14:49:33 +0800
commite49a886b31e826a32b973ba3f2324063f6fe66a3 (patch)
tree0ac6a89828a385e4001ceb95f862f6b254624e58
parentc01b01c1a64f1635df6a8fda809d4320758615ab (diff)
downloadGT5-Unofficial-e49a886b31e826a32b973ba3f2324063f6fe66a3.tar.gz
GT5-Unofficial-e49a886b31e826a32b973ba3f2324063f6fe66a3.tar.bz2
GT5-Unofficial-e49a886b31e826a32b973ba3f2324063f6fe66a3.zip
Fix redstone cover UX being weird
Signed-off-by: Glease <4586901+Glease@users.noreply.github.com>
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUICover.java7
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java5
2 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/gui/GT_GUICover.java b/src/main/java/gregtech/api/gui/GT_GUICover.java
index 1e51cf0758..2e9d082ebf 100644
--- a/src/main/java/gregtech/api/gui/GT_GUICover.java
+++ b/src/main/java/gregtech/api/gui/GT_GUICover.java
@@ -252,10 +252,17 @@ public abstract class GT_GUICover extends GuiScreen implements GT_IToolTipRender
textBox.setFocused(textBox.equals(boxToFocus) && textBox.isEnabled());
}
}
+
+ /**
+ * Given textbox's value might have changed.
+ */
public void applyTextBox(GT_GuiIntegerTextBox box) {
}
+ /**
+ * Reset the given textbox to the last valid value, <b>NOT</b> 0.
+ */
public void resetTextBox(GT_GuiIntegerTextBox box) {
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java
index 7070b7ad18..93a729d0c2 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java
@@ -222,7 +222,7 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior {
@Override
public void resetTextBox(GT_GuiIntegerTextBox box) {
- box.setText(String.valueOf(0));
+ box.setText(String.valueOf(coverVariable & PUBLIC_MASK));
}
@Override
@@ -256,7 +256,8 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior {
public boolean textboxKeyTyped(char c, int key) {
int tValue = 0;
- super.textboxKeyTyped(c, key);
+ if(!super.textboxKeyTyped(c, key))
+ return false;
int cursorPos = this.getCursorPosition();