diff options
| author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2022-10-21 14:45:54 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-21 07:45:54 -0700 |
| commit | 8848224dcba09d8ac321f7dd4c087eb3590cb285 (patch) | |
| tree | c2c521af39b3f4eff5a47950f54cbeb57b562494 /src/main/java/io/github/moulberry/notenoughupdates/miscgui | |
| parent | 6c209c2ca6b4cb858cec2854d665bfa1a44f8728 (diff) | |
| download | notenoughupdates-8848224dcba09d8ac321f7dd4c087eb3590cb285.tar.gz notenoughupdates-8848224dcba09d8ac321f7dd4c087eb3590cb285.tar.bz2 notenoughupdates-8848224dcba09d8ac321f7dd4c087eb3590cb285.zip | |
Added the ability to add search tags to config options (#309)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java | 82 |
1 files changed, 43 insertions, 39 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java index 0abf3f11..572b0fbf 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java @@ -83,24 +83,26 @@ public class InventoryStorageSelector { return; } - if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowLeftKey)) { - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex--; - - int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; - } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowRightKey)) { - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex++; - - int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; - } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowDownKey)) { - sendToPage(NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex); + if (NotEnoughUpdates.INSTANCE.config.storageGUI.arrowKeyBackpacks) { + if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowLeftKey)) { + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex--; + + int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; + } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowRightKey)) { + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex++; + + int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; + } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowDownKey)) { + sendToPage(NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex); + } } if (isSlotSelected()) { @@ -145,27 +147,29 @@ public class InventoryStorageSelector { return; } - if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.backpackHotkey)) { - Minecraft.getMinecraft().thePlayer.inventory.currentItem = 0; - isOverridingSlot = true; - } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowLeftKey)) { - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex--; - - int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; - } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowRightKey)) { - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex++; - - int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; - } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowDownKey)) { - sendToPage(NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex); + if (NotEnoughUpdates.INSTANCE.config.storageGUI.arrowKeyBackpacks) { + if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.backpackHotkey)) { + Minecraft.getMinecraft().thePlayer.inventory.currentItem = 0; + isOverridingSlot = true; + } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowLeftKey)) { + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex--; + + int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; + } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowRightKey)) { + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex++; + + int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; + } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowDownKey)) { + sendToPage(NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex); + } } if (isSlotSelected()) { |
