diff --git a/README.MD b/README.MD
index 09dcf7d606..1fea3b6667 100644
--- a/README.MD
+++ b/README.MD
@@ -73,7 +73,7 @@ A Fabric client-side QoL mod for the Hypixel SkyBlock Bazaar.
Other
- **Modify Indicator**: Marks anything Bazaar Utils adds or changes on an item with a small ₿, so it's always clear what's the mod and what's Hypixel. Configurable display type.
-- **Auto Update**: Automatically updates the mod when a new version is found (toggleable in Advanced Settings).
+- **Auto Update**: Automatically updates the mod when a new version is found (toggleable in the main settings).
- **Bazaar Flipper Setting**: Set your Bazaar Flipper account upgrade tier in the config so tax calculations and order limits are accurate.
- **Mod Menu Integration**: Config accessible through Mod Menu, with mod-provided config widgets.
- **Developer Mode**: Optional developer tools, debug messages, and error-notification toggles.
diff --git a/UPDATES.MD b/UPDATES.MD
index 0cdcd4f4b6..2caded63bf 100644
--- a/UPDATES.MD
+++ b/UPDATES.MD
@@ -3,6 +3,10 @@ The first full release of Bazaar Utils. Almost every part of the mod has been re
settings screen, the button system, order tracking, and how the mod reads item data. There are many new features, and
just as many old features that were improved.
+Advanced configuration mode now defaults to off for new configs. Enable it to customize button
+sizes, spacing, icons and slots, choose individual Bazaar messages to hide, reset tracked Bazaar
+limits, or access developer settings. Hiding these controls preserves their configured behavior.
+
---
## ⚠️ Please read before updating
**Your settings will not carry over.** v1.0.0 uses a completely new config system and saves to a new
@@ -52,7 +56,7 @@ what's the mod and what's Hypixel. Show it as a name prefix, a name suffix, the
only on modified items, or turn it off entirely.
### Auto Update
The mod can now update itself when a new version is released, matching the release channel you're
-already on (alpha/beta/stable). On by default; toggle it in **Advanced Settings**.
+already on (alpha/beta/stable). On by default; toggle it in the main settings.
### Translations
The mod is now fully translated into **German, Polish, French, Simplified Chinese and Russian**, and
follows your Minecraft language setting.
@@ -107,4 +111,4 @@ daily limits are not touched.
## 🙏 Thanks
Huge thanks to **@0xar-ds** for the architectural work behind this release, and to the many others
who helped write code, find bugs, and suggest features.
-Questions or problems? Join the [Discord](https://discord.gg/xDKjvm5hQd).
\ No newline at end of file
+Questions or problems? Join the [Discord](https://discord.gg/xDKjvm5hQd).
diff --git a/src/main/java/com/github/mkram17/bazaarutils/config/BUConfig.java b/src/main/java/com/github/mkram17/bazaarutils/config/BUConfig.java
index afba5e6ad2..679ec64b7a 100644
--- a/src/main/java/com/github/mkram17/bazaarutils/config/BUConfig.java
+++ b/src/main/java/com/github/mkram17/bazaarutils/config/BUConfig.java
@@ -1,6 +1,5 @@
package com.github.mkram17.bazaarutils.config;
-import com.github.mkram17.bazaarutils.config.features.AdvancedConfig;
import com.github.mkram17.bazaarutils.config.hidden.MetadataConfig;
import com.github.mkram17.bazaarutils.config.features.DeveloperConfig;
import com.github.mkram17.bazaarutils.config.features.chat.ChatConfig;
@@ -12,6 +11,7 @@
import com.github.mkram17.bazaarutils.utils.bazaar.PlayerAccountUpgrades;
import com.github.mkram17.bazaarutils.utils.minecraft.item.modifier.ModifyIndicator;
import com.teamresourceful.resourcefulconfig.api.annotations.*;
+import com.teamresourceful.resourcefulconfig.api.types.entries.Observable;
import static com.github.mkram17.bazaarutils.BazaarUtils.MOD_ID;
@@ -25,7 +25,6 @@
InventoryConfig.class,
OverlaysConfig.class,
NotificationsConfig.class,
- AdvancedConfig.class,
DeveloperConfig.class
},
version = ConfigUtil.VERSION
@@ -57,6 +56,26 @@ public static BUConfig get(){
)
public static boolean INTRODUCTORY_INFORMATION_SEPARATOR = true;
+ @ConfigEntry(
+ id = "advanced_configuration_mode",
+ translation = "bazaarutils.config.advanced_configuration_mode.label"
+ )
+ @Comment(
+ value = "Certain feature customization is hidden away from a normal configuration of the mod as they're options generally of no interest. Here you can toggle to see and configure them as well.",
+ translation = "bazaarutils.config.advanced_configuration_mode.hint"
+ )
+ public static Observable ADVANCED_CONFIGURATION_TOGGLE = Observable.of(false);
+
+ @ConfigEntry(
+ id = "automatic_updates",
+ translation = "bazaarutils.config.automatic_updates.label"
+ )
+ @Comment(
+ value = "Automatically update the mod when an update is found.",
+ translation = "bazaarutils.config.automatic_updates.hint"
+ )
+ public static boolean AUTOMATIC_UPDATES_TOGGLE = true;
+
@ConfigEntry(
id = "bazaar_flipper_account_upgrade",
translation = "bazaarutils.config.bazaar_flipper_account_upgrade.label"
@@ -86,4 +105,4 @@ public static BUConfig get(){
title = "bazaarutils.config.reset_config.label"
)
public static final Runnable RESET_CONFIG_BUTTON = ConfigUtil::confirmResetToDefaults;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/com/github/mkram17/bazaarutils/config/features/AdvancedConfig.java b/src/main/java/com/github/mkram17/bazaarutils/config/features/AdvancedConfig.java
deleted file mode 100644
index 98e160a624..0000000000
--- a/src/main/java/com/github/mkram17/bazaarutils/config/features/AdvancedConfig.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.github.mkram17.bazaarutils.config.features;
-
-import com.teamresourceful.resourcefulconfig.api.annotations.Category;
-import com.teamresourceful.resourcefulconfig.api.annotations.Comment;
-import com.teamresourceful.resourcefulconfig.api.annotations.ConfigEntry;
-import com.teamresourceful.resourcefulconfig.api.annotations.ConfigInfo;
-
-@Category(value = "advanced_config")
-@ConfigInfo(
- title = "Advanced Settings",
- titleTranslation = "bazaarutils.config.advanced.category.label",
- description = "Advanced configurations for routines & features of the mod",
- descriptionTranslation = "bazaarutils.config.advanced.category.hint",
- icon = "curly-braces"
-)
-public class AdvancedConfig {
- @ConfigEntry(
- id = "auto_update",
- translation = "bazaarutils.config.advanced.auto_update.label"
- )
- @Comment(
- value = "Automatically update the mod when an update is found.",
- translation = "bazaarutils.config.advanced.auto_update.hint"
- )
- public static boolean AUTO_UPDATE_TOGGLE = true;
-}
diff --git a/src/main/java/com/github/mkram17/bazaarutils/config/features/DeveloperConfig.java b/src/main/java/com/github/mkram17/bazaarutils/config/features/DeveloperConfig.java
index f67e56b0e3..ef8b3051c8 100644
--- a/src/main/java/com/github/mkram17/bazaarutils/config/features/DeveloperConfig.java
+++ b/src/main/java/com/github/mkram17/bazaarutils/config/features/DeveloperConfig.java
@@ -1,5 +1,7 @@
package com.github.mkram17.bazaarutils.config.features;
+import com.github.mkram17.bazaarutils.config.util.api.conditions.AdvancedConfigurationMode;
+import com.github.mkram17.bazaarutils.config.util.api.annotations.ShowIf;
import com.github.mkram17.bazaarutils.misc.NotificationType;
import com.teamresourceful.resourcefulconfig.api.annotations.*;
@@ -23,12 +25,14 @@ public final class DeveloperConfig {
value = "Global toggle for all developer related functionalities/utilities.",
translation = "bazaarutils.config.developer.enabled.hint"
)
+ @ShowIf(AdvancedConfigurationMode.class)
public static boolean DEVELOPER_MODE_TOGGLE = false;
@ConfigEntry(
id = "disable_error_notifications",
translation = "bazaarutils.config.developer.disable_error_notifications.label"
)
+ @ShowIf(AdvancedConfigurationMode.class)
public static boolean DEVELOPER_MODE_DISABLE_ERROR_NOTIFICATIONS = false;
@ConfigEntry(
@@ -40,6 +44,7 @@ public final class DeveloperConfig {
translation = "bazaarutils.config.developer.debug_messages.hint"
)
@ConfigOption.Draggable
+ @ShowIf(AdvancedConfigurationMode.class)
public static NotificationType[] DEVELOPER_MODE_DEBUG_MESSAGES = new NotificationType[]{};
public static boolean isDeveloperVariableEnabled(NotificationType type) {
diff --git a/src/main/java/com/github/mkram17/bazaarutils/config/features/chat/ChatConfig.java b/src/main/java/com/github/mkram17/bazaarutils/config/features/chat/ChatConfig.java
index e16dbce3c5..fb76e557f7 100644
--- a/src/main/java/com/github/mkram17/bazaarutils/config/features/chat/ChatConfig.java
+++ b/src/main/java/com/github/mkram17/bazaarutils/config/features/chat/ChatConfig.java
@@ -1,5 +1,7 @@
package com.github.mkram17.bazaarutils.config.features.chat;
+import com.github.mkram17.bazaarutils.config.util.api.conditions.AdvancedConfigurationMode;
+import com.github.mkram17.bazaarutils.config.util.api.annotations.ShowIf;
import com.github.mkram17.bazaarutils.features.chat.StashMessagesRemover;
import com.github.mkram17.bazaarutils.features.chat.UselessBazaarNotificationsRemover;
import com.teamresourceful.resourcefulconfig.api.annotations.*;
@@ -34,6 +36,7 @@ public final class ChatConfig {
translation = "bazaarutils.config.chat.useless_bazaar_notifications_remover.excluded_notifications.hint"
)
@ConfigOption.Draggable()
+ @ShowIf(AdvancedConfigurationMode.class)
public static UselessBazaarNotificationsRemover.TransientBazaarMessages[] USELESS_BAZAAR_NOTIFICATIONS_REMOVER_EXCLUDED_NOTIFICATIONS = new UselessBazaarNotificationsRemover.TransientBazaarMessages[]{
UselessBazaarNotificationsRemover.TransientBazaarMessages.CANCELLING_ORDER,
UselessBazaarNotificationsRemover.TransientBazaarMessages.PUTTING_GOODS_IN_ESCROW,
diff --git a/src/main/java/com/github/mkram17/bazaarutils/config/features/gui/ButtonsConfig.java b/src/main/java/com/github/mkram17/bazaarutils/config/features/gui/ButtonsConfig.java
index eaf3a956ec..d509e950b2 100644
--- a/src/main/java/com/github/mkram17/bazaarutils/config/features/gui/ButtonsConfig.java
+++ b/src/main/java/com/github/mkram17/bazaarutils/config/features/gui/ButtonsConfig.java
@@ -1,5 +1,7 @@
package com.github.mkram17.bazaarutils.config.features.gui;
+import com.github.mkram17.bazaarutils.config.util.api.conditions.AdvancedConfigurationMode;
+import com.github.mkram17.bazaarutils.config.util.api.annotations.ShowIf;
import com.github.mkram17.bazaarutils.data.stored.BookmarksStorage;
import com.github.mkram17.bazaarutils.features.gui.buttons.bookmarks.BookmarkUtil;
import com.github.mkram17.bazaarutils.features.gui.buttons.inputhelper.amount.BuyOrderAmountHelper;
@@ -195,12 +197,14 @@ public static final class WidgetButton {
id = "size",
translation = "bazaarutils.config.buttons.button.widget.size.label"
)
+ @ShowIf(AdvancedConfigurationMode.class)
public int size = 18;
@ConfigEntry(
id = "spacing",
translation = "bazaarutils.config.buttons.button.widget.spacing.label"
)
+ @ShowIf(AdvancedConfigurationMode.class)
public int spacing = 4;
public WidgetButton(boolean enabled) {
@@ -231,6 +235,7 @@ public static final class SmallContainerButton {
translation = "bazaarutils.config.buttons.button.container.item_id.hint"
)
@ConfigOption.Renderer("bazaarutils:item")
+ @ShowIf(AdvancedConfigurationMode.class)
public String itemId = "minecraft:green_stained_glass_pane";
@Getter
@@ -244,6 +249,7 @@ public static final class SmallContainerButton {
)
@ConfigOption.Range(min = 0, max = 35)
@ConfigOption.Renderer("bazaarutils:slot")
+ @ShowIf(AdvancedConfigurationMode.class)
public int slotIndex;
public SmallContainerButton(boolean enabled, int slotIndex) {
diff --git a/src/main/java/com/github/mkram17/bazaarutils/config/features/gui/OverlaysConfig.java b/src/main/java/com/github/mkram17/bazaarutils/config/features/gui/OverlaysConfig.java
index 87c2208aee..6ff2b4e540 100644
--- a/src/main/java/com/github/mkram17/bazaarutils/config/features/gui/OverlaysConfig.java
+++ b/src/main/java/com/github/mkram17/bazaarutils/config/features/gui/OverlaysConfig.java
@@ -1,5 +1,7 @@
package com.github.mkram17.bazaarutils.config.features.gui;
+import com.github.mkram17.bazaarutils.config.util.api.conditions.AdvancedConfigurationMode;
+import com.github.mkram17.bazaarutils.config.util.api.annotations.ShowIf;
import com.github.mkram17.bazaarutils.features.gui.overlays.BazaarLimitsVisualizer;
import com.github.mkram17.bazaarutils.features.gui.overlays.PriceCharts;
import com.github.mkram17.bazaarutils.features.gui.overlays.UserOrdersOverlay;
@@ -55,6 +57,7 @@ public class OverlaysConfig {
text = "bazaarutils.config.overlays.bazaar_limits_visualizer.reset_limits.runnable",
title = "bazaarutils.config.overlays.bazaar_limits_visualizer.reset_limits.label"
)
+ @ShowIf(AdvancedConfigurationMode.class)
public static final Runnable RESET_LIMITS_BUTTON = BazaarLimitsVisualizer::resetLimits;
@ConfigEntry(
diff --git a/src/main/java/com/github/mkram17/bazaarutils/config/util/ConfigElementFieldStore.java b/src/main/java/com/github/mkram17/bazaarutils/config/util/ConfigElementFieldStore.java
new file mode 100644
index 0000000000..ffa18e5003
--- /dev/null
+++ b/src/main/java/com/github/mkram17/bazaarutils/config/util/ConfigElementFieldStore.java
@@ -0,0 +1,33 @@
+package com.github.mkram17.bazaarutils.config.util;
+
+import com.teamresourceful.resourcefulconfig.api.types.ResourcefulConfigElement;
+
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.IdentityHashMap;
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * Maps separators and buttons to the {@link Field} they were built from and the
+ * owner instance in scope at parse time, so their visibility conditions can be evaluated.
+ *
+ * @see com.github.mkram17.bazaarutils.mixin.JavaConfigParserMixin
+ */
+public final class ConfigElementFieldStore {
+ private ConfigElementFieldStore() {}
+
+ public record Context(Field field, Optional