diff options
| author | DoKM <mcazzyman@gmail.com> | 2021-07-22 09:57:31 +0200 |
|---|---|---|
| committer | DoKM <mcazzyman@gmail.com> | 2021-07-22 09:57:31 +0200 |
| commit | befa3f0f8aeb0166bf84dddd14f6b4fabc236cf0 (patch) | |
| tree | 4ef5014cf74f57ef52fa2650703de7b8f1153f6c /src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java | |
| parent | aebc16a2a5ca9c20affc27eb5a45cd9a95085168 (diff) | |
| parent | c1c4562b42d53ec2e8885c48f97249d7768fe1c7 (diff) | |
| download | notenoughupdates-befa3f0f8aeb0166bf84dddd14f6b4fabc236cf0.tar.gz notenoughupdates-befa3f0f8aeb0166bf84dddd14f6b4fabc236cf0.tar.bz2 notenoughupdates-befa3f0f8aeb0166bf84dddd14f6b4fabc236cf0.zip | |
Fix merge conflicts for moulberry
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 | 13 |
1 files changed, 8 insertions, 5 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 2dd0fbd1..e525117c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -118,6 +118,7 @@ public class StorageOverlay extends GuiElement { private int desiredHeightMY = -1; private boolean dirty = false; + private boolean allowTypingInSearchBar = true; private int scrollGrabOffset = -1; @@ -1238,6 +1239,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); @@ -1277,6 +1279,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); } @@ -1440,9 +1444,8 @@ public class StorageOverlay extends GuiElement { if(!(Minecraft.getMinecraft().currentScreen instanceof GuiChest)) return false; int dWheel = Mouse.getEventDWheel(); - if(dWheel != 0 && - (((NotEnoughUpdates.INSTANCE.config.storageGUI.scrollLock == 0)|| - (NotEnoughUpdates.INSTANCE.config.storageGUI.scrollLock == 1 && !KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.slotLockKey))))) { + 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; @@ -1636,7 +1639,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); @@ -1882,7 +1885,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); |
