aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2024-06-03 13:57:43 +0200
committerGitHub <noreply@github.com>2024-06-03 13:57:43 +0200
commit7dd15439295541be0011e5abafccf5444981c069 (patch)
tree8deb9a093242be0fbaa642360ec80733644d8492
parent32ee0a75f83d544867a707cdd77daddb89829d88 (diff)
downloadNotEnoughUpdates-7dd15439295541be0011e5abafccf5444981c069.tar.gz
NotEnoughUpdates-7dd15439295541be0011e5abafccf5444981c069.tar.bz2
NotEnoughUpdates-7dd15439295541be0011e5abafccf5444981c069.zip
Add a toggle for inventory buttons to enable or disable them quickly. (#1198)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/InventoryButtons.java8
2 files changed, 10 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 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<NEUConfig.InventoryButton, Rectangle> 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
@@ -29,6 +29,14 @@ 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",
desc = "Open button editor GUI (/neubuttons)"
)