diff options
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.java | 11 |
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); |
