diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/Config.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/Config.java index 854c147df..7b42815b1 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/Config.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/Config.java @@ -3,7 +3,8 @@ import org.quiltmc.config.api.ReflectiveConfig; import org.quiltmc.config.api.annotations.Comment; import org.quiltmc.config.api.annotations.Processor; -import org.quiltmc.config.api.annotations.SerializedName; +import org.quiltmc.config.api.annotations.SerializedNameConvention; +import org.quiltmc.config.api.metadata.NamingSchemes; import org.quiltmc.config.api.serializers.TomlSerializer; import org.quiltmc.config.api.values.ComplexConfigValue; import org.quiltmc.config.api.values.ConfigSerializableObject; @@ -30,6 +31,8 @@ * {@link NetConfig the networking configuration}, {@link KeyBindConfig the keybinding configuration}, * {@link DockerConfig the docker configuration}, and {@link DecompilerConfig the decompiler configuration}. */ +@SerializedNameConvention(NamingSchemes.SNAKE_CASE) +@Processor("processChange") public final class Config extends ReflectiveConfig { private static final String FORMAT = "toml"; private static final String FAMILY = "enigma"; @@ -41,55 +44,57 @@ public final class Config extends ReflectiveConfig { private static final DockerConfig DOCKER = ConfigFactory.create(ENVIRONMENT, FAMILY, "docker", DockerConfig.class); private static final DecompilerConfig DECOMPILER = ConfigFactory.create(ENVIRONMENT, FAMILY, "decompiler", DecompilerConfig.class); - @SerializedName("language") @Comment("The currently assigned UI language. This will be an ISO-639 two-letter language code, followed by an underscore and an ISO 3166-1 alpha-2 two-letter country code.") @Processor("grabPossibleLanguages") public final TrackedValue language = this.value(I18n.DEFAULT_LANGUAGE); - @SerializedName("scale_factor") @Comment("A float representing the current size of the UI. 1.0 represents 100% scaling.") public final TrackedValue scaleFactor = this.value(1.0f); - @SerializedName("max_recent_projects") @Comment("The maximum number of saved recent projects, for quickly reopening.") public final TrackedValue maxRecentProjects = this.value(10); - @SerializedName("recent_projects") public final TrackedValue> recentProjects = this.list(new RecentProject("", "")); - @SerializedName("server_notification_level") @Comment("Modifies how many notifications you'll get while part of a multiplayer mapping server.") public final TrackedValue serverNotificationLevel = this.value(NotificationManager.ServerNotificationLevel.FULL); - @SerializedName("window_size") @Comment("How big the Enigma window will open, in pixels.") public final TrackedValue windowSize = this.value(new Vec2i(1024, 576)); - @SerializedName("window_pos") @Comment("The position the top-left corner of Enigma's window will be the next time it opens, in pixels.") public final TrackedValue windowPos = this.value(new Vec2i(0, 0)); + @Comment("The settings for the statistics window.") public final StatsSection stats = new StatsSection(); - @Comment("You shouldn't enable options in this section unless you know what you're doing") + @Comment("Contains all features that can be toggled on or off.") + public final FeaturesSection features = new FeaturesSection(); + + @Comment("You shouldn't enable options in this section unless you know what you're doing!") public final DevSection development = new DevSection(); /** * The look and feel stored in the config: do not use this unless setting! Use {@link #activeLookAndFeel} instead, * since look and feel is final once loaded. */ - @SerializedName("look_and_feel") public final TrackedValue lookAndFeel = this.value(LookAndFeel.DEFAULT); /** * Look and feel is not modifiable at runtime. I have tried and failed multiple times to get this running. */ public static LookAndFeel activeLookAndFeel; - @SerializedName("default_theme") public final Theme defaultTheme = new Theme(LookAndFeel.DEFAULT); - @SerializedName("darcula_theme") public final Theme darculaTheme = new Theme(LookAndFeel.DARCULA); - @SerializedName("metal_theme") public final Theme metalTheme = new Theme(LookAndFeel.METAL); - @SerializedName("system_theme") public final Theme systemTheme = new Theme(LookAndFeel.SYSTEM); - @SerializedName("none_theme") public final Theme noneTheme = new Theme(LookAndFeel.NONE); + @SuppressWarnings("unused") + public void processChange(org.quiltmc.config.api.Config.Builder builder) { + builder.callback(config -> { + for (var value : config.values()) { + if (value.key().length() > 1 && value.key().getKeyComponent(0).equals("development") && value.value().equals(true)) { + this.development.anyEnabled = true; + } + } + }); + } + @SuppressWarnings("all") public static Config main() { return MAIN; diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/DecompilerConfig.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/DecompilerConfig.java index 26feb4037..1168e343e 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/DecompilerConfig.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/DecompilerConfig.java @@ -3,13 +3,15 @@ import org.quiltmc.config.api.ReflectiveConfig; import org.quiltmc.config.api.annotations.Comment; import org.quiltmc.config.api.annotations.Processor; -import org.quiltmc.config.api.annotations.SerializedName; +import org.quiltmc.config.api.annotations.SerializedNameConvention; +import org.quiltmc.config.api.metadata.NamingSchemes; import org.quiltmc.config.api.values.TrackedValue; import org.quiltmc.config.api.values.ValueMap; import org.quiltmc.enigma.impl.source.vineflower.VineflowerPreferences; import java.util.Map; +@SerializedNameConvention(NamingSchemes.SNAKE_CASE) public class DecompilerConfig extends ReflectiveConfig { public DecompilerConfig() { VineflowerPreferences.OPTIONS.putAll(this.vineflower.stringValues.value()); @@ -17,19 +19,15 @@ public DecompilerConfig() { VineflowerPreferences.OPTIONS.putAll(this.vineflower.booleanValues.value()); } - @SerializedName("active_decompiler") public final TrackedValue activeDecompiler = this.value(Decompiler.VINEFLOWER); @Comment("The options passed to the Vineflower decompiler. What these do can be found here: https://vineflower.org/usage/.") public final VineflowerSection vineflower = new VineflowerSection(); public static final class VineflowerSection extends Section { - @SerializedName("string_values") @Processor("processStrings") public final TrackedValue> stringValues = this.map("").build(); - @SerializedName("int_values") @Processor("processIntegers") public final TrackedValue> intValues = this.map(0).build(); - @SerializedName("boolean_values") @Processor("processBooleans") public final TrackedValue> booleanValues = this.map(true).build(); diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/DevSection.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/DevSection.java index c7452cd43..b09ec17eb 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/DevSection.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/DevSection.java @@ -1,21 +1,22 @@ package org.quiltmc.enigma.gui.config; -import com.google.gson.annotations.SerializedName; import org.quiltmc.config.api.ReflectiveConfig; import org.quiltmc.config.api.annotations.Processor; +import org.quiltmc.config.api.annotations.SerializedNameConvention; +import org.quiltmc.config.api.metadata.NamingSchemes; import org.quiltmc.config.api.values.TrackedValue; import org.quiltmc.enigma.api.source.DecompiledClassSource; import org.quiltmc.enigma.gui.network.IntegratedEnigmaClient; +@SerializedNameConvention(NamingSchemes.SNAKE_CASE) public class DevSection extends ReflectiveConfig.Section { - @SerializedName("show_mapping_source_plugin") + public transient boolean anyEnabled = false; + public final TrackedValue showMappingSourcePlugin = this.value(false); - @SerializedName("debug_token_highlights") @Processor("processDebugTokenHighlights") public final TrackedValue debugTokenHighlights = this.value(false); - @SerializedName("log_client_packets") @Processor("processLogClientPackets") public final TrackedValue logClientPackets = this.value(false); diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/DockerConfig.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/DockerConfig.java index 501abd72a..acf1455b8 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/DockerConfig.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/DockerConfig.java @@ -2,7 +2,8 @@ import org.quiltmc.config.api.ReflectiveConfig; import org.quiltmc.config.api.annotations.Comment; -import org.quiltmc.config.api.annotations.SerializedName; +import org.quiltmc.config.api.annotations.SerializedNameConvention; +import org.quiltmc.config.api.metadata.NamingSchemes; import org.quiltmc.config.api.values.ComplexConfigValue; import org.quiltmc.config.api.values.ConfigSerializableObject; import org.quiltmc.config.api.values.TrackedValue; @@ -14,28 +15,21 @@ import java.util.HashMap; import java.util.Map; +@SerializedNameConvention(NamingSchemes.SNAKE_CASE) public class DockerConfig extends ReflectiveConfig { - @SerializedName("left_vertical_divider_location") public final TrackedValue leftVerticalDividerLocation = this.value(300); - @SerializedName("right_vertical_divider_location") public final TrackedValue rightVerticalDividerLocation = this.value(300); - @SerializedName("left_horizontal_divider_location") public final TrackedValue leftHorizontalDividerLocation = this.value(300); - @SerializedName("right_horizontal_divider_location") public final TrackedValue rightHorizontalDividerLocation = this.value(700); @Comment("A bodge to properly offset the right divider location depending on UI state.") - @SerializedName("saved_with_left_docker_open") public final TrackedValue savedWithLeftDockerOpen = this.value(true); @Comment("The location of each docker's button in the button sidebars.") @Comment("Encoded with the side (RIGHT or LEFT) followed by a semicolon (;) and the vertical location (TOP or BOTTOM).") - @SerializedName("button_locations") public final TrackedValue> buttonLocations = this.map(new Docker.Location(Docker.Side.LEFT, Docker.VerticalLocation.TOP)).build(); @Comment("The currently active dockers on the left side of the UI.") - @SerializedName("left_dockers") public final TrackedValue leftDockers = this.value(new SelectedDockers("", "", "all_classes")); @Comment("The currently active dockers on the right side of the UI.") - @SerializedName("right_dockers") public final TrackedValue rightDockers = this.value(new SelectedDockers("", "", "structure")); public SelectedDockers getSelectedDockers(Docker.Side side) { diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/FeaturesSection.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/FeaturesSection.java new file mode 100644 index 000000000..9567ec172 --- /dev/null +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/FeaturesSection.java @@ -0,0 +1,13 @@ +package org.quiltmc.enigma.gui.config; + +import org.quiltmc.config.api.ReflectiveConfig; +import org.quiltmc.config.api.annotations.Comment; +import org.quiltmc.config.api.annotations.SerializedNameConvention; +import org.quiltmc.config.api.metadata.NamingSchemes; +import org.quiltmc.config.api.values.TrackedValue; + +@SerializedNameConvention(NamingSchemes.SNAKE_CASE) +public class FeaturesSection extends ReflectiveConfig.Section { + @Comment("Enables statistic icons in the class tree. This has a major performance impact on JAR files with lots of classes.") + public final TrackedValue enableClassTreeStatIcons = this.value(true); +} diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/KeyBindConfig.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/KeyBindConfig.java index 4bce24fe5..4b560b630 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/KeyBindConfig.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/KeyBindConfig.java @@ -1,14 +1,15 @@ package org.quiltmc.enigma.gui.config; import org.quiltmc.config.api.ReflectiveConfig; -import org.quiltmc.config.api.annotations.SerializedName; +import org.quiltmc.config.api.annotations.SerializedNameConvention; +import org.quiltmc.config.api.metadata.NamingSchemes; import org.quiltmc.config.api.values.TrackedValue; import org.quiltmc.config.api.values.ValueList; import org.quiltmc.config.api.values.ValueMap; import org.quiltmc.enigma.gui.config.keybind.KeyBind; +@SerializedNameConvention(NamingSchemes.SNAKE_CASE) public final class KeyBindConfig extends ReflectiveConfig { - @SerializedName("key_codes") public final TrackedValue>> keyCodes = this.map(ValueList.create("")).build(); public String[] getKeyCodes(KeyBind keyBind) { diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/NetConfig.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/NetConfig.java index 98831147f..545d0220f 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/NetConfig.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/NetConfig.java @@ -2,21 +2,18 @@ import org.quiltmc.config.api.ReflectiveConfig; import org.quiltmc.config.api.annotations.Comment; -import org.quiltmc.config.api.annotations.SerializedName; +import org.quiltmc.config.api.annotations.SerializedNameConvention; +import org.quiltmc.config.api.metadata.NamingSchemes; import org.quiltmc.config.api.values.TrackedValue; import org.quiltmc.enigma.network.EnigmaServer; +@SerializedNameConvention(NamingSchemes.SNAKE_CASE) public final class NetConfig extends ReflectiveConfig { - @SerializedName("username") @Comment("Your username for multiplayer mapping. Defaults to the system username.") public final TrackedValue username = this.value(System.getProperty("user.name", "user")); - @SerializedName("password") public final TrackedValue password = this.value(""); - @SerializedName("remote_address") public final TrackedValue remoteAddress = this.value(""); - @SerializedName("server_password") public final TrackedValue serverPassword = this.value(""); - @SerializedName("server_port") @Comment("The network port of this server. Interesting fact! The default was decided pretty much at random in the Fabric discord: https://discordapp.com/channels/507304429255393322/566418023372816394/700292322918793347 (server: https://fabricmc.net/discuss/). You can still blame 2xsaiko if it conflicts with anything.") public final TrackedValue serverPort = this.value(EnigmaServer.DEFAULT_PORT); } diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/StatsSection.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/StatsSection.java index 40e4ffc41..11027a047 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/StatsSection.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/StatsSection.java @@ -1,14 +1,13 @@ package org.quiltmc.enigma.gui.config; import org.quiltmc.config.api.ReflectiveConfig; -import org.quiltmc.config.api.annotations.SerializedName; +import org.quiltmc.config.api.annotations.SerializedNameConvention; +import org.quiltmc.config.api.metadata.NamingSchemes; import org.quiltmc.config.api.values.TrackedValue; +@SerializedNameConvention(NamingSchemes.SNAKE_CASE) public class StatsSection extends ReflectiveConfig.Section { - @SerializedName("last_selected_dir") public final TrackedValue lastSelectedDir = this.value(""); - @SerializedName("last_top_level_package") public final TrackedValue lastTopLevelPackage = this.value(""); - @SerializedName("should_include_synthetic_parameters") public final TrackedValue shouldIncludeSyntheticParameters = this.value(false); } diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/theme/Theme.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/theme/Theme.java index ebe9b8a36..41294835f 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/theme/Theme.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/config/theme/Theme.java @@ -2,7 +2,8 @@ import org.quiltmc.config.api.ReflectiveConfig; import org.quiltmc.config.api.annotations.Comment; -import org.quiltmc.config.api.annotations.SerializedName; +import org.quiltmc.config.api.annotations.SerializedNameConvention; +import org.quiltmc.config.api.metadata.NamingSchemes; import org.quiltmc.config.api.values.ComplexConfigValue; import org.quiltmc.config.api.values.ConfigSerializableObject; import org.quiltmc.config.api.values.TrackedValue; @@ -11,6 +12,7 @@ import java.awt.Color; import java.awt.Font; +@SerializedNameConvention(NamingSchemes.SNAKE_CASE) public class Theme extends ReflectiveConfig.Section { public final transient LookAndFeel lookAndFeel; public Theme(LookAndFeel lookAndFeel) { @@ -18,19 +20,13 @@ public Theme(LookAndFeel lookAndFeel) { } @Comment("Colors are encoded in the RGBA format.") - @SerializedName("colors") public final Colors colors = new Colors(); - @SerializedName("fonts") public final Fonts fonts = new Fonts(); public static class Fonts extends ReflectiveConfig.Section { - @SerializedName("default_bold") public final TrackedValue defaultBold = this.value(new SerializableFont(Font.decode(Font.DIALOG).deriveFont(Font.BOLD))); - @SerializedName("default_normal") public final TrackedValue defaultNormal = this.value(new SerializableFont(Font.decode(Font.DIALOG))); - @SerializedName("small") public final TrackedValue small = this.value(new SerializableFont(Font.decode(Font.DIALOG))); - @SerializedName("editor") public final TrackedValue editor = this.value(new SerializableFont(Font.decode(Font.MONOSPACED))); public static class SerializableFont extends Font implements ConfigSerializableObject> { @@ -76,58 +72,32 @@ public String toString() { * Default values are for light themes. */ public static class Colors extends ReflectiveConfig.Section { - @SerializedName("line_numbers_foreground") public final TrackedValue lineNumbersForeground = this.value(new SerializableColor(0xFF333300)); - @SerializedName("line_numbers_background") public final TrackedValue lineNumbersBackground = this.value(new SerializableColor(0xFFEEEEFF)); - @SerializedName("line_numbers_selected") public final TrackedValue lineNumbersSelected = this.value(new SerializableColor(0xFFCCCCEE)); - @SerializedName("obfuscated") public final TrackedValue obfuscated = this.value(new SerializableColor(0xFFFFDCDC)); - @SerializedName("obfuscated_outline") public final TrackedValue obfuscatedOutline = this.value(new SerializableColor(0xFFA05050)); - @SerializedName("proposed") public final TrackedValue proposed = this.value(new SerializableColor(0x27000000)); - @SerializedName("proposed_outline") public final TrackedValue proposedOutline = this.value(new SerializableColor(0xBF000000)); - @SerializedName("deobfuscated") public final TrackedValue deobfuscated = this.value(new SerializableColor(0xFFDCFFDC)); - @SerializedName("deobfuscated_outline") public final TrackedValue deobfuscatedOutline = this.value(new SerializableColor(0xFF50A050)); - @SerializedName("editor_background") public final TrackedValue editorBackground = this.value(new SerializableColor(0xFFFFFFFF)); - @SerializedName("highlight") public final TrackedValue highlight = this.value(new SerializableColor(0xFF3333EE)); - @SerializedName("caret") public final TrackedValue caret = this.value(new SerializableColor(0xFF000000)); - @SerializedName("selection_highlight") public final TrackedValue selectionHighlight = this.value(new SerializableColor(0xFF000000)); - @SerializedName("string") public final TrackedValue string = this.value(new SerializableColor(0xFFCC6600)); - @SerializedName("number") public final TrackedValue number = this.value(new SerializableColor(0xFF999933)); - @SerializedName("operator") public final TrackedValue operator = this.value(new SerializableColor(0xFF000000)); - @SerializedName("delimiter") public final TrackedValue delimiter = this.value(new SerializableColor(0xFF000000)); - @SerializedName("type") public final TrackedValue type = this.value(new SerializableColor(0xFF000000)); - @SerializedName("identifier") public final TrackedValue identifier = this.value(new SerializableColor(0xFF000000)); - @SerializedName("comment") public final TrackedValue comment = this.value(new SerializableColor(0xFF339933)); - @SerializedName("text") public final TrackedValue text = this.value(new SerializableColor(0xFF000000)); - - @SerializedName("debug_token") public final TrackedValue debugToken = this.value(new SerializableColor(0xFFD9BEF9)); - @SerializedName("debug_token_outline") public final TrackedValue debugTokenOutline = this.value(new SerializableColor(0xFFBD93F9)); - - @SerializedName("dock_highlight") public final TrackedValue dockHighlight = this.value(new SerializableColor(0xFF0000FF)); public static class SerializableColor extends Color implements ConfigSerializableObject { diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/docker/AbstractInheritanceTreeDocker.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/docker/AbstractInheritanceTreeDocker.java index 9acf17d29..579722845 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/docker/AbstractInheritanceTreeDocker.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/docker/AbstractInheritanceTreeDocker.java @@ -86,7 +86,7 @@ public void display(Entry entry) { this.tree.expandPath(path); this.tree.setSelectionRow(this.tree.getRowForPath(path)); } else { - setupTree(null); + this.setupTree(null); } this.setVisible(true); diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/element/ClassTreeCellRenderer.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/element/ClassTreeCellRenderer.java index 97d19d721..aa514498b 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/element/ClassTreeCellRenderer.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/element/ClassTreeCellRenderer.java @@ -3,6 +3,7 @@ import org.quiltmc.enigma.gui.ClassSelector; import org.quiltmc.enigma.gui.Gui; import org.quiltmc.enigma.gui.GuiController; +import org.quiltmc.enigma.gui.config.Config; import org.quiltmc.enigma.gui.node.ClassSelectorClassNode; import org.quiltmc.enigma.gui.node.ClassSelectorPackageNode; import org.quiltmc.enigma.gui.util.GuiUtil; @@ -93,17 +94,21 @@ String getDisplayName() { JLabel nodeLabel = new JLabel(icon); panel.add(nodeLabel); - if (this.controller.getStatsGenerator() != null) { - ProjectStatsResult stats = this.controller.getStatsGenerator().getResultNullable(); - if (stats == null) { - // calculate stats on a separate thread for performance reasons - this.setIcon(GuiUtil.PENDING_STATUS_ICON); - reloader.run(); + if (Config.main().features.enableClassTreeStatIcons.value()) { + if (this.controller.getStatsGenerator() != null) { + ProjectStatsResult stats = this.controller.getStatsGenerator().getResultNullable(); + if (stats == null) { + // calculate stats on a separate thread for performance reasons + this.setIcon(GuiUtil.PENDING_STATUS_ICON); + reloader.run(); + } else { + this.setIcon(deobfuscationIconGetter.apply(stats)); + } } else { - this.setIcon(deobfuscationIconGetter.apply(stats)); + this.setIcon(GuiUtil.PENDING_STATUS_ICON); } } else { - this.setIcon(GuiUtil.PENDING_STATUS_ICON); + this.setIcon(null); } panel.add(this); diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/element/MenuBar.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/element/MenuBar.java index 3fb14604a..4c9f9b386 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/element/MenuBar.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/element/MenuBar.java @@ -164,7 +164,7 @@ public MenuBar(Gui gui) { this.helpMenu.add(this.githubItem); ui.add(this.helpMenu); - if (System.getProperty("enigma.development", "false").equalsIgnoreCase("true")) { + if (System.getProperty("enigma.development", "false").equalsIgnoreCase("true") || Config.main().development.anyEnabled) { ui.add(this.devMenu); } diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/node/ClassSelectorClassNode.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/node/ClassSelectorClassNode.java index 332db34e4..33607b9dd 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/node/ClassSelectorClassNode.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/node/ClassSelectorClassNode.java @@ -4,6 +4,7 @@ import org.quiltmc.enigma.gui.ClassSelector; import org.quiltmc.enigma.gui.EditableType; import org.quiltmc.enigma.gui.Gui; +import org.quiltmc.enigma.gui.config.Config; import org.quiltmc.enigma.gui.util.GuiUtil; import org.quiltmc.enigma.api.stats.StatsGenerator; import org.quiltmc.enigma.api.translation.representation.entry.ClassEntry; @@ -68,7 +69,9 @@ public void done() { } }; - SwingUtilities.invokeLater(iconUpdateWorker::execute); + if (Config.main().features.enableClassTreeStatIcons.value()) { + SwingUtilities.invokeLater(iconUpdateWorker::execute); + } } @Override