diff options
| author | jani270 <69345714+jani270@users.noreply.github.com> | 2024-06-14 14:25:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-14 14:25:50 +0200 |
| commit | 1ccc0131278233b71db97b8ee81ecf084b4fb5b5 (patch) | |
| tree | 0fde540dbab5a1b41ba180ad01fd34b4315bb1d5 | |
| parent | fc45d59ebdb7ed846ad5be2ddb077de4c6b779fe (diff) | |
| download | notenoughupdates-1ccc0131278233b71db97b8ee81ecf084b4fb5b5.tar.gz notenoughupdates-1ccc0131278233b71db97b8ee81ecf084b4fb5b5.tar.bz2 notenoughupdates-1ccc0131278233b71db97b8ee81ecf084b4fb5b5.zip | |
Add Option to hide Inventory Buttons in Dungeon Menus (#1215)
* Add Option to hide Inventory Buttons in Dungeon Menus
* Update src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java
Co-authored-by: Linnea Gräf <nea@nea.moe>
* Add imports and changed list to set
---------
Co-authored-by: Linnea Gräf <nea@nea.moe>
2 files changed, 27 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java index 7c847526..073b3d50 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -92,12 +92,15 @@ import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.ConcurrentModificationException; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Objects; +import java.util.Set; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -459,9 +462,24 @@ public class RenderListener { } } + private static final String[] dungeonMenus = + { + "Spirit Leap", + "Revive A Teammate", + "Click in order!", + "What starts with", + "Select all the", + "Click the button on time!", + "Correct all the panes!", + "Change all to same color!" + }; + private static final Set<String> dungeonMenuSet = new HashSet<>(Arrays.asList(dungeonMenus)); + public void iterateButtons(GuiContainer gui, BiConsumer<NEUConfig.InventoryButton, Rectangle> acceptButton) { if (NEUApi.disableInventoryButtons || EnchantingSolvers.disableButtons() || gui == null || - !NotEnoughUpdates.INSTANCE.config.inventoryButtons.enableInventoryButtons) { + !NotEnoughUpdates.INSTANCE.config.inventoryButtons.enableInventoryButtons || + (NotEnoughUpdates.INSTANCE.config.inventoryButtons.hideInDungeonMenus && + dungeonMenuSet.contains(Utils.getOpenChestName()))) { return; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/InventoryButtons.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/InventoryButtons.java index 5d934376..1c26b463 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/InventoryButtons.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/InventoryButtons.java @@ -53,6 +53,14 @@ public class InventoryButtons { @Expose @ConfigOption( + name = "Hide Buttons in Dungeon Menus", + desc = "Hide Inventory Buttons in Dungeon Menus." + ) + @ConfigEditorBoolean + public boolean hideInDungeonMenus = false; + + @Expose + @ConfigOption( name = "Button Click Type", desc = "Change the click type needed to trigger commands" ) |
