aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
diff options
context:
space:
mode:
authorBuildTools <james.jenour@protonmail.com>2021-07-22 15:40:21 +0800
committerBuildTools <james.jenour@protonmail.com>2021-07-22 15:40:21 +0800
commitc1c4562b42d53ec2e8885c48f97249d7768fe1c7 (patch)
tree407c4dccbc2c9f0b89e3b211f102e48fc8af1bfa /src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
parentff2829153c14e0f7ca655bfd4ef64bffae3212b2 (diff)
downloadnotenoughupdates-c1c4562b42d53ec2e8885c48f97249d7768fe1c7.tar.gz
notenoughupdates-c1c4562b42d53ec2e8885c48f97249d7768fe1c7.tar.bz2
notenoughupdates-c1c4562b42d53ec2e8885c48f97249d7768fe1c7.zip
PRE29.05
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
index b8d6dc38..58d6f119 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
@@ -117,6 +117,7 @@ public class StorageOverlay extends GuiElement {
private int desiredHeightMY = -1;
private boolean dirty = false;
+ private boolean allowTypingInSearchBar = true;
private int scrollGrabOffset = -1;
@@ -1237,6 +1238,7 @@ public class StorageOverlay extends GuiElement {
GlStateManager.popMatrix();
GlStateManager.translate(0, 0, 300);
+ allowTypingInSearchBar = false;
if(stackOnMouse != null) {
if(hoveringOtherBackpack) {
Utils.drawItemStack(new ItemStack(Item.getItemFromBlock(Blocks.barrier)), mouseX - 8, mouseY - 8);
@@ -1276,6 +1278,8 @@ public class StorageOverlay extends GuiElement {
}
} else if(tooltipToDisplay != null) {
Utils.drawHoveringText(tooltipToDisplay, mouseX, mouseY, width, height, -1, Minecraft.getMinecraft().fontRendererObj);
+ } else {
+ allowTypingInSearchBar = true;
}
GlStateManager.translate(0, 0, -300);
}
@@ -1439,7 +1443,8 @@ public class StorageOverlay extends GuiElement {
if(!(Minecraft.getMinecraft().currentScreen instanceof GuiChest)) return false;
int dWheel = Mouse.getEventDWheel();
- if(dWheel != 0) {
+ if(!(NotEnoughUpdates.INSTANCE.config.storageGUI.cancelScrollKey != 0 &&
+ Keyboard.isKeyDown(NotEnoughUpdates.INSTANCE.config.storageGUI.cancelScrollKey)) && dWheel != 0) {
if(dWheel < 0) {
dWheel = -1;
if(scrollVelocity > 0) scrollVelocity = 0;
@@ -1633,7 +1638,7 @@ public class StorageOverlay extends GuiElement {
switch(buttonIndex) {
case 0:
- NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI = false; break;
+ NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI2 = false; break;
case 1:
int size = desiredHeightSwitch != -1 ? desiredHeightSwitch : NotEnoughUpdates.INSTANCE.config.storageGUI.storageHeight;
int sizeIndex = Math.round((size-104)/54f);
@@ -1879,7 +1884,7 @@ public class StorageOverlay extends GuiElement {
page.customTitle = renameStorageField.getText();
}
}
- } else if(NotEnoughUpdates.INSTANCE.config.storageGUI.searchBarAutofocus || searchBar.getFocus()) {
+ } else if(searchBar.getFocus() || (allowTypingInSearchBar && NotEnoughUpdates.INSTANCE.config.storageGUI.searchBarAutofocus)) {
String prevText = searchBar.getText();
searchBar.setFocus(true);
renameStorageField.setFocus(false);