From 7dd15439295541be0011e5abafccf5444981c069 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:57:43 +0200 Subject: Add a toggle for inventory buttons to enable or disable them quickly. (#1198) --- .../moulberry/notenoughupdates/listener/RenderListener.java | 3 ++- .../options/separatesections/InventoryButtons.java | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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 dcbc8654..d67b7fb2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -453,7 +453,8 @@ public class RenderListener { } public void iterateButtons(GuiContainer gui, BiConsumer acceptButton) { - if (NEUApi.disableInventoryButtons || EnchantingSolvers.disableButtons() || gui == null) { + if (NEUApi.disableInventoryButtons || EnchantingSolvers.disableButtons() || gui == null || + !NotEnoughUpdates.INSTANCE.config.inventoryButtons.enableInventoryButtons) { 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 36289b3f..5d934376 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 @@ -27,6 +27,14 @@ import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider; import io.github.moulberry.moulconfig.annotations.ConfigOption; public class InventoryButtons { + @Expose + @ConfigOption( + name = "Enable Inventory Buttons", + desc = "Quick Toggle to Enable/Disable All Inventory Buttons" + ) + @ConfigEditorBoolean + public boolean enableInventoryButtons = true; + @Expose @ConfigOption( name = "Open Button Editor", -- cgit