From c8a15b713e7166ed78d359a23da6b19b7bf5d96e Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Thu, 19 Sep 2019 23:24:27 +0200 Subject: [PATCH] config: Rework sections and titles (#1618) --- .../client/config/ConfigDescriptor.java | 34 +- .../runelite/client/config/ConfigItem.java | 6 +- .../runelite/client/config/ConfigManager.java | 54 +- .../client/config/ConfigPanelItem.java | 41 - .../runelite/client/config/ConfigSection.java | 57 + .../client/config/ConfigTitleSection.java | 57 + .../client/config/{Stub.java => Title.java} | 2 +- .../client/plugins/agility/AgilityConfig.java | 47 +- .../plugins/aoewarnings/AoeWarningConfig.java | 337 ++--- .../BarbarianAssaultConfig.java | 93 +- .../ChatTranslationConfig.java | 47 +- .../client/plugins/config/ConfigPanel.java | 1093 +++++++++-------- .../client/plugins/coxhelper/CoxConfig.java | 101 +- .../plugins/fightcave/FightCaveConfig.java | 29 +- .../freezetimers/FreezeTimersConfig.java | 37 +- .../plugins/gauntlet/GauntletConfig.java | 63 +- .../client/plugins/gpu/GpuPluginConfig.java | 41 +- .../grounditems/GroundItemsConfig.java | 200 +-- .../hideprayers/HidePrayersConfig.java | 170 ++- .../idlenotifier/IdleNotifierConfig.java | 29 +- .../client/plugins/inferno/InfernoConfig.java | 54 +- .../LootingBagViewerConfig.java | 37 +- .../loottracker/LootTrackerConfig.java | 24 +- .../MenuEntrySwapperConfig.java | 381 ++++-- .../ObjectIndicatorsConfig.java | 27 +- .../pileindicators/PileIndicatorsConfig.java | 63 +- .../PlayerIndicatorsConfig.java | 298 +++-- .../client/plugins/raids/RaidsConfig.java | 83 +- .../plugins/runecraft/RunecraftConfig.java | 58 +- .../plugins/runedoku/RunedokuConfig.java | 40 +- .../plugins/statusorbs/StatusOrbsConfig.java | 35 +- .../client/plugins/theatre/TheatreConfig.java | 176 ++- .../plugins/ticktimers/TickTimersConfig.java | 43 +- .../client/plugins/tmorph/TMorphConfig.java | 65 +- .../client/plugins/zalcano/ZalcanoConfig.java | 45 +- .../client/ui/components/IconButton.java | 44 +- .../components/MinimumSizedPanel.java} | 35 +- 37 files changed, 2291 insertions(+), 1755 deletions(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/config/ConfigSection.java create mode 100644 runelite-client/src/main/java/net/runelite/client/config/ConfigTitleSection.java rename runelite-client/src/main/java/net/runelite/client/config/{Stub.java => Title.java} (68%) rename runelite-client/src/main/java/net/runelite/client/{config/ConfigItemsGroup.java => ui/components/MinimumSizedPanel.java} (71%) diff --git a/runelite-client/src/main/java/net/runelite/client/config/ConfigDescriptor.java b/runelite-client/src/main/java/net/runelite/client/config/ConfigDescriptor.java index 4ceb696339..f8347c01b4 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/ConfigDescriptor.java +++ b/runelite-client/src/main/java/net/runelite/client/config/ConfigDescriptor.java @@ -24,38 +24,22 @@ */ package net.runelite.client.config; -import java.util.ArrayList; import java.util.Collection; +import lombok.Getter; +@Getter public class ConfigDescriptor { private final ConfigGroup group; - private final Collection itemGroups; + private final Collection sections; + private final Collection titleSections; + private final Collection items; - public ConfigDescriptor(ConfigGroup group, Collection itemGroups) + public ConfigDescriptor(ConfigGroup group, Collection sections, Collection titleSections, Collection items) { this.group = group; - this.itemGroups = itemGroups; + this.sections = sections; + this.titleSections = titleSections; + this.items = items; } - - public ConfigGroup getGroup() - { - return group; - } - - public Collection getItemGroups() - { - return itemGroups; - } - - public Collection getItems() - { - Collection allItems = new ArrayList<>(); - for (ConfigItemsGroup g : itemGroups) - { - allItems.addAll(g.getItems()); - } - return allItems; - } - } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/config/ConfigItem.java b/runelite-client/src/main/java/net/runelite/client/config/ConfigItem.java index 201fe30234..77c58c7e86 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/ConfigItem.java +++ b/runelite-client/src/main/java/net/runelite/client/config/ConfigItem.java @@ -47,7 +47,9 @@ public @interface ConfigItem boolean secret() default false; - String group() default ""; + String section() default ""; + + String titleSection() default ""; String unhide() default ""; @@ -57,8 +59,6 @@ public @interface ConfigItem String hideValue() default ""; - String parent() default ""; - String enabledBy() default ""; String enabledByValue() default ""; diff --git a/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java b/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java index d33e4e5575..4f74a5e166 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java +++ b/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java @@ -45,9 +45,7 @@ import java.nio.channels.FileLock; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; -import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.EnumSet; import java.util.HashMap; import java.util.List; @@ -346,8 +344,26 @@ public class ConfigManager throw new IllegalArgumentException("Not a config group"); } + final List sections = Arrays.stream(inter.getMethods()) + .filter(m -> m.getParameterCount() == 0 && m.isAnnotationPresent(ConfigSection.class) && m.getReturnType() == boolean.class) + .map(m -> m.getDeclaredAnnotation(ConfigSection.class)) + .sorted((a, b) -> ComparisonChain.start() + .compare(a.position(), b.position()) + .compare(a.name(), b.name()) + .result()) + .collect(Collectors.toList()); + + final List titleSections = Arrays.stream(inter.getMethods()) + .filter(m -> m.getParameterCount() == 0 && m.isAnnotationPresent(ConfigTitleSection.class)) + .map(m -> m.getDeclaredAnnotation(ConfigTitleSection.class)) + .sorted((a, b) -> ComparisonChain.start() + .compare(a.position(), b.position()) + .compare(a.name(), b.name()) + .result()) + .collect(Collectors.toList()); + final List items = Arrays.stream(inter.getMethods()) - .filter(m -> m.getParameterCount() == 0) + .filter(m -> m.getParameterCount() == 0 && m.isAnnotationPresent(ConfigItem.class)) .map(m -> new ConfigItemDescriptor( m.getDeclaredAnnotation(ConfigItem.class), m.getReturnType(), @@ -360,35 +376,7 @@ public class ConfigManager .result()) .collect(Collectors.toList()); - Collection itemGroups = new ArrayList<>(); - - for (ConfigItemDescriptor item : items) - { - String groupName = item.getItem().group(); - boolean found = false; - for (ConfigItemsGroup g : itemGroups) - { - if (g.getGroup().equals(groupName)) - { - g.addItem(item); - found = true; - break; - } - } - if (!found) - { - ConfigItemsGroup newGroup = new ConfigItemsGroup(groupName); - newGroup.addItem(item); - itemGroups.add(newGroup); - } - } - - itemGroups = itemGroups.stream().sorted((a, b) -> ComparisonChain.start() - .compare(a.getGroup(), b.getGroup()) - .result()) - .collect(Collectors.toList()); - - return new ConfigDescriptor(group, itemGroups); + return new ConfigDescriptor(group, sections, titleSections, items); } /** @@ -543,7 +531,7 @@ public class ConfigManager { return Arrays.stream(str.split(",")).mapToInt(Integer::valueOf).toArray(); } - return new int[] {Integer.parseInt(str)}; + return new int[]{Integer.parseInt(str)}; } if (type == EnumSet.class) { diff --git a/runelite-client/src/main/java/net/runelite/client/config/ConfigPanelItem.java b/runelite-client/src/main/java/net/runelite/client/config/ConfigPanelItem.java index fa7c338ed4..259a52e8c2 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/ConfigPanelItem.java +++ b/runelite-client/src/main/java/net/runelite/client/config/ConfigPanelItem.java @@ -47,45 +47,4 @@ public class ConfigPanelItem this.children = new ArrayList<>(); this.item = item; } - - public List getItemsAsList() - { - List items = new ArrayList<>(); - - items.add(this); - - for (ConfigPanelItem child : children) - { - items.addAll(child.getItemsAsList()); - } - return items; - } - - public int getDepth() - { - return (parent == null ? 0 : parent.getDepth() + 1); - } - - public boolean addChildIfMatchParent(ConfigItemDescriptor cid) - { - - if (item != null && item.getItem().keyName().equals(cid.getItem().parent())) - { - children.add(new ConfigPanelItem(this, cid)); - return true; - } - else - { - for (ConfigPanelItem child : children) - { - if (child.addChildIfMatchParent(cid)) - { - return true; - } - } - return false; - } - - } - } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/config/ConfigSection.java b/runelite-client/src/main/java/net/runelite/client/config/ConfigSection.java new file mode 100644 index 0000000000..4cc17008fc --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/config/ConfigSection.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2019, Hydrox6 + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.config; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface ConfigSection +{ + int position(); + + String keyName(); + + String name(); + + String description(); + + String section() default ""; + + String titleSection() default ""; + + boolean hidden() default false; + + String unhide() default ""; + + String unhideValue() default ""; + + String hide() default ""; + + String hideValue() default ""; +} diff --git a/runelite-client/src/main/java/net/runelite/client/config/ConfigTitleSection.java b/runelite-client/src/main/java/net/runelite/client/config/ConfigTitleSection.java new file mode 100644 index 0000000000..435ed7885f --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/config/ConfigTitleSection.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2019, Hydrox6 + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.config; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface ConfigTitleSection +{ + int position(); + + String keyName(); + + String name(); + + String description(); + + String section() default ""; + + String titleSection() default ""; + + boolean hidden() default false; + + String unhide() default ""; + + String unhideValue() default ""; + + String hide() default ""; + + String hideValue() default ""; +} diff --git a/runelite-client/src/main/java/net/runelite/client/config/Stub.java b/runelite-client/src/main/java/net/runelite/client/config/Title.java similarity index 68% rename from runelite-client/src/main/java/net/runelite/client/config/Stub.java rename to runelite-client/src/main/java/net/runelite/client/config/Title.java index be68c83b34..e4474544a0 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/Stub.java +++ b/runelite-client/src/main/java/net/runelite/client/config/Title.java @@ -1,5 +1,5 @@ package net.runelite.client.config; -public class Stub +public class Title { } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilityConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilityConfig.java index 07f4cffea8..d349b04129 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilityConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilityConfig.java @@ -28,20 +28,21 @@ import java.awt.Color; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -import net.runelite.client.config.Stub; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; @ConfigGroup("agility") public interface AgilityConfig extends Config { - @ConfigItem( - position = 0, + @ConfigTitleSection( keyName = "mainConfig", + position = 0, name = "Main Config", description = "" ) - default Stub mainConfig() + default Title mainConfig() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -51,7 +52,7 @@ public interface AgilityConfig extends Config warning = "
Enabling this setting on a low end machine may severely affect your fps." + "
Click yes to enable this setting, knowing it might affect performance.
", position = 1, - parent = "mainConfig" + titleSection = "mainConfig" ) default boolean removeDistanceCap() { @@ -63,7 +64,7 @@ public interface AgilityConfig extends Config name = "Show Lap Count", description = "Enable/disable the lap counter", position = 2, - parent = "mainConfig" + titleSection = "mainConfig" ) default boolean showLapCount() { @@ -75,7 +76,7 @@ public interface AgilityConfig extends Config name = "Hide Lap Count", description = "Time in minutes until the lap counter hides/resets", position = 3, - parent = "mainConfig", + titleSection = "mainConfig", hidden = true, unhide = "showLapCount" ) @@ -89,7 +90,7 @@ public interface AgilityConfig extends Config name = "Show Laps Until Level", description = "Show number of laps remaining until next level is reached.", position = 4, - parent = "mainConfig", + titleSection = "mainConfig", hidden = true, unhide = "showLapCount" ) @@ -103,7 +104,7 @@ public interface AgilityConfig extends Config name = "Show Laps Until Goal", description = "Show number of laps remaining until experience tracker goal is reached", position = 5, - parent = "mainConfig", + titleSection = "mainConfig", hidden = true, unhide = "showLapCount" ) @@ -117,7 +118,7 @@ public interface AgilityConfig extends Config name = "Agility Arena timer", description = "Configures whether Agility Arena timer is displayed", position = 6, - parent = "mainConfig" + titleSection = "mainConfig" ) default boolean showAgilityArenaTimer() { @@ -129,22 +130,22 @@ public interface AgilityConfig extends Config name = "Show Shortcut Agility Reqs", description = "Enable/disable showing shortcut agility level requirements in right-click options", position = 7, - parent = "mainConfig" + titleSection = "mainConfig" ) default boolean showShortcutLevel() { return false; } - @ConfigItem( - position = 8, + @ConfigTitleSection( keyName = "miscConfig", + position = 8, name = "Misc Config", description = "" ) - default Stub miscConfig() + default Title miscConfig() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -152,7 +153,7 @@ public interface AgilityConfig extends Config name = "Highlight Marks of Grace", description = "Enable/disable the highlighting of retrievable Marks of Grace", position = 9, - parent = "miscConfig" + titleSection = "miscConfig" ) default boolean highlightMarks() { @@ -164,7 +165,7 @@ public interface AgilityConfig extends Config name = "Highlight Agility Shortcuts", description = "Enable/disable the highlighting of Agility shortcuts", position = 10, - parent = "miscConfig" + titleSection = "miscConfig" ) default boolean highlightShortcuts() { @@ -176,7 +177,7 @@ public interface AgilityConfig extends Config name = "Highlight Traps", description = "Enable/disable the highlighting of traps on Agility courses", position = 11, - parent = "miscConfig" + titleSection = "miscConfig" ) default boolean showTrapOverlay() { @@ -188,7 +189,7 @@ public interface AgilityConfig extends Config name = "Agility Arena notifier", description = "Notify on ticket location change in Agility Arena", position = 12, - parent = "miscConfig" + titleSection = "miscConfig" ) default boolean notifyAgilityArena() { @@ -200,7 +201,7 @@ public interface AgilityConfig extends Config name = "Global Overlay Color", description = "Color of Agility overlay", position = 13, - parent = "miscConfig" + titleSection = "miscConfig" ) default Color getOverlayColor() { @@ -212,7 +213,7 @@ public interface AgilityConfig extends Config name = "Trap Overlay Color", description = "Color of Agility trap overlay", position = 14, - parent = "miscConfig", + titleSection = "miscConfig", hidden = true, unhide = "showTrapOverlay" ) @@ -226,7 +227,7 @@ public interface AgilityConfig extends Config name = "Mark Highlight Color", description = "Color of highlighted Marks of Grace", position = 15, - parent = "miscConfig", + titleSection = "miscConfig", hidden = true, unhide = "highlightMarks" ) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningConfig.java index bf64d697ea..28fd21d42b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningConfig.java @@ -33,8 +33,9 @@ import lombok.Getter; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigTitleSection; import net.runelite.client.config.Range; -import net.runelite.client.config.Stub; +import net.runelite.client.config.Title; @ConfigGroup("aoe") public interface AoeWarningConfig extends Config @@ -57,26 +58,38 @@ public interface AoeWarningConfig extends Config } } + @ConfigTitleSection( + keyName = "notifyTitle", + name = "Notify", + description = "", + position = -1 + ) + default Title notifyTitle() + { + return new Title(); + } + @ConfigItem( keyName = "aoeNotifyAll", name = "Notify for all AoE warnings", description = "Configures whether or not AoE Projectile Warnings should trigger a notification", - position = 0 + position = 0, + titleSection = "notifyTitle" ) default boolean aoeNotifyAll() { return false; } - @ConfigItem( - keyName = "overlayStub", + @ConfigTitleSection( + keyName = "overlayTitle", name = "Overlay", description = "", position = 1 ) - default Stub overlayStub() + default Title overlayTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -84,7 +97,7 @@ public interface AoeWarningConfig extends Config keyName = "overlayColor", name = "Overlay Color", description = "Configures the color of the AoE Projectile Warnings overlay", - parent = "overlayStub" + titleSection = "overlayTitle" ) default Color overlayColor() { @@ -95,7 +108,7 @@ public interface AoeWarningConfig extends Config keyName = "outline", name = "Display Outline", description = "Configures whether or not AoE Projectile Warnings have an outline", - parent = "overlayStub", + titleSection = "overlayTitle", position = 3 ) default boolean isOutlineEnabled() @@ -107,7 +120,7 @@ public interface AoeWarningConfig extends Config keyName = "delay", name = "Fade Delay", description = "Configures the amount of time in milliseconds that the warning lingers for after the projectile has touched the ground", - parent = "overlayStub", + titleSection = "overlayTitle", position = 4 ) default int delay() @@ -119,7 +132,7 @@ public interface AoeWarningConfig extends Config keyName = "fade", name = "Fade Warnings", description = "Configures whether or not AoE Projectile Warnings fade over time", - parent = "overlayStub", + titleSection = "overlayTitle", position = 5 ) default boolean isFadeEnabled() @@ -131,7 +144,7 @@ public interface AoeWarningConfig extends Config keyName = "tickTimers", name = "Tick Timers", description = "Configures whether or not AoE Projectile Warnings has tick timers overlaid as well.", - parent = "overlayStub", + titleSection = "overlayTitle", position = 6 ) default boolean tickTimers() @@ -139,17 +152,17 @@ public interface AoeWarningConfig extends Config return true; } - @ConfigItem( + @ConfigTitleSection( + keyName = "textTitle", position = 7, - keyName = "text", name = "Text", description = "", hidden = true, unhide = "tickTimers" ) - default Stub text() + default Title textTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -157,7 +170,7 @@ public interface AoeWarningConfig extends Config keyName = "fontStyle", name = "Font Style", description = "Bold/Italics/Plain", - parent = "text", + titleSection = "textTitle", hidden = true, unhide = "tickTimers" ) @@ -175,7 +188,7 @@ public interface AoeWarningConfig extends Config keyName = "textSize", name = "Text Size", description = "Text Size for Timers.", - parent = "text", + titleSection = "textTitle", hidden = true, unhide = "tickTimers" ) @@ -189,7 +202,7 @@ public interface AoeWarningConfig extends Config keyName = "shadows", name = "Shadows", description = "Adds Shadows to text.", - parent = "text", + titleSection = "textTitle", hidden = true, unhide = "tickTimers" ) @@ -198,34 +211,34 @@ public interface AoeWarningConfig extends Config return true; } - @ConfigItem( - keyName = "npcStub", + @ConfigTitleSection( + keyName = "npcTitle", name = "NPC's", description = "", position = 11 ) - default Stub npcStub() + default Title npcTitle() { - return new Stub(); + return new Title(); } - @ConfigItem( - keyName = "lizardmanaoeStub", + @ConfigTitleSection( + keyName = "lizardmanaoeTitle", name = "Lizardman Shamans", description = "", position = 12, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub lizardmanaoeStub() + default Title lizardmanaoeTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "lizardmanaoe", name = "Lizardman Shamans", description = "Configures whether or not AoE Projectile Warnings for Lizardman Shamans is displayed", - parent = "lizardmanaoeStub", + titleSection = "lizardmanaoeTitle", position = 13 ) default boolean isShamansEnabled() @@ -237,7 +250,7 @@ public interface AoeWarningConfig extends Config keyName = "lizardmanaoenotify", name = "Lizardman Shamans Notify", description = "Configures whether or not AoE Projectile Warnings for Lizardman Shamans should trigger a notification", - parent = "lizardmanaoeStub", + titleSection = "lizardmanaoeTitle", position = 14, hide = "aoeNotifyAll" ) @@ -246,23 +259,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "archaeologistaoeStub", + @ConfigTitleSection( + keyName = "archaeologistaoeTitle", name = "Crazy Archaeologist", description = "", position = 15, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub archaeologistaoeStub() + default Title archaeologistaoeTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "archaeologistaoe", name = "Crazy Archaeologist", description = "Configures whether or not AoE Projectile Warnings for Archaeologist is displayed", - parent = "archaeologistaoeStub", + titleSection = "archaeologistaoeTitle", position = 16 ) default boolean isArchaeologistEnabled() @@ -274,7 +287,7 @@ public interface AoeWarningConfig extends Config keyName = "archaeologistaoenotify", name = "Crazy Archaeologist Notify", description = "Configures whether or not AoE Projectile Warnings for Crazy Archaeologist should trigger a notification", - parent = "archaeologistaoeStub", + titleSection = "archaeologistaoeTitle", position = 17, hide = "aoeNotifyAll" ) @@ -283,23 +296,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "icedemonStub", + @ConfigTitleSection( + keyName = "icedemonTitle", name = "Ice Demon", description = "", position = 18, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub icedemonStub() + default Title icedemonTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "icedemon", name = "Ice Demon", description = "Configures whether or not AoE Projectile Warnings for Ice Demon is displayed", - parent = "icedemonStub", + titleSection = "icedemonTitle", position = 19 ) default boolean isIceDemonEnabled() @@ -311,7 +324,7 @@ public interface AoeWarningConfig extends Config keyName = "icedemonnotify", name = "Ice Demon Notify", description = "Configures whether or not AoE Projectile Warnings for Ice Demon should trigger a notification", - parent = "icedemonStub", + titleSection = "icedemonTitle", position = 20, hide = "aoeNotifyAll" ) @@ -320,23 +333,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "vasaStub", + @ConfigTitleSection( + keyName = "vasaTitle", name = "Vasa", description = "", position = 21, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub vasaStub() + default Title vasaTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "vasa", name = "Vasa", description = "Configures whether or not AoE Projectile Warnings for Vasa is displayed", - parent = "vasaStub", + titleSection = "vasaTitle", position = 22 ) default boolean isVasaEnabled() @@ -348,7 +361,7 @@ public interface AoeWarningConfig extends Config keyName = "vasanotify", name = "Vasa Notify", description = "Configures whether or not AoE Projectile Warnings for Vasa should trigger a notification", - parent = "vasaStub", + titleSection = "vasaTitle", position = 23, hide = "aoeNotifyAll" ) @@ -357,23 +370,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "tektonStub", + @ConfigTitleSection( + keyName = "tektonTitle", name = "Tekton", description = "", position = 24, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub tektonStub() + default Title tektonTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "tekton", name = "Tekton", description = "Configures whether or not AoE Projectile Warnings for Tekton is displayed", - parent = "tektonStub", + titleSection = "tektonTitle", position = 25 ) default boolean isTektonEnabled() @@ -385,7 +398,7 @@ public interface AoeWarningConfig extends Config keyName = "tektonnotify", name = "Tekton Notify", description = "Configures whether or not AoE Projectile Warnings for Tekton should trigger a notification", - parent = "tektonStub", + titleSection = "tektonTitle", position = 26, hide = "aoeNotifyAll" ) @@ -394,23 +407,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "vorkathStub", + @ConfigTitleSection( + keyName = "vorkathTitle", name = "Vorkath", description = "", position = 27, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub vorkathStub() + default Title vorkathTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "vorkath", name = "Vorkath", description = "Configures whether or not AoE Projectile Warnings for Vorkath are displayed", - parent = "vorkathStub", + titleSection = "vorkathTitle", position = 28 ) default boolean isVorkathEnabled() @@ -422,7 +435,7 @@ public interface AoeWarningConfig extends Config keyName = "vorkathotify", name = "Vorkath Notify", description = "Configures whether or not AoE Projectile Warnings for Vorkath should trigger a notification", - parent = "vorkathStub", + titleSection = "vorkathTitle", position = 29, hide = "aoeNotifyAll" ) @@ -431,23 +444,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "galvekStub", + @ConfigTitleSection( + keyName = "galvekTitle", name = "Galvek", description = "", position = 30, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub galvekStub() + default Title galvekTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "galvek", name = "Galvek", description = "Configures whether or not AoE Projectile Warnings for Galvek are displayed", - parent = "galvekStub", + titleSection = "galvekTitle", position = 31 ) default boolean isGalvekEnabled() @@ -459,7 +472,7 @@ public interface AoeWarningConfig extends Config keyName = "galveknotify", name = "Galvek Notify", description = "Configures whether or not AoE Projectile Warnings for Galvek should trigger a notification", - parent = "galvekStub", + titleSection = "galvekTitle", position = 32, hide = "aoeNotifyAll" ) @@ -468,23 +481,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "gargbossStub", + @ConfigTitleSection( + keyName = "gargbossTitle", name = "Gargoyle Boss", description = "", position = 33, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub gargbossStub() + default Title gargbossTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "gargboss", name = "Gargoyle Boss", description = "Configs whether or not AoE Projectile Warnings for Dawn/Dusk are displayed", - parent = "gargbossStub", + titleSection = "gargbossTitle", position = 34 ) default boolean isGargBossEnabled() @@ -496,7 +509,7 @@ public interface AoeWarningConfig extends Config keyName = "gargbossnotify", name = "Gargoyle Boss Notify", description = "Configures whether or not AoE Projectile Warnings for Gargoyle Bosses should trigger a notification", - parent = "gargbossStub", + titleSection = "gargbossTitle", position = 35, hide = "aoeNotifyAll" ) @@ -505,23 +518,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "vetionStub", + @ConfigTitleSection( + keyName = "vetionTitle", name = "Vet'ion", description = "", position = 36, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub vetionStub() + default Title vetionTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "vetion", name = "Vet'ion", description = "Configures whether or not AoE Projectile Warnings for Vet'ion are displayed", - parent = "vetionStub", + titleSection = "vetionTitle", position = 37 ) default boolean isVetionEnabled() @@ -533,7 +546,7 @@ public interface AoeWarningConfig extends Config keyName = "vetionnotify", name = "Vet'ion Notify", description = "Configures whether or not AoE Projectile Warnings for Vet'ion should trigger a notification", - parent = "vetionStub", + titleSection = "vetionTitle", position = 38, hide = "aoeNotifyAll" ) @@ -542,23 +555,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "chaosfanaticStub", + @ConfigTitleSection( + keyName = "chaosfanaticTitle", name = "Chaos Fanatic", description = "", position = 39, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub chaosfanaticStub() + default Title chaosfanaticTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "chaosfanatic", name = "Chaos Fanatic", description = "Configures whether or not AoE Projectile Warnings for Chaos Fanatic are displayed", - parent = "chaosfanaticStub", + titleSection = "chaosfanaticTitle", position = 40 ) default boolean isChaosFanaticEnabled() @@ -570,7 +583,7 @@ public interface AoeWarningConfig extends Config keyName = "chaosfanaticnotify", name = "Chaos Fanatic Notify", description = "Configures whether or not AoE Projectile Warnings for Chaos Fanatic should trigger a notification", - parent = "chaosfanaticStub", + titleSection = "chaosfanaticTitle", position = 41, hide = "aoeNotifyAll" ) @@ -579,23 +592,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "olmStub", + @ConfigTitleSection( + keyName = "olmTitle", name = "Olm", description = "", position = 42, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub olmStub() + default Title olmTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "olm", name = "Olm", description = "Configures whether or not AoE Projectile Warnings for The Great Olm are displayed", - parent = "olmStub", + titleSection = "olmTitle", position = 43 ) default boolean isOlmEnabled() @@ -607,7 +620,7 @@ public interface AoeWarningConfig extends Config keyName = "olmnotify", name = "Olm Notify", description = "Configures whether or not AoE Projectile Warnings for Olm should trigger a notification", - parent = "olmStub", + titleSection = "olmTitle", position = 44, hide = "aoeNotifyAll" ) @@ -616,23 +629,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "olmBombStub", + @ConfigTitleSection( + keyName = "olmBombsTitle", name = "Bombs", description = "", position = 45, - parent = "olmStub" + titleSection = "olmTitle" ) - default Stub olmBombsStub() + default Title olmBombsTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "bombDisplay", name = "Olm Bombs", description = "Display a timer and colour-coded AoE for Olm's crystal-phase bombs.", - parent = "olmBombStub", + titleSection = "olmBombsTitle", position = 46 ) default boolean bombDisplay() @@ -644,7 +657,7 @@ public interface AoeWarningConfig extends Config keyName = "bombDisplaynotify", name = "Olm Bombs Notify", description = "Configures whether or not AoE Projectile Warnings for Olm Bombs should trigger a notification", - parent = "olmBombStub", + titleSection = "olmBombsTitle", position = 47, hide = "aoeNotifyAll" ) @@ -653,23 +666,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "olmlightningStub", + @ConfigTitleSection( + keyName = "olmlightningTitle", name = "Lightning Trails", description = "", position = 48, - parent = "olmStub" + titleSection = "olmTitle" ) - default Stub olmlightningStub() + default Title olmlightningTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "lightning", name = "Olm Lightning Trails", description = "Show Lightning Trails", - parent = "olmlightningStub", + titleSection = "olmlightningTitle", position = 49 ) default boolean LightningTrail() @@ -681,7 +694,7 @@ public interface AoeWarningConfig extends Config keyName = "lightningnotify", name = "Olm Lightning Trails Notify", description = "Configures whether or not AoE Projectile Warnings for Olm Lightning Trails should trigger a notification", - parent = "olmlightningStub", + titleSection = "olmlightningTitle", position = 50, hide = "aoeNotifyAll" ) @@ -690,23 +703,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "corpStub", + @ConfigTitleSection( + keyName = "corpTitle", name = "Corporeal Beast", description = "", position = 51, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub corpStub() + default Title corpTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "corp", name = "Corporeal Beast", description = "Configures whether or not AoE Projectile Warnings for the Corporeal Beast are displayed", - parent = "corpStub", + titleSection = "corpTitle", position = 52 ) default boolean isCorpEnabled() @@ -718,7 +731,7 @@ public interface AoeWarningConfig extends Config keyName = "corpnotify", name = "Corporeal Beast Notify", description = "Configures whether or not AoE Projectile Warnings for Corporeal Beast should trigger a notification", - parent = "corpStub", + titleSection = "corpTitle", position = 53, hide = "aoeNotifyAll" ) @@ -727,23 +740,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "wintertodtStub", + @ConfigTitleSection( + keyName = "wintertodtTitle", name = "Wintertodt", description = "", position = 54, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub wintertodtStub() + default Title wintertodtTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "wintertodt", name = "Wintertodt Snow Fall", description = "Configures whether or not AOE Projectile Warnings for the Wintertodt snow fall are displayed", - parent = "wintertodtStub", + titleSection = "wintertodtTitle", position = 55 ) default boolean isWintertodtEnabled() @@ -755,7 +768,7 @@ public interface AoeWarningConfig extends Config keyName = "wintertodtnotify", name = "Wintertodt Snow Fall Notify", description = "Configures whether or not AoE Projectile Warnings for Wintertodt Snow Fall Notify should trigger a notification", - parent = "wintertodtStub", + titleSection = "wintertodtTitle", position = 56, hide = "aoeNotifyAll" ) @@ -764,23 +777,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "xarpusStub", + @ConfigTitleSection( + keyName = "xarpusTitle", name = "Xarpus", description = "", position = 57, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub xarpusStub() + default Title xarpusTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "isXarpusEnabled", name = "Xarpus", description = "Configures whether or not AOE Projectile Warnings for Xarpus are displayed", - parent = "xarpusStub", + titleSection = "xarpusTitle", position = 58 ) default boolean isXarpusEnabled() @@ -792,7 +805,7 @@ public interface AoeWarningConfig extends Config keyName = "isXarpusEnablednotify", name = "Xarpus Notify", description = "Configures whether or not AoE Projectile Warnings for Xarpus should trigger a notification", - parent = "xarpusStub", + titleSection = "xarpusTitle", position = 59, hide = "aoeNotifyAll" ) @@ -801,23 +814,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "addyDragsStub", + @ConfigTitleSection( + keyName = "addyDragsTitle", name = "Addy Drags", description = "", position = 60, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub addyDragsStub() + default Title addyDragsTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "addyDrags", name = "Addy Drags", description = "Show Bad Areas", - parent = "addyDragsStub", + titleSection = "addyDragsTitle", position = 61 ) default boolean addyDrags() @@ -829,7 +842,7 @@ public interface AoeWarningConfig extends Config keyName = "addyDragsnotify", name = "Addy Drags Notify", description = "Configures whether or not AoE Projectile Warnings for Addy Dragons should trigger a notification", - parent = "addyDragsStub", + titleSection = "addyDragsTitle", position = 62, hide = "aoeNotifyAll" ) @@ -838,23 +851,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "drakeStub", + @ConfigTitleSection( + keyName = "drakeTitle", name = "Drakes", description = "", position = 63, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub drakeStub() + default Title drakeTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "drake", name = "Drakes Breath", description = "Configures if Drakes Breath tile markers are displayed", - parent = "drakeStub", + titleSection = "drakeTitle", position = 64 ) default boolean isDrakeEnabled() @@ -866,7 +879,7 @@ public interface AoeWarningConfig extends Config keyName = "drakenotify", name = "Drakes Breath Notify", description = "Configures whether or not AoE Projectile Warnings for Drakes Breath should trigger a notification", - parent = "drakeStub", + titleSection = "drakeTitle", position = 65, hide = "aoeNotifyAll" ) @@ -875,23 +888,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "cerberusStub", + @ConfigTitleSection( + keyName = "cerberusTitle", name = "Cerberus", description = "", position = 66, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub cerberusStub() + default Title cerberusTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "cerbFire", name = "Cerberus Fire", description = "Configures if Cerberus fire tile markers are displayed", - parent = "cerberusStub", + titleSection = "cerberusTitle", position = 67 ) default boolean isCerbFireEnabled() @@ -903,7 +916,7 @@ public interface AoeWarningConfig extends Config keyName = "cerbFirenotify", name = "Cerberus Fire Notify", description = "Configures whether or not AoE Projectile Warnings for Cerberus his fire should trigger a notification", - parent = "cerberusStub", + titleSection = "cerberusTitle", position = 68, hide = "aoeNotifyAll" ) @@ -912,23 +925,23 @@ public interface AoeWarningConfig extends Config return false; } - @ConfigItem( - keyName = "demonicGorillaStub", + @ConfigTitleSection( + keyName = "demonicGorillaTitle", name = "Demonic Gorilla", description = "", position = 69, - parent = "npcStub" + titleSection = "npcTitle" ) - default Stub demonicGorillaStub() + default Title demonicGorillaTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "demonicGorilla", name = "Demonic Gorilla", description = "Configures if Demonic Gorilla boulder tile markers are displayed", - parent = "demonicGorillaStub", + titleSection = "demonicGorillaTitle", position = 70 ) default boolean isDemonicGorillaEnabled() @@ -940,7 +953,7 @@ public interface AoeWarningConfig extends Config keyName = "demonicGorillaNotify", name = "Demonic Gorilla Notify", description = "Configures whether or not AoE Projectile Warnings for Demonic Gorilla boulders should trigger a notification", - parent = "demonicGorillaStub", + titleSection = "demonicGorillaTitle", position = 71, hide = "aoeNotifyAll" ) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/barbarianassault/BarbarianAssaultConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/barbarianassault/BarbarianAssaultConfig.java index 9c439eb966..0290e6a568 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/barbarianassault/BarbarianAssaultConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/barbarianassault/BarbarianAssaultConfig.java @@ -29,6 +29,7 @@ import java.awt.Color; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigSection; import net.runelite.client.config.Range; @ConfigGroup("barbarianAssault") @@ -157,12 +158,23 @@ public interface BarbarianAssaultConfig extends Config /*/// Attacker ///*/ /*///************///*/ + @ConfigSection( + name = "Attacker", + description = "", + position = 10, + keyName = "attackerSection" + ) + default boolean attackerSection() + { + return false; + } + @ConfigItem( keyName = "highlightArrows", name = "Highlight called arrows", description = "Highlights arrows called by your teammate", position = 0, - group = "Attacker" + section = "attackerSection" ) default boolean highlightArrows() { @@ -174,7 +186,7 @@ public interface BarbarianAssaultConfig extends Config name = "Arrow color", description = "Configures the color to highlight the called arrows", position = 1, - group = "Attacker", + section = "attackerSection", hidden = true, unhide = "highlightArrows" ) @@ -188,7 +200,7 @@ public interface BarbarianAssaultConfig extends Config name = "Remove incorrect attack styles", description = "Hides wrong attack styles for dragon claws and crystal halberd", position = 2, - group = "Attacker" + section = "attackerSection" ) default boolean removeIncorrectAttackStyles() { @@ -200,7 +212,7 @@ public interface BarbarianAssaultConfig extends Config name = "Enable tagging", description = "Highlights the menu entry of an attacker/ranger that has not been tagged.", position = 3, - group = "Attacker" + section = "attackerSection" ) default boolean tagging() { @@ -211,13 +223,24 @@ public interface BarbarianAssaultConfig extends Config /*///************///*/ /*/// Defender ///*/ /*///************///*/ + + @ConfigSection( + name = "Defender", + description = "", + position = 11, + keyName = "defenderSection" + ) + default boolean defenderSection() + { + return false; + } @ConfigItem( keyName = "highlightBait", name = "Highlight called bait", description = "Highlights bait called by your teammate", position = 0, - group = "Defender" + section = "defenderSection" ) default boolean highlightBait() { @@ -229,7 +252,7 @@ public interface BarbarianAssaultConfig extends Config name = "Bait color", description = "Configures the color to highlight the called bait", position = 1, - group = "Defender", + section = "defenderSection", hidden = true, unhide = "highlightBait" ) @@ -243,7 +266,7 @@ public interface BarbarianAssaultConfig extends Config name = "Show defender tick timer", description = "Shows the current cycle tick of runners", position = 2, - group = "Defender" + section = "defenderSection" ) default boolean showDefTimer() { @@ -255,7 +278,7 @@ public interface BarbarianAssaultConfig extends Config name = "Deprioritize bait", description = "Moves 'Take' menu option for all bait below 'Walk Here'", position = 3, - group = "Defender" + section = "defenderSection" ) default boolean deprioritizeBait() { @@ -267,7 +290,7 @@ public interface BarbarianAssaultConfig extends Config name = "Remove penance cave", description = "Removes 'Block' menu option from penance cave", position = 4, - group = "Defender" + section = "defenderSection" ) default boolean removePenanceCave() { @@ -278,13 +301,24 @@ public interface BarbarianAssaultConfig extends Config /*///**********///*/ /*/// Healer ///*/ /*///**********///*/ + + @ConfigSection( + name = "Healer", + description = "", + position = 12, + keyName = "healerSection" + ) + default boolean healerSection() + { + return false; + } @ConfigItem( keyName = "highlightPoison", name = "Highlight called poison", description = "Highlights poison called by your teammate", position = 0, - group = "Healer" + section = "healerSection" ) default boolean highlightPoison() { @@ -296,7 +330,7 @@ public interface BarbarianAssaultConfig extends Config name = "Poison color", description = "Configures the color to highlight the called poison", position = 1, - group = "Healer", + section = "healerSection", hidden = true, unhide = "highlightPoison" ) @@ -310,7 +344,7 @@ public interface BarbarianAssaultConfig extends Config name = "Highlight incorrect notification", description = "Highlights incorrect poison chat notification", position = 2, - group = "Healer" + section = "healerSection" ) default boolean highlightNotification() { @@ -322,7 +356,7 @@ public interface BarbarianAssaultConfig extends Config name = "Notification color", description = "Configures the color to highlight the notification text", position = 3, - group = "Healer", + section = "healerSection", hidden = true, unhide = "highlightNotification" ) @@ -336,7 +370,7 @@ public interface BarbarianAssaultConfig extends Config name = "Show number of hitpoints healed", description = "Displays current number of hitpoints healed", position = 4, - group = "Healer" + section = "healerSection" ) default boolean showHpCountOverlay() { @@ -348,7 +382,7 @@ public interface BarbarianAssaultConfig extends Config name = "Show health bars", description = "Displays a health bar where a teammate's remaining health is located", position = 5, - group = "Healer" + section = "healerSection" ) default boolean showTeammateHealthbars() { @@ -360,7 +394,7 @@ public interface BarbarianAssaultConfig extends Config name = "Show healer codes", description = "Overlay to show healer codes", position = 6, - group = "Healer" + section = "healerSection" ) default boolean healerCodes() { @@ -372,7 +406,7 @@ public interface BarbarianAssaultConfig extends Config name = "Show healer menu options", description = "Shows tick count in healer menu options", position = 7, - group = "Healer" + section = "healerSection" ) default boolean healerMenuOption() { @@ -384,7 +418,7 @@ public interface BarbarianAssaultConfig extends Config name = "Enable shift overstock", description = "Enables overstocking by pressing shift", position = 8, - group = "Healer" + section = "healerSection" ) default boolean shiftOverstock() { @@ -396,7 +430,7 @@ public interface BarbarianAssaultConfig extends Config name = "Control Healer", description = "Hold ctrl to put last healer clicked on top", position = 9, - group = "Healer" + section = "healerSection" ) default boolean controlHealer() { @@ -408,12 +442,23 @@ public interface BarbarianAssaultConfig extends Config /*/// Collector ///*/ /*///*************///*/ + @ConfigSection( + name = "Collector", + description = "", + position = 13, + keyName = "collectorSection" + ) + default boolean collectorSection() + { + return false; + } + @ConfigItem( keyName = "swapCollectorBag", name = "Swap empty", description = "Enables swapping of 'Look-in' and 'Empty' on the collector's bag", position = 0, - group = "Collector" + section = "collectorSection" ) default boolean swapCollectorBag() { @@ -425,7 +470,7 @@ public interface BarbarianAssaultConfig extends Config name = "Swap destroy", description = "Enables swapping of 'Use' and 'Destroy' on collector eggs; this does not affect yellow/omega eggs", position = 1, - group = "Collector" + section = "collectorSection" ) default boolean swapDestroyEggs() { @@ -437,7 +482,7 @@ public interface BarbarianAssaultConfig extends Config name = "Highlight collector eggs", description = "Highlight called egg colors", position = 2, - group = "Collector" + section = "collectorSection" ) default boolean highlightCollectorEggs() { @@ -449,7 +494,7 @@ public interface BarbarianAssaultConfig extends Config name = "Deprioritize incorrect eggs", description = "Moves 'Take' menu option for incorrect eggs below 'Walk Here'", position = 3, - group = "Collector" + section = "collectorSection" ) default boolean deprioritizeIncorrectEggs() { @@ -461,7 +506,7 @@ public interface BarbarianAssaultConfig extends Config name = "Show number of eggs collected", description = "Displays current number of eggs collected", position = 4, - group = "Collector" + section = "collectorSection" ) default boolean showEggCountOverlay() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chattranslation/ChatTranslationConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/chattranslation/ChatTranslationConfig.java index d50a6b18ca..224555ea78 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chattranslation/ChatTranslationConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chattranslation/ChatTranslationConfig.java @@ -3,17 +3,29 @@ package net.runelite.client.plugins.chattranslation; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; @ConfigGroup("chattranslation") public interface ChatTranslationConfig extends Config { + @ConfigTitleSection( + keyName = "chatTranslation", + name = "Chat Translation", + description = "", + position = 0 + ) + default Title chatTranslation() + { + return new Title(); + } @ConfigItem( keyName = "translateOptionVisable", name = "Show 'Translate' menu option", description = "Adds 'Translate' to the right-click menu in the Chatbox.", - position = 0, - group = "Chat Translation" + position = 1, + titleSection = "chatTranslation" ) default boolean translateOptionVisable() { @@ -24,8 +36,8 @@ public interface ChatTranslationConfig extends Config keyName = "publicChat", name = "Translate incoming Messages", description = "Would you like to Translate Chat?", - position = 1, - group = "Chat Translation", + position = 2, + titleSection = "chatTranslation", hidden = true, unhide = "translateOptionVisable" ) @@ -38,8 +50,8 @@ public interface ChatTranslationConfig extends Config keyName = "playerNames", name = "Translated Player list:", description = "Players you add to this list will be Translated in chat.", - position = 2, - group = "Chat Translation", + position = 3, + titleSection = "chatTranslation", hidden = true, unhide = "translateOptionVisable" ) @@ -52,8 +64,8 @@ public interface ChatTranslationConfig extends Config keyName = "publicTargetLanguage", name = "Target Language", description = "Language to translate messages to.", - position = 2, - group = "Chat Translation", + position = 4, + titleSection = "chatTranslation", hidden = true, unhide = "publicChat" ) @@ -62,12 +74,23 @@ public interface ChatTranslationConfig extends Config return Languages.ENGLISH; } + @ConfigTitleSection( + keyName = "playerMessageTranslation", + name = "Player Message Translation", + description = "", + position = 5 + ) + default Title playerMessageTranslation() + { + return new Title(); + } + @ConfigItem( keyName = "playerChat", name = "Translate outgoing Messages", description = "Would you like to Translate your Messages?", - position = 3, - group = "Player Message Translation" + position = 6, + titleSection = "playerMessageTranslation" ) default boolean playerChat() { @@ -78,8 +101,8 @@ public interface ChatTranslationConfig extends Config keyName = "playerTargetLanguage", name = "Target Language", description = "Language to translate messages to.", - position = 4, - group = "Player Message Translation", + position = 7, + titleSection = "playerMessageTranslation", hidden = true, unhide = "playerChat" ) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java index 0ac770731c..317368bf0e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java @@ -47,17 +47,19 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.EnumSet; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.concurrent.ScheduledExecutorService; import java.util.stream.Collectors; import javax.inject.Singleton; import javax.swing.BorderFactory; +import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; -import javax.swing.JComponent; import javax.swing.JFormattedTextField; import javax.swing.JLabel; import javax.swing.JList; @@ -92,15 +94,14 @@ import net.runelite.client.config.ConfigDescriptor; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; import net.runelite.client.config.ConfigItemDescriptor; -import net.runelite.client.config.ConfigItemsGroup; import net.runelite.client.config.ConfigManager; -import net.runelite.client.config.ConfigPanelItem; +import net.runelite.client.config.ConfigSection; +import net.runelite.client.config.ConfigTitleSection; import net.runelite.client.config.Keybind; import net.runelite.client.config.ModifierlessKeybind; import net.runelite.client.config.Range; import net.runelite.client.config.RuneLiteConfig; import net.runelite.client.config.RuneLitePlusConfig; -import net.runelite.client.config.Stub; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.PluginInstantiationException; @@ -108,10 +109,12 @@ import net.runelite.client.plugins.PluginManager; import net.runelite.client.plugins.PluginType; import net.runelite.client.ui.ColorScheme; import net.runelite.client.ui.DynamicGridLayout; +import net.runelite.client.ui.FontManager; import net.runelite.client.ui.PluginPanel; import net.runelite.client.ui.components.ComboBoxListRenderer; import net.runelite.client.ui.components.IconButton; import net.runelite.client.ui.components.IconTextField; +import net.runelite.client.ui.components.MinimumSizedPanel; import net.runelite.client.ui.components.colorpicker.ColorPickerManager; import net.runelite.client.ui.components.colorpicker.RuneliteColorPicker; import net.runelite.client.util.ColorUtil; @@ -128,6 +131,10 @@ public class ConfigPanel extends PluginPanel private static final int OFFSET = 6; private static final ImageIcon BACK_ICON; private static final ImageIcon BACK_ICON_HOVER; + private static final ImageIcon SECTION_EXPAND_ICON; + private static final ImageIcon SECTION_EXPAND_ICON_HOVER; + private static final ImageIcon SECTION_RETRACT_ICON; + private static final ImageIcon SECTION_RETRACT_ICON_HOVER; private static final String RUNELITE_GROUP_NAME = RuneLiteConfig.class.getAnnotation(ConfigGroup.class).value(); private static final String PINNED_PLUGINS_CONFIG_KEY = "pinnedPlugins"; @@ -156,6 +163,16 @@ public class ConfigPanel extends PluginPanel final BufferedImage backIcon = ImageUtil.getResourceStreamFromClass(ConfigPanel.class, "config_back_icon.png"); BACK_ICON = new ImageIcon(backIcon); BACK_ICON_HOVER = new ImageIcon(ImageUtil.alphaOffset(backIcon, -100)); + + final BufferedImage orangeBackIcon = ImageUtil.fillImage(backIcon, ColorScheme.BRAND_ORANGE); + + final BufferedImage sectionRetractIcon = ImageUtil.rotateImage(orangeBackIcon, Math.PI * 1.5); + SECTION_RETRACT_ICON = new ImageIcon(sectionRetractIcon); + SECTION_RETRACT_ICON_HOVER = new ImageIcon(ImageUtil.alphaOffset(sectionRetractIcon, -100)); + + final BufferedImage sectionExpandIcon = ImageUtil.rotateImage(orangeBackIcon, Math.PI); + SECTION_EXPAND_ICON = new ImageIcon(sectionExpandIcon); + SECTION_EXPAND_ICON_HOVER = new ImageIcon(ImageUtil.alphaOffset(sectionExpandIcon, -100)); } ConfigPanel(PluginManager pluginManager, ConfigManager configManager, ScheduledExecutorService executorService, @@ -525,6 +542,21 @@ public class ConfigPanel extends PluginPanel } } + private void toggleSection(ConfigDescriptor cd, ConfigSection cs, IconButton button, JPanel contents) + { + boolean newState = !contents.isVisible(); + contents.setVisible(newState); + button.setIcon(newState ? SECTION_RETRACT_ICON : SECTION_EXPAND_ICON); + button.setHoverIcon(newState ? SECTION_RETRACT_ICON_HOVER : SECTION_EXPAND_ICON_HOVER); + configManager.setConfiguration(cd.getGroup().value(), cs.keyName(), newState); + button.setToolTipText(newState ? "Retract" : "Expand"); + SwingUtilities.invokeLater(() -> + { + contents.revalidate(); + contents.repaint(); + }); + } + void openGroupConfigPanel(PluginListItem listItem, Config config, ConfigDescriptor cd) { openGroupConfigPanel(listItem, config, cd, false); @@ -557,571 +589,613 @@ public class ConfigPanel extends PluginPanel title.setToolTipText("" + name + ":
" + listItem.getDescription() + ""); topPanel.add(title); - for (ConfigItemsGroup cig : cd.getItemGroups()) + final Map sectionWidgets = new HashMap<>(); + final Map titleSectionWidgets = new HashMap<>(); + + for (ConfigSection cs : cd.getSections()) { - ConfigPanelItem mainParent = new ConfigPanelItem(null, null); + final MinimumSizedPanel section = new MinimumSizedPanel(); + section.setLayout(new BoxLayout(section, BoxLayout.Y_AXIS)); + section.setMinimumSize(new Dimension(PANEL_WIDTH, 0)); - boolean collapsed = false; - if (!cig.getGroup().equals("")) + JPanel item = new JPanel(); + item.setLayout(new BorderLayout()); + item.setMinimumSize(new Dimension(PANEL_WIDTH, 0)); + + name = cs.name(); + String description = cs.description(); + + JLabel headerLabel = new JLabel(cs.name()); + headerLabel.setFont(FontManager.getRunescapeFont()); + headerLabel.setForeground(ColorScheme.BRAND_ORANGE); + if (!description.equals("")) { - String header = cig.getGroup(); + headerLabel.setToolTipText("" + name + ":
" + description + ""); + } + headerLabel.setPreferredSize(new Dimension(PANEL_WIDTH, (int) headerLabel.getPreferredSize().getHeight())); - JPanel item = new JPanel(); - item.setLayout(new BorderLayout()); - item.setMinimumSize(new Dimension(PANEL_WIDTH, 0)); + final boolean state = Boolean.parseBoolean(configManager.getConfiguration(cd.getGroup().value(), cs.keyName())); - JLabel headerLabel = new JLabel(header); - headerLabel.setForeground(Color.ORANGE); - headerLabel.setPreferredSize(new Dimension(PANEL_WIDTH, (int) headerLabel.getPreferredSize().getHeight())); - String sCollapsed = configManager.getConfiguration(cd.getGroup().value(), cig.getGroup() + "_collapse"); + final IconButton collapse = new IconButton(state ? SECTION_RETRACT_ICON : SECTION_EXPAND_ICON); + collapse.setHoverIcon(state ? SECTION_RETRACT_ICON_HOVER : SECTION_EXPAND_ICON_HOVER); + collapse.setToolTipText(state ? "Retract" : "Expand"); + collapse.setPreferredSize(new Dimension(20, 20)); + collapse.setFont(collapse.getFont().deriveFont(16.0f)); + collapse.setBorder(null); + collapse.setMargin(new Insets(0, 0, 0, 0)); + headerLabel.setBorder(new EmptyBorder(0, 10, 0, 0)); - if (sCollapsed != null) + item.add(collapse, BorderLayout.WEST); + item.add(headerLabel, BorderLayout.CENTER); + + final JPanel sectionContents = new JPanel(); + sectionContents.setLayout(new DynamicGridLayout(0, 1, 0, 5)); + sectionContents.setMinimumSize(new Dimension(PANEL_WIDTH, 0)); + sectionContents.setBorder(new EmptyBorder(OFFSET, 5, 0, 0)); + section.add(item, BorderLayout.NORTH); + section.add(sectionContents, BorderLayout.SOUTH); + + sectionContents.setVisible(state); + + // Add listeners to each part of the header so that it's easier to toggle them + final MouseAdapter adapter = new MouseAdapter() + { + @Override + public void mouseClicked(MouseEvent e) { - collapsed = Boolean.parseBoolean(sCollapsed); + toggleSection(cd, cs, collapse, sectionContents); } + }; + collapse.addActionListener(e -> toggleSection(cd, cs, collapse, sectionContents)); + headerLabel.addMouseListener(adapter); - JButton collapse = new JButton(collapsed ? "+" : "-"); - collapse.setPreferredSize(new Dimension(20, 20)); - collapse.setFont(collapse.getFont().deriveFont(16.0f)); - collapse.setBorder(null); - collapse.setMargin(new Insets(0, 0, 0, 0)); - collapse.addActionListener(ae -> changeGroupCollapse(listItem, config, collapse, cd, cig)); - headerLabel.setBorder(new EmptyBorder(0, 10, 0, 0)); + sectionWidgets.put(cs.keyName(), sectionContents); - item.add(collapse, BorderLayout.WEST); - item.add(headerLabel, BorderLayout.CENTER); + // Allow for sub-sections + JPanel parentSection = sectionWidgets.get(cs.section()); + if (parentSection == null) + { + mainPanel.add(section); + } + else + { + parentSection.add(section); + } + } - mainPanel.add(item); + for (ConfigTitleSection cs : cd.getTitleSections()) + { + final MinimumSizedPanel titleSection = new MinimumSizedPanel(); + titleSection.setLayout(new BoxLayout(titleSection, BoxLayout.Y_AXIS)); + titleSection.setMinimumSize(new Dimension(PANEL_WIDTH, 0)); + + JPanel item = new JPanel(); + item.setLayout(new BorderLayout()); + item.setMinimumSize(new Dimension(PANEL_WIDTH, 0)); + + Border border = item.getBorder(); + Border margin = new EmptyBorder(10, 0, 0, 0); + item.setBorder(new CompoundBorder(border, margin)); + + JLabel configEntryName = new JLabel(cs.name()); + configEntryName.setPreferredSize(new Dimension(PANEL_WIDTH, (int) configEntryName.getPreferredSize().getHeight())); + configEntryName.setForeground(ColorScheme.BRAND_ORANGE); + item.add(configEntryName, BorderLayout.NORTH); + + final JPanel sectionContents = new JPanel(); + sectionContents.setLayout(new DynamicGridLayout(0, 1, 0, 5)); + sectionContents.setMinimumSize(new Dimension(0, 0)); + sectionContents.setBorder(new EmptyBorder(OFFSET, 5, 0, 0)); + + titleSection.add(item, BorderLayout.NORTH); + titleSection.add(sectionContents, BorderLayout.SOUTH); + + titleSectionWidgets.put(cs.keyName(), sectionContents); + + // Allow for sub-sections + JPanel parentTitleSection = titleSectionWidgets.get(cs.titleSection()); + JPanel parentSection = sectionWidgets.get(cs.section()); + + if (parentTitleSection != null) + { + parentTitleSection.add(titleSection); + } + else if (parentSection != null) + { + parentSection.add(titleSection); + } + else + { + mainPanel.add(titleSection); + } + } + + List buttons = new ArrayList<>(); + + for (ConfigItemDescriptor cid : cd.getItems()) + { + if (cid == null) + { + continue; // Ignore main 'parent' } - if (collapsed) + Boolean unhide = cid.getItem().hidden(); + Boolean hide = !cid.getItem().hide().isEmpty(); + + if (unhide || hide) { + boolean show = false; + + List itemHide = Splitter + .onPattern("\\|\\|") + .trimResults() + .omitEmptyStrings() + .splitToList(String.format("%s || %s", cid.getItem().unhide(), cid.getItem().hide())); + + for (ConfigItemDescriptor cid2 : cd.getItems()) + { + if (itemHide.contains(cid2.getItem().keyName())) + { + if (cid2.getType() == boolean.class) + { + show = Boolean.parseBoolean(configManager.getConfiguration(cd.getGroup().value(), cid2.getItem().keyName())); + } + else if (cid2.getType().isEnum()) + { + @SuppressWarnings("unchecked") Class type = (Class) cid2.getType(); + try + { + @SuppressWarnings("unchecked") Enum selectedItem = Enum.valueOf(type, configManager.getConfiguration(cd.getGroup().value(), cid2.getItem().keyName())); + if (!cid.getItem().unhideValue().equals("")) + { + List unhideValue = Splitter + .onPattern("\\|\\|") + .trimResults() + .omitEmptyStrings() + .splitToList(cid.getItem().unhideValue()); + + show = unhideValue.contains(selectedItem.toString()); + } + else if (!cid.getItem().hideValue().equals("")) + { + List hideValue = Splitter + .onPattern("\\|\\|") + .trimResults() + .omitEmptyStrings() + .splitToList(cid.getItem().hideValue()); + + show = !hideValue.contains(selectedItem.toString()); + } + } + catch (IllegalArgumentException ex) + { + log.info("So bad, so sad: {}", ex.toString()); + } + } + } + + if (show) + { + break; + } + } + + if ((unhide && !show) || (hide && show)) + { + continue; + } + } + + if (cid.getType() == Button.class) + { + try + { + ConfigItem item = cid.getItem(); + + JButton button = new JButton(item.name()); + + Class actionListener = (Class) item.clazz(); + + button.addActionListener(actionListener.newInstance()); + buttons.add(button); + } + catch (IllegalAccessException | InstantiationException ex) + { + log.error("Adding action listener failed: {}", ex.getMessage()); + } + continue; } - List allItems = new ArrayList<>(cig.getItems()); + JPanel item = new JPanel(); + item.setLayout(new BorderLayout()); + item.setMinimumSize(new Dimension(PANEL_WIDTH, 0)); + name = cid.getItem().name(); - int maxDepth = 3; - do + JLabel configEntryName = new JLabel(name); + configEntryName.setPreferredSize(new Dimension(PANEL_WIDTH, (int) configEntryName.getPreferredSize().getHeight())); + configEntryName.setForeground(Color.WHITE); + configEntryName.setToolTipText("" + name + ":
" + cid.getItem().description() + ""); + item.add(configEntryName, cid.getType() != String.class ? BorderLayout.CENTER : BorderLayout.NORTH); + + if (cid.getType() == boolean.class) { - for (ConfigItemDescriptor cid : new ArrayList<>(allItems)) - { + JCheckBox checkbox = new JCheckBox(); + checkbox.setBackground(ColorScheme.LIGHT_GRAY_COLOR); + checkbox.setSelected(Boolean.parseBoolean(configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName()))); + checkbox.addActionListener(ae -> changeConfiguration(listItem, config, checkbox, cd, cid)); - String parent = cid.getItem().parent(); + item.add(checkbox, BorderLayout.EAST); + } - if (parent.equals("")) - { - mainParent.getChildren().add(new ConfigPanelItem(mainParent, cid)); - allItems.remove(cid); - } - else - { - if (mainParent.addChildIfMatchParent(cid)) - { - allItems.remove(cid); - } - } - - } - - maxDepth--; - - } while (allItems.size() > 0 && maxDepth > 0); - - List orderedList = mainParent.getItemsAsList(); - List buttons = new ArrayList<>(); - - for (ConfigPanelItem cpi : orderedList) + else if (cid.getType() == int.class) { - ConfigItemDescriptor cid = cpi.getItem(); + int value = Integer.parseInt(configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName())); - if (cid == null) + Range range = cid.getRange(); + int min = 0, max = Integer.MAX_VALUE; + if (range != null) { - continue; // Ignore main 'parent' + min = range.min(); + max = range.max(); } - Boolean unhide = cid.getItem().hidden(); - Boolean hide = !cid.getItem().hide().isEmpty(); + // Config may previously have been out of range + value = MiscUtils.clamp(value, min, max); - if (unhide || hide) + if (max < Integer.MAX_VALUE) { - boolean show = false; - - List itemHide = Splitter - .onPattern("\\|\\|") - .trimResults() - .omitEmptyStrings() - .splitToList(String.format("%s || %s", cid.getItem().unhide(), cid.getItem().hide())); - - for (ConfigItemDescriptor cid2 : cd.getItems()) - { - if (itemHide.contains(cid2.getItem().keyName())) + JLabel sliderValueLabel = new JLabel(); + JSlider slider = new JSlider(min, max, value); + sliderValueLabel.setText(String.valueOf(slider.getValue())); + slider.setPreferredSize(new Dimension(80, 25)); + slider.setBackground(Color.WHITE); + slider.addChangeListener((l) -> { - if (cid2.getType() == boolean.class) + sliderValueLabel.setText(String.valueOf(slider.getValue())); + if (!slider.getValueIsAdjusting()) { - show = Boolean.parseBoolean(configManager.getConfiguration(cd.getGroup().value(), cid2.getItem().keyName())); - } - else if (cid2.getType().isEnum()) - { - @SuppressWarnings("unchecked") Class type = (Class) cid2.getType(); - try - { - @SuppressWarnings("unchecked") Enum selectedItem = Enum.valueOf(type, configManager.getConfiguration(cd.getGroup().value(), cid2.getItem().keyName())); - if (!cid.getItem().unhideValue().equals("")) - { - List unhideValue = Splitter - .onPattern("\\|\\|") - .trimResults() - .omitEmptyStrings() - .splitToList(cid.getItem().unhideValue()); - - show = unhideValue.contains(selectedItem.toString()); - } - else if (!cid.getItem().hideValue().equals("")) - { - List hideValue = Splitter - .onPattern("\\|\\|") - .trimResults() - .omitEmptyStrings() - .splitToList(cid.getItem().hideValue()); - - show = !hideValue.contains(selectedItem.toString()); - } - } - catch (IllegalArgumentException ex) - { - log.info("So bad, so sad: {}", ex.toString()); - } + changeConfiguration(listItem, config, slider, cd, cid); } } + ); - if (show) + SpinnerModel model = new SpinnerNumberModel(value, min, max, 1); + JSpinner spinner = new JSpinner(model); + Component editor = spinner.getEditor(); + JFormattedTextField spinnerTextField = ((JSpinner.DefaultEditor) editor).getTextField(); + spinnerTextField.setColumns(SPINNER_FIELD_WIDTH); + spinner.setUI(new BasicSpinnerUI() + { + protected Component createNextButton() { - break; + return null; } - } - if ((unhide && !show) || (hide && show)) - { - continue; - } - } - - if (cid.getType() == Button.class) - { - try - { - ConfigItem item = cid.getItem(); - - JButton button = new JButton(item.name()); - - Class actionListener = (Class) item.clazz(); - - button.addActionListener(actionListener.newInstance()); - buttons.add(button); - } - catch (IllegalAccessException | InstantiationException ex) - { - log.error("Adding action listener failed: {}", ex.getMessage()); - } - - continue; - } - - JPanel item = new JPanel(); - item.setLayout(new BorderLayout()); - item.setMinimumSize(new Dimension(PANEL_WIDTH, 0)); - name = cid.getItem().name(); - - StringBuilder depthOffset = new StringBuilder(); - for (int depth = 1; depth < cpi.getDepth(); depth++) - { - depthOffset.append(" "); - } - - name = depthOffset + name; - - JLabel configEntryName = new JLabel(name); - configEntryName.setPreferredSize(new Dimension(PANEL_WIDTH, (int) configEntryName.getPreferredSize().getHeight())); - configEntryName.setForeground(Color.WHITE); - configEntryName.setToolTipText("" + name + ":
" + cid.getItem().description() + ""); - item.add(configEntryName, cid.getType() != String.class ? BorderLayout.CENTER : BorderLayout.NORTH); - - - if (cid.getType() == Stub.class) - { - Border border = item.getBorder(); - Border margin = new EmptyBorder(10, 0, 0, 0); - item.setBorder(new CompoundBorder(border, margin)); - - configEntryName.setForeground(Color.ORANGE); - configEntryName.setToolTipText(null); - } - - else if (cid.getType() == boolean.class) - { - JCheckBox checkbox = new JCheckBox(); - checkbox.setBackground(ColorScheme.LIGHT_GRAY_COLOR); - checkbox.setSelected(Boolean.parseBoolean(configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName()))); - checkbox.addActionListener(ae -> changeConfiguration(listItem, config, checkbox, cd, cid)); - - item.add(checkbox, BorderLayout.EAST); - } - - else if (cid.getType() == int.class) - { - int value = Integer.parseInt(configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName())); - - Range range = cid.getRange(); - int min = 0, max = Integer.MAX_VALUE; - if (range != null) - { - min = range.min(); - max = range.max(); - } - - // Config may previously have been out of range - value = MiscUtils.clamp(value, min, max); - - if (max < Integer.MAX_VALUE) - { - JLabel sliderValueLabel = new JLabel(); - JSlider slider = new JSlider(min, max, value); - sliderValueLabel.setText(String.valueOf(slider.getValue())); - slider.setPreferredSize(new Dimension(80, 25)); - slider.setBackground(Color.WHITE); - slider.addChangeListener((l) -> - { - sliderValueLabel.setText(String.valueOf(slider.getValue())); - if (!slider.getValueIsAdjusting()) - { - changeConfiguration(listItem, config, slider, cd, cid); - } - } - ); - - SpinnerModel model = new SpinnerNumberModel(value, min, max, 1); - JSpinner spinner = new JSpinner(model); - Component editor = spinner.getEditor(); - JFormattedTextField spinnerTextField = ((JSpinner.DefaultEditor) editor).getTextField(); - spinnerTextField.setColumns(SPINNER_FIELD_WIDTH); - spinner.setUI(new BasicSpinnerUI() + protected Component createPreviousButton() { - protected Component createNextButton() - { - return null; - } + return null; + } + }); - protected Component createPreviousButton() - { - return null; - } - }); + JPanel subPanel = new JPanel(); + subPanel.setPreferredSize(new Dimension(110, 25)); + subPanel.setLayout(new BorderLayout()); - JPanel subPanel = new JPanel(); - subPanel.setPreferredSize(new Dimension(110, 25)); - subPanel.setLayout(new BorderLayout()); + spinner.addChangeListener((ce) -> + { + changeConfiguration(listItem, config, spinner, cd, cid); - spinner.addChangeListener((ce) -> - { - changeConfiguration(listItem, config, spinner, cd, cid); - - sliderValueLabel.setText(String.valueOf(spinner.getValue())); - slider.setValue((Integer) spinner.getValue()); - - subPanel.add(sliderValueLabel, BorderLayout.WEST); - subPanel.add(slider, BorderLayout.EAST); - subPanel.remove(spinner); - - validate(); - repaint(); - }); - - sliderValueLabel.addMouseListener(new MouseAdapter() - { - public void mouseClicked(MouseEvent e) - { - spinner.setValue(slider.getValue()); - - subPanel.remove(sliderValueLabel); - subPanel.remove(slider); - subPanel.add(spinner, BorderLayout.EAST); - - validate(); - repaint(); - - final JTextField tf = ((JSpinner.DefaultEditor) spinner.getEditor()).getTextField(); - tf.requestFocusInWindow(); - SwingUtilities.invokeLater(tf::selectAll); - } - }); + sliderValueLabel.setText(String.valueOf(spinner.getValue())); + slider.setValue((Integer) spinner.getValue()); subPanel.add(sliderValueLabel, BorderLayout.WEST); subPanel.add(slider, BorderLayout.EAST); + subPanel.remove(spinner); - item.add(subPanel, BorderLayout.EAST); - } - else + validate(); + repaint(); + }); + + sliderValueLabel.addMouseListener(new MouseAdapter() { - SpinnerModel model = new SpinnerNumberModel(value, min, max, 1); - JSpinner spinner = new JSpinner(model); - Component editor = spinner.getEditor(); - JFormattedTextField spinnerTextField = ((JSpinner.DefaultEditor) editor).getTextField(); - spinnerTextField.setColumns(SPINNER_FIELD_WIDTH); - spinner.addChangeListener(ce -> changeConfiguration(listItem, config, spinner, cd, cid)); + public void mouseClicked(MouseEvent e) + { + spinner.setValue(slider.getValue()); - item.add(spinner, BorderLayout.EAST); - } + subPanel.remove(sliderValueLabel); + subPanel.remove(slider); + subPanel.add(spinner, BorderLayout.EAST); + + validate(); + repaint(); + + final JTextField tf = ((JSpinner.DefaultEditor) spinner.getEditor()).getTextField(); + tf.requestFocusInWindow(); + SwingUtilities.invokeLater(tf::selectAll); + } + }); + + subPanel.add(sliderValueLabel, BorderLayout.WEST); + subPanel.add(slider, BorderLayout.EAST); + + item.add(subPanel, BorderLayout.EAST); + } + else + { + SpinnerModel model = new SpinnerNumberModel(value, min, max, 1); + JSpinner spinner = new JSpinner(model); + Component editor = spinner.getEditor(); + JFormattedTextField spinnerTextField = ((JSpinner.DefaultEditor) editor).getTextField(); + spinnerTextField.setColumns(SPINNER_FIELD_WIDTH); + spinner.addChangeListener(ce -> changeConfiguration(listItem, config, spinner, cd, cid)); + + item.add(spinner, BorderLayout.EAST); + } + } + + else if (cid.getType() == String.class) + { + JTextComponent textField; + + if (cid.getItem().secret()) + { + textField = new JPasswordField(); + } + else + { + final JTextArea textArea = new configTextArea(); + textArea.setLineWrap(true); + textArea.setWrapStyleWord(true); + textField = textArea; } - else if (cid.getType() == String.class) - { - JTextComponent textField; + textField.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + textField.setText(configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName())); - if (cid.getItem().secret()) + DeferredDocumentChangedListener listener = new DeferredDocumentChangedListener(); + listener.addChangeListener(e -> + { + ConfigItem configItem = cid.getItem(); + if (configItem.parse()) { - textField = new JPasswordField(); + Boolean result = parse(configItem, textField.getText()); + + if (result != null && result) + { + changeConfiguration(listItem, config, textField, cd, cid); + } } else { - final JTextArea textArea = new configTextArea(); - textArea.setLineWrap(true); - textArea.setWrapStyleWord(true); - textField = textArea; + changeConfiguration(listItem, config, textField, cd, cid); } + }); + textField.getDocument().addDocumentListener(listener); - textField.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); - textField.setText(configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName())); + if (cid.getItem().parse()) + { + JLabel parsingLabel = new JLabel(); + parsingLabel.setHorizontalAlignment(SwingConstants.CENTER); + parsingLabel.setPreferredSize(new Dimension(PANEL_WIDTH, 15)); - DeferredDocumentChangedListener listener = new DeferredDocumentChangedListener(); + listener = new DeferredDocumentChangedListener(); listener.addChangeListener(e -> { - ConfigItem configItem = cid.getItem(); - if (configItem.parse()) + if (cid.getItem().parse()) { - Boolean result = parse(configItem, textField.getText()); - - if (result != null && result) - { - changeConfiguration(listItem, config, textField, cd, cid); - } - } - else - { - changeConfiguration(listItem, config, textField, cd, cid); + parseLabel(cid.getItem(), parsingLabel, textField.getText()); } }); textField.getDocument().addDocumentListener(listener); - if (cid.getItem().parse()) - { - JLabel parsingLabel = new JLabel(); - parsingLabel.setHorizontalAlignment(SwingConstants.CENTER); - parsingLabel.setPreferredSize(new Dimension(PANEL_WIDTH, 15)); + item.add(textField, BorderLayout.CENTER); - listener = new DeferredDocumentChangedListener(); - listener.addChangeListener(e -> - { - if (cid.getItem().parse()) - { - parseLabel(cid.getItem(), parsingLabel, textField.getText()); - } - }); - textField.getDocument().addDocumentListener(listener); - - item.add(textField, BorderLayout.CENTER); - - parseLabel(cid.getItem(), parsingLabel, textField.getText()); - item.add(parsingLabel, BorderLayout.SOUTH); - } - else - { - item.add(textField, BorderLayout.SOUTH); - } + parseLabel(cid.getItem(), parsingLabel, textField.getText()); + item.add(parsingLabel, BorderLayout.SOUTH); } - - else if (cid.getType() == Color.class) + else { - String existing = configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName()); - - Color existingColor; - JButton colorPickerBtn; - - if (existing == null) - { - existingColor = Color.BLACK; - colorPickerBtn = new JButton("Pick a color"); - } - else - { - existingColor = ColorUtil.fromString(existing); - colorPickerBtn = new JButton(ColorUtil.toHexColor(existingColor).toUpperCase()); - } - - colorPickerBtn.setFocusable(false); - colorPickerBtn.setBackground(existingColor); - colorPickerBtn.addMouseListener(new MouseAdapter() - { - @Override - public void mouseClicked(MouseEvent e) - { - RuneliteColorPicker colorPicker = colorPickerManager.create( - SwingUtilities.windowForComponent(ConfigPanel.this), - colorPickerBtn.getBackground(), - cid.getItem().name(), - cid.getAlpha() == null); - colorPicker.setLocation(getLocationOnScreen()); - colorPicker.setOnColorChange(c -> - { - colorPickerBtn.setBackground(c); - colorPickerBtn.setText(ColorUtil.toHexColor(c).toUpperCase()); - }); - - colorPicker.setOnClose(c -> changeConfiguration(listItem, config, colorPicker, cd, cid)); - colorPicker.setVisible(true); - } - }); - - item.add(colorPickerBtn, BorderLayout.EAST); + item.add(textField, BorderLayout.SOUTH); } - - else if (cid.getType() == Dimension.class) - { - JPanel dimensionPanel = new JPanel(); - dimensionPanel.setLayout(new BorderLayout()); - - String str = configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName()); - String[] splitStr = str.split("x"); - int width = Integer.parseInt(splitStr[0]); - int height = Integer.parseInt(splitStr[1]); - - SpinnerModel widthModel = new SpinnerNumberModel(width, 0, Integer.MAX_VALUE, 1); - JSpinner widthSpinner = new JSpinner(widthModel); - Component widthEditor = widthSpinner.getEditor(); - JFormattedTextField widthSpinnerTextField = ((JSpinner.DefaultEditor) widthEditor).getTextField(); - widthSpinnerTextField.setColumns(4); - - SpinnerModel heightModel = new SpinnerNumberModel(height, 0, Integer.MAX_VALUE, 1); - JSpinner heightSpinner = new JSpinner(heightModel); - Component heightEditor = heightSpinner.getEditor(); - JFormattedTextField heightSpinnerTextField = ((JSpinner.DefaultEditor) heightEditor).getTextField(); - heightSpinnerTextField.setColumns(4); - - ChangeListener listener = e -> - configManager.setConfiguration(cd.getGroup().value(), cid.getItem().keyName(), widthSpinner.getValue() + "x" + heightSpinner.getValue()); - - widthSpinner.addChangeListener(listener); - heightSpinner.addChangeListener(listener); - - dimensionPanel.add(widthSpinner, BorderLayout.WEST); - dimensionPanel.add(new JLabel(" x "), BorderLayout.CENTER); - dimensionPanel.add(heightSpinner, BorderLayout.EAST); - - item.add(dimensionPanel, BorderLayout.EAST); - } - - else if (cid.getType().isEnum()) - { - Class type = (Class) cid.getType(); - JComboBox box = new JComboBox(type.getEnumConstants()); - box.setPreferredSize(new Dimension(box.getPreferredSize().width, 25)); - box.setRenderer(new ComboBoxListRenderer()); - box.setForeground(Color.WHITE); - box.setFocusable(false); - box.setPrototypeDisplayValue("XXXXXXXX"); //sorry but this is the way to keep the size of the combobox in check. - try - { - Enum selectedItem = Enum.valueOf(type, configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName())); - box.setSelectedItem(selectedItem); - box.setToolTipText(selectedItem.toString()); - } - catch (IllegalArgumentException ex) - { - log.debug("invalid seleced item", ex); - } - box.addItemListener(e -> - { - if (e.getStateChange() == ItemEvent.SELECTED) - { - changeConfiguration(listItem, config, box, cd, cid); - box.setToolTipText(Objects.requireNonNull(box.getSelectedItem()).toString()); - } - }); - item.add(box, BorderLayout.EAST); - } - - else if (cid.getType() == Keybind.class || cid.getType() == ModifierlessKeybind.class) - { - Keybind startingValue = configManager.getConfiguration(cd.getGroup().value(), - cid.getItem().keyName(), - (Class) cid.getType()); - - HotkeyButton button = new HotkeyButton(startingValue, cid.getType() == ModifierlessKeybind.class); - - button.addFocusListener(new FocusAdapter() - { - @Override - public void focusLost(FocusEvent e) - { - changeConfiguration(listItem, config, button, cd, cid); - } - }); - - item.add(button, BorderLayout.EAST); - } - - else if (cid.getType() == EnumSet.class) - { - - int displayRows = cid.getItem().displayRows(); - - Class enumType = cid.getItem().enumClass(); - - EnumSet enumSet = configManager.getConfiguration(cd.getGroup().value(), - cid.getItem().keyName(), EnumSet.class); - if (enumSet == null || enumSet.contains(null)) - { - enumSet = EnumSet.noneOf(enumType); - } - JList jList = new JList(enumType.getEnumConstants()); - jList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - - if (!enumSet.isEmpty() && enumSet.size() > 1) - { - int[] selected = new int[enumSet.size()]; - for (int i = 0; i < enumSet.size(); i++) - { - if (enumSet.contains(EnumSet.allOf(enumType).toArray()[i])) - { - selected[i] = Lists.newArrayList(EnumSet.allOf(enumType)).indexOf(enumSet.toArray()[i]); - } - } - jList.setSelectedIndices(selected); - } - if (enumSet.size() == 1) - { - enumSet.forEach(anObject -> jList.setSelectedValue(anObject, true)); - } - jList.setVisibleRowCount(displayRows); - jList.setPrototypeCellValue("XXXXXXXXXX"); - jList.setCellRenderer(new ComboBoxListRenderer()); - jList.setLayoutOrientation(JList.VERTICAL); - jList.setSelectionBackground(Color.decode("708090")); - jList.addListSelectionListener(e -> - changeConfiguration(listItem, config, jList, cd, cid)); - JScrollPane jScrollPane = new JScrollPane(); - jScrollPane.setViewportView(jList); - jScrollPane.setViewportBorder(BorderFactory.createLoweredSoftBevelBorder()); - - item.add(jScrollPane, BorderLayout.SOUTH); - - } - mainPanel.add(item); } - buttons.forEach(mainPanel::add); + else if (cid.getType() == Color.class) + { + String existing = configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName()); + + Color existingColor; + JButton colorPickerBtn; + + if (existing == null) + { + existingColor = Color.BLACK; + colorPickerBtn = new JButton("Pick a color"); + } + else + { + existingColor = ColorUtil.fromString(existing); + colorPickerBtn = new JButton(ColorUtil.toHexColor(existingColor).toUpperCase()); + } + + colorPickerBtn.setFocusable(false); + colorPickerBtn.setBackground(existingColor); + colorPickerBtn.addMouseListener(new MouseAdapter() + { + @Override + public void mouseClicked(MouseEvent e) + { + RuneliteColorPicker colorPicker = colorPickerManager.create( + SwingUtilities.windowForComponent(ConfigPanel.this), + colorPickerBtn.getBackground(), + cid.getItem().name(), + cid.getAlpha() == null); + colorPicker.setLocation(getLocationOnScreen()); + colorPicker.setOnColorChange(c -> + { + colorPickerBtn.setBackground(c); + colorPickerBtn.setText(ColorUtil.toHexColor(c).toUpperCase()); + }); + + colorPicker.setOnClose(c -> changeConfiguration(listItem, config, colorPicker, cd, cid)); + colorPicker.setVisible(true); + } + }); + + item.add(colorPickerBtn, BorderLayout.EAST); + } + + else if (cid.getType() == Dimension.class) + { + JPanel dimensionPanel = new JPanel(); + dimensionPanel.setLayout(new BorderLayout()); + + String str = configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName()); + String[] splitStr = str.split("x"); + int width = Integer.parseInt(splitStr[0]); + int height = Integer.parseInt(splitStr[1]); + + SpinnerModel widthModel = new SpinnerNumberModel(width, 0, Integer.MAX_VALUE, 1); + JSpinner widthSpinner = new JSpinner(widthModel); + Component widthEditor = widthSpinner.getEditor(); + JFormattedTextField widthSpinnerTextField = ((JSpinner.DefaultEditor) widthEditor).getTextField(); + widthSpinnerTextField.setColumns(4); + + SpinnerModel heightModel = new SpinnerNumberModel(height, 0, Integer.MAX_VALUE, 1); + JSpinner heightSpinner = new JSpinner(heightModel); + Component heightEditor = heightSpinner.getEditor(); + JFormattedTextField heightSpinnerTextField = ((JSpinner.DefaultEditor) heightEditor).getTextField(); + heightSpinnerTextField.setColumns(4); + + ChangeListener listener = e -> + configManager.setConfiguration(cd.getGroup().value(), cid.getItem().keyName(), widthSpinner.getValue() + "x" + heightSpinner.getValue()); + + widthSpinner.addChangeListener(listener); + heightSpinner.addChangeListener(listener); + + dimensionPanel.add(widthSpinner, BorderLayout.WEST); + dimensionPanel.add(new JLabel(" x "), BorderLayout.CENTER); + dimensionPanel.add(heightSpinner, BorderLayout.EAST); + + item.add(dimensionPanel, BorderLayout.EAST); + } + + else if (cid.getType().isEnum()) + { + Class type = (Class) cid.getType(); + JComboBox box = new JComboBox(type.getEnumConstants()); + box.setPreferredSize(new Dimension(box.getPreferredSize().width, 25)); + box.setRenderer(new ComboBoxListRenderer()); + box.setForeground(Color.WHITE); + box.setFocusable(false); + box.setPrototypeDisplayValue("XXXXXXXX"); //sorry but this is the way to keep the size of the combobox in check. + try + { + Enum selectedItem = Enum.valueOf(type, configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName())); + box.setSelectedItem(selectedItem); + box.setToolTipText(selectedItem.toString()); + } + catch (IllegalArgumentException ex) + { + log.debug("invalid seleced item", ex); + } + box.addItemListener(e -> + { + if (e.getStateChange() == ItemEvent.SELECTED) + { + changeConfiguration(listItem, config, box, cd, cid); + box.setToolTipText(Objects.requireNonNull(box.getSelectedItem()).toString()); + } + }); + item.add(box, BorderLayout.EAST); + } + + else if (cid.getType() == Keybind.class || cid.getType() == ModifierlessKeybind.class) + { + Keybind startingValue = configManager.getConfiguration(cd.getGroup().value(), + cid.getItem().keyName(), + (Class) cid.getType()); + + HotkeyButton button = new HotkeyButton(startingValue, cid.getType() == ModifierlessKeybind.class); + + button.addFocusListener(new FocusAdapter() + { + @Override + public void focusLost(FocusEvent e) + { + changeConfiguration(listItem, config, button, cd, cid); + } + }); + + item.add(button, BorderLayout.EAST); + } + + else if (cid.getType() == EnumSet.class) + { + + int displayRows = cid.getItem().displayRows(); + + Class enumType = cid.getItem().enumClass(); + + EnumSet enumSet = configManager.getConfiguration(cd.getGroup().value(), + cid.getItem().keyName(), EnumSet.class); + if (enumSet == null || enumSet.contains(null)) + { + enumSet = EnumSet.noneOf(enumType); + } + JList jList = new JList(enumType.getEnumConstants()); + jList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + + if (!enumSet.isEmpty() && enumSet.size() > 1) + { + int[] selected = new int[enumSet.size()]; + for (int i = 0; i < enumSet.size(); i++) + { + if (enumSet.contains(EnumSet.allOf(enumType).toArray()[i])) + { + selected[i] = Lists.newArrayList(EnumSet.allOf(enumType)).indexOf(enumSet.toArray()[i]); + } + } + jList.setSelectedIndices(selected); + } + if (enumSet.size() == 1) + { + enumSet.forEach(anObject -> jList.setSelectedValue(anObject, true)); + } + jList.setVisibleRowCount(displayRows); + jList.setPrototypeCellValue("XXXXXXXXXX"); + jList.setCellRenderer(new ComboBoxListRenderer()); + jList.setLayoutOrientation(JList.VERTICAL); + jList.setSelectionBackground(Color.decode("708090")); + jList.addListSelectionListener(e -> + changeConfiguration(listItem, config, jList, cd, cid)); + JScrollPane jScrollPane = new JScrollPane(); + jScrollPane.setViewportView(jList); + jScrollPane.setViewportBorder(BorderFactory.createLoweredSoftBevelBorder()); + + item.add(jScrollPane, BorderLayout.SOUTH); + + } + + JPanel titleSection = titleSectionWidgets.get(cid.getItem().titleSection()); + JPanel section = sectionWidgets.get(cid.getItem().section()); + + if (titleSection != null) + { + titleSection.add(item); + } + else if (section != null) + { + section.add(item); + } + else + { + mainPanel.add(item); + } } + buttons.forEach(mainPanel::add); + JButton resetButton = new JButton("Reset"); resetButton.addActionListener((e) -> { @@ -1154,25 +1228,6 @@ public class ConfigPanel extends PluginPanel revalidate(); } - private void changeGroupCollapse(PluginListItem listItem, Config config, JComponent component, ConfigDescriptor cd, ConfigItemsGroup cig) - { - if (component instanceof JButton) - { - - String sCollapsed = configManager.getConfiguration(cd.getGroup().value(), cig.getGroup() + "_collapse"); - boolean collapse = true; - - if (sCollapsed != null) - { - collapse = !Boolean.parseBoolean(sCollapsed); - } - - configManager.setConfiguration(cd.getGroup().value(), cig.getGroup() + "_collapse", collapse); - - reloadPluginlist(listItem, config, cd); - } - } - private void changeConfiguration(PluginListItem listItem, Config config, Component component, ConfigDescriptor cd, ConfigItemDescriptor cid) { final ConfigItem configItem = cid.getItem(); @@ -1281,7 +1336,7 @@ public class ConfigPanel extends PluginPanel { JList jList = (JList) component; - Class enumType = cid.getItem().enumClass(); + Class enumType = cid.getItem().enumClass(); EnumSet enumSet = configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName(), EnumSet.class); if (enumSet == null) @@ -1312,7 +1367,7 @@ public class ConfigPanel extends PluginPanel reloadPluginlist(listItem, config, cd); } - String changedVal = String.valueOf(( jList.getSelectedValues())); + String changedVal = String.valueOf((jList.getSelectedValues())); if (cid2.getItem().enabledBy().contains(cid.getItem().keyName()) && cid2.getItem().enabledByValue().equals(changedVal)) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/coxhelper/CoxConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/coxhelper/CoxConfig.java index 18c7898b19..705c7cd6db 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/coxhelper/CoxConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/coxhelper/CoxConfig.java @@ -32,8 +32,9 @@ import lombok.Getter; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigTitleSection; import net.runelite.client.config.Range; -import net.runelite.client.config.Stub; +import net.runelite.client.config.Title; @ConfigGroup("Cox") @@ -57,15 +58,15 @@ public interface CoxConfig extends Config } } - @ConfigItem( + @ConfigTitleSection( + keyName = "muttadileTitle", position = 1, - keyName = "muttadileStub", name = "Muttadile", description = "" ) - default Stub muttadileStub() + default Title muttadileTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -73,22 +74,22 @@ public interface CoxConfig extends Config keyName = "muttadile", name = "Muttadile Marker", description = "Places an overlay around muttadiles showing their melee range.", - parent = "muttadileStub" + titleSection = "muttadileTitle" ) default boolean muttadile() { return true; } - @ConfigItem( + @ConfigTitleSection( + keyName = "tektonTitle", position = 3, - keyName = "tektonStub", name = "Tekton", description = "" ) - default Stub tektonStub() + default Title tektonTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -96,7 +97,7 @@ public interface CoxConfig extends Config keyName = "tekton", name = "Tekton Marker", description = "Places an overlay around Tekton showing his melee range.", - parent = "tektonStub" + titleSection = "tektonTitle" ) default boolean tekton() { @@ -108,22 +109,22 @@ public interface CoxConfig extends Config keyName = "tektonTickCounter", name = "Tekton Tick Counters", description = "Counts down current phase timer, and attack ticks.", - parent = "tektonStub" + titleSection = "tektonTitle" ) default boolean tektonTickCounter() { return true; } - @ConfigItem( + @ConfigTitleSection( + keyName = "guardiansTitle", position = 5, - keyName = "guardiansStub", name = "Guardians", description = "" ) - default Stub guardiansStub() + default Title guardiansTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -131,7 +132,7 @@ public interface CoxConfig extends Config keyName = "guardians", name = "Guardians Overlay", description = "Places an overlay near Guardians showing safespot.", - parent = "guardiansStub" + titleSection = "guardiansTitle" ) default boolean guardians() { @@ -143,22 +144,22 @@ public interface CoxConfig extends Config keyName = "guardinTickCounter", name = "Guardians Tick Timing", description = "Places an overlay on Guardians showing attack tick timers.", - parent = "guardiansStub" + titleSection = "guardiansTitle" ) default boolean guardinTickCounter() { return true; } - @ConfigItem( + @ConfigTitleSection( + keyName = "vanguardsTitle", position = 7, - keyName = "vanguardsStub", name = "Vanguards", description = "" ) - default Stub vanguardsStub() + default Title vanguardsTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -166,7 +167,7 @@ public interface CoxConfig extends Config keyName = "vangHighlight", name = "Highlight Vanguards", description = "Color is based on their attack style.", - parent = "vanguardsStub" + titleSection = "vanguardsTitle" ) default boolean vangHighlight() { @@ -178,22 +179,22 @@ public interface CoxConfig extends Config keyName = "vangHealth", name = "Show Vanguards Current HP", description = "This will create an infobox with vanguards current hp.", - parent = "vanguardsStub" + titleSection = "vanguardsTitle" ) default boolean vangHealth() { return true; } - @ConfigItem( + @ConfigTitleSection( + keyName = "olmTitle", position = 10, - keyName = "olmStub", name = "Olm", description = "" ) - default Stub olmStub() + default Title olmTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -201,7 +202,7 @@ public interface CoxConfig extends Config keyName = "prayAgainstOlm", name = "Olm Show Prayer", description = "Shows what prayer to use during olm.", - parent = "olmStub" + titleSection = "olmTitle" ) default boolean prayAgainstOlm() { @@ -217,7 +218,7 @@ public interface CoxConfig extends Config keyName = "prayAgainstOlmSize", name = "Olm Prayer Size", description = "Change the Size of the Olm Infobox.", - parent = "olmStub" + titleSection = "olmTitle" ) default int prayAgainstOlmSize() { @@ -229,7 +230,7 @@ public interface CoxConfig extends Config keyName = "timers", name = "Olm Show Burn/Acid Timers", description = "Shows tick timers for burns/acids.", - parent = "olmStub" + titleSection = "olmTitle" ) default boolean timers() { @@ -241,7 +242,7 @@ public interface CoxConfig extends Config keyName = "tpOverlay", name = "Olm Show Teleport Overlays", description = "Shows Overlays for targeted teleports.", - parent = "olmStub" + titleSection = "olmTitle" ) default boolean tpOverlay() { @@ -253,22 +254,22 @@ public interface CoxConfig extends Config keyName = "olmTick", name = "Olm Tick Counter", description = "Show Tick Counter on Olm", - parent = "olmStub" + titleSection = "olmTitle" ) default boolean olmTick() { return true; } - @ConfigItem( - position = 15, + @ConfigTitleSection( keyName = "colors", + position = 15, name = "Colors", description = "" ) - default Stub colors() + default Title colors() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -276,7 +277,7 @@ public interface CoxConfig extends Config keyName = "muttaColor", name = "Muttadile Tile Color", description = "Change hit area tile color for muttadiles", - parent = "colors", + titleSection = "colors", hidden = true, unhide = "Muttadile" ) @@ -290,7 +291,7 @@ public interface CoxConfig extends Config keyName = "guardColor", name = "Guardians Tile Color", description = "Change safespot area tile color for Guardians", - parent = "colors", + titleSection = "colors", hidden = true, unhide = "Guardians" ) @@ -304,7 +305,7 @@ public interface CoxConfig extends Config keyName = "tektonColor", name = "Tekton Tile Color", description = "Change hit area tile color for Tekton", - parent = "colors", + titleSection = "colors", hidden = true, unhide = "Tekton" ) @@ -318,7 +319,7 @@ public interface CoxConfig extends Config keyName = "burnColor", name = "Burn Victim Color", description = "Changes tile color for burn victim.", - parent = "colors", + titleSection = "colors", hidden = true, unhide = "timers" ) @@ -332,7 +333,7 @@ public interface CoxConfig extends Config keyName = "acidColor", name = "Acid Victim Color", description = "Changes tile color for acid victim.", - parent = "colors", + titleSection = "colors", hidden = true, unhide = "timers" ) @@ -346,7 +347,7 @@ public interface CoxConfig extends Config keyName = "tpColor", name = "Teleport Target Color", description = "Changes tile color for teleport target.", - parent = "colors", + titleSection = "colors", hidden = true, unhide = "tpOverlay" ) @@ -355,15 +356,15 @@ public interface CoxConfig extends Config return new Color(193, 255, 245); } - @ConfigItem( - position = 22, + @ConfigTitleSection( keyName = "text", + position = 22, name = "Text", description = "" ) - default Stub text() + default Title text() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -371,7 +372,7 @@ public interface CoxConfig extends Config keyName = "fontStyle", name = "Font Style", description = "Bold/Italics/Plain", - parent = "text" + titleSection = "text" ) default FontStyle fontStyle() { @@ -387,7 +388,7 @@ public interface CoxConfig extends Config keyName = "textSize", name = "Text Size", description = "Text Size for Timers.", - parent = "text" + titleSection = "text" ) default int textSize() { @@ -399,7 +400,7 @@ public interface CoxConfig extends Config keyName = "shadows", name = "Shadows", description = "Adds Shadows to text.", - parent = "text" + titleSection = "text" ) default boolean shadows() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/FightCaveConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/FightCaveConfig.java index 09f99f2d2d..72cc3be70c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/FightCaveConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/FightCaveConfig.java @@ -30,21 +30,22 @@ import lombok.Getter; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigTitleSection; import net.runelite.client.config.Range; -import net.runelite.client.config.Stub; +import net.runelite.client.config.Title; @ConfigGroup("fightcave") public interface FightCaveConfig extends Config { - @ConfigItem( - position = 0, + @ConfigTitleSection( keyName = "mainConfig", + position = 0, name = "Main Config", description = "" ) - default Stub mainConfig() + default Title mainConfig() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -52,7 +53,7 @@ public interface FightCaveConfig extends Config keyName = "waveDisplay", name = "Wave display", description = "Shows monsters that will spawn on the selected wave(s).", - parent = "mainConfig" + titleSection = "mainConfig" ) default WaveDisplayMode waveDisplay() { @@ -64,22 +65,22 @@ public interface FightCaveConfig extends Config keyName = "tickTimersWidget", name = "Tick Timers in Prayer", description = "Adds an overlay to the Prayer Interface with the ticks until next attack for that prayer.", - parent = "mainConfig" + titleSection = "mainConfig" ) default boolean tickTimersWidget() { return true; } - @ConfigItem( - position = 3, + @ConfigTitleSection( keyName = "text", + position = 3, name = "Text", description = "" ) - default Stub text() + default Title text() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -87,7 +88,7 @@ public interface FightCaveConfig extends Config keyName = "fontStyle", name = "Font Style", description = "Plain | Bold | Italics", - parent = "text" + titleSection = "text" ) default FontStyle fontStyle() { @@ -103,7 +104,7 @@ public interface FightCaveConfig extends Config keyName = "textSize", name = "Text Size", description = "Text Size for Timers.", - parent = "text" + titleSection = "text" ) default int textSize() { @@ -115,7 +116,7 @@ public interface FightCaveConfig extends Config keyName = "shadows", name = "Shadows", description = "Adds Shadows to text.", - parent = "text" + titleSection = "text" ) default boolean shadows() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersConfig.java index ced7569435..7e9142df45 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersConfig.java @@ -27,21 +27,22 @@ package net.runelite.client.plugins.freezetimers; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigTitleSection; import net.runelite.client.config.Range; -import net.runelite.client.config.Stub; +import net.runelite.client.config.Title; @ConfigGroup("freezetimers") public interface FreezeTimersConfig extends Config { - @ConfigItem( - keyName = "timersStub", + @ConfigTitleSection( + keyName = "timersTitle", name = "Timers", description = "", position = 1 ) - default Stub timersStub() + default Title timersTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -49,7 +50,7 @@ public interface FreezeTimersConfig extends Config name = "Show Players", description = "Configure if the player overlay should be shown", position = 2, - parent = "timersStub" + titleSection = "timersTitle" ) default boolean showPlayers() { @@ -61,7 +62,7 @@ public interface FreezeTimersConfig extends Config name = "Show NPCs", description = "Configure if the npc overlay should be shown", position = 3, - parent = "timersStub" + titleSection = "timersTitle" ) default boolean showNpcs() { @@ -73,7 +74,7 @@ public interface FreezeTimersConfig extends Config name = "Show Freeze Timers", description = "Toggle overlay for Freeze timers", position = 4, - parent = "timersStub" + titleSection = "timersTitle" ) default boolean FreezeTimers() { @@ -85,7 +86,7 @@ public interface FreezeTimersConfig extends Config name = "Show TB Timers", description = "Toggle overlay for TB timers", position = 5, - parent = "timersStub" + titleSection = "timersTitle" ) default boolean TB() { @@ -97,22 +98,22 @@ public interface FreezeTimersConfig extends Config name = "Show Veng Timers", description = "Toggle overlay for Veng timers", position = 6, - parent = "timersStub" + titleSection = "timersTitle" ) default boolean Veng() { return true; } - @ConfigItem( - keyName = "overlayStub", + @ConfigTitleSection( + keyName = "overlayTitle", name = "Overlay", description = "", position = 7 ) - default Stub overlayStub() + default Title overlayTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -120,7 +121,7 @@ public interface FreezeTimersConfig extends Config name = "X Offset", description = "Increasing this will push further away from model. Does not apply to text timers.", position = 8, - parent = "overlayStub" + titleSection = "overlayTitle" ) default int offset() { @@ -132,7 +133,7 @@ public interface FreezeTimersConfig extends Config name = "Text Timers", description = "Remove Images from Timers", position = 9, - parent = "overlayStub" + titleSection = "overlayTitle" ) default boolean noImage() { @@ -144,7 +145,7 @@ public interface FreezeTimersConfig extends Config name = "Font Style", description = "Bold/Italics/Plain", position = 10, - parent = "overlayStub" + titleSection = "overlayTitle" ) default FontStyle fontStyle() { @@ -160,7 +161,7 @@ public interface FreezeTimersConfig extends Config name = "Text Size", description = "Text Size for Timers.", position = 11, - parent = "overlayStub" + titleSection = "overlayTitle" ) default int textSize() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gauntlet/GauntletConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/gauntlet/GauntletConfig.java index 5e1bda2748..de9ed17d0d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gauntlet/GauntletConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gauntlet/GauntletConfig.java @@ -32,8 +32,9 @@ import lombok.Getter; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigTitleSection; import net.runelite.client.config.Range; -import net.runelite.client.config.Stub; +import net.runelite.client.config.Title; @ConfigGroup("Gauntlet") @@ -57,15 +58,15 @@ public interface GauntletConfig extends Config } } - @ConfigItem( - position = 0, + @ConfigTitleSection( keyName = "resources", + position = 0, name = "Resources", description = "" ) - default Stub resources() + default Title resources() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -73,7 +74,7 @@ public interface GauntletConfig extends Config keyName = "highlightResources", name = "Highlight Resources (Outline)", description = "Highlights all the resources in each room with an outline.", - parent = "resources" + titleSection = "resources" ) default boolean highlightResources() { @@ -85,7 +86,7 @@ public interface GauntletConfig extends Config keyName = "highlightResourcesColor", name = "Highlight Color", description = "Highlights all the resources in each room with this color.", - parent = "resources", + titleSection = "resources", hidden = true, unhide = "highlightResources" ) @@ -99,7 +100,7 @@ public interface GauntletConfig extends Config keyName = "highlightResourcesIcons", name = "Highlight Resources (Icon)", description = "Highlights all the icons in each room with an icon.", - parent = "resources", + titleSection = "resources", hidden = true, unhide = "highlightResources" ) @@ -119,22 +120,22 @@ public interface GauntletConfig extends Config description = " change the size of resource icons.", hidden = true, unhide = "highlightResources", - parent = "resources" + titleSection = "resources" ) default int resourceIconSize() { return 20; } - @ConfigItem( - position = 5, + @ConfigTitleSection( keyName = "boss", + position = 5, name = "Boss", description = "" ) - default Stub boss() + default Title boss() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -142,7 +143,7 @@ public interface GauntletConfig extends Config keyName = "countAttacks", name = "Count Attacks Display", description = "Count the attacks until the Hunllef switches their attack style and prayer.", - parent = "boss" + titleSection = "boss" ) default CounterDisplay countAttacks() { @@ -154,7 +155,7 @@ public interface GauntletConfig extends Config keyName = "highlightWidget", name = "Highlight Prayer (Prayer Tab)", description = "Highlights the correct prayer to use in your prayer book.", - parent = "boss" + titleSection = "boss" ) default boolean highlightWidget() { @@ -166,7 +167,7 @@ public interface GauntletConfig extends Config keyName = "highlightPrayerInfobox", name = "Highlight Prayer (InfoBox)", description = "Highlights the correct prayer to use in an Infobox.", - parent = "boss" + titleSection = "boss" ) default boolean highlightPrayerInfobox() { @@ -178,7 +179,7 @@ public interface GauntletConfig extends Config keyName = "flashOnWrongAttack", name = "Flash screen on Wrong Attack", description = "This will flash your screen if you attack with the wrong stlye.", - parent = "boss" + titleSection = "boss" ) default boolean flashOnWrongAttack() { @@ -190,7 +191,7 @@ public interface GauntletConfig extends Config keyName = "uniquePrayerAudio", name = "Prayer Audio Warning", description = "Plays a unique sound whenever the boss is about to shut down your prayer.", - parent = "boss" + titleSection = "boss" ) default boolean uniquePrayerAudio() { @@ -202,7 +203,7 @@ public interface GauntletConfig extends Config keyName = "uniquePrayerVisual", name = "Prayer Attack (Icon)", description = "Prayer attacks will have a unique overlay visual.", - parent = "boss" + titleSection = "boss" ) default boolean uniquePrayerVisual() { @@ -214,7 +215,7 @@ public interface GauntletConfig extends Config keyName = "uniqueAttackVisual", name = "Magic & Range Attack (Icon)", description = "Magic and Range attacks will have a unique overlay visual.", - parent = "boss" + titleSection = "boss" ) default boolean uniqueAttackVisual() { @@ -226,7 +227,7 @@ public interface GauntletConfig extends Config keyName = "attackVisualOutline", name = "Hunllefs' attacks (Outline)", description = "Outline the Hunllefs' attacks.", - parent = "boss" + titleSection = "boss" ) default boolean attackVisualOutline() { @@ -238,7 +239,7 @@ public interface GauntletConfig extends Config keyName = "overlayBoss", name = "Outline Hunllef (Color)", description = "Overlay Hunllef while you are on the wrong prayer with an color denoting it's current attack style.", - parent = "boss" + titleSection = "boss" ) default boolean overlayBoss() { @@ -251,7 +252,7 @@ public interface GauntletConfig extends Config keyName = "overlayBossPrayer", name = "Hunllef Overlay (Icons)", description = "Overlay the Hunllef with an icon denoting it's current attack style.", - parent = "boss" + titleSection = "boss" ) default boolean overlayBossPrayer() { @@ -263,7 +264,7 @@ public interface GauntletConfig extends Config keyName = "overlayTornadoes", name = "Show Tornado Decay", description = "Display the amount of ticks left until the tornadoes decay.", - parent = "boss" + titleSection = "boss" ) default boolean overlayTornadoes() { @@ -279,22 +280,22 @@ public interface GauntletConfig extends Config keyName = "projectileIconSize", name = "Hunllef Projectile Icon Size", description = " change the size of Projectile icons.", - parent = "boss" + titleSection = "boss" ) default int projectileIconSize() { return 20; } - @ConfigItem( - position = 18, + @ConfigTitleSection( keyName = "timer", + position = 18, name = "Timer", description = "" ) - default Stub timer() + default Title timer() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -302,7 +303,7 @@ public interface GauntletConfig extends Config keyName = "displayTimerWidget", name = "Show Gauntlet timer overlay", description = "Display a timer widget that tracks your gauntlet progress.", - parent = "timer" + titleSection = "timer" ) default boolean displayTimerWidget() { @@ -314,7 +315,7 @@ public interface GauntletConfig extends Config keyName = "displayTimerChat", name = "Show Gauntlet timer chat message", description = "Display a chat message that tracks your gauntlet progress.", - parent = "timer" + titleSection = "timer" ) default boolean displayTimerChat() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPluginConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPluginConfig.java index b80999c9d0..3263daae79 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPluginConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPluginConfig.java @@ -27,8 +27,9 @@ package net.runelite.client.plugins.gpu; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigTitleSection; import net.runelite.client.config.Range; -import net.runelite.client.config.Stub; +import net.runelite.client.config.Title; import static net.runelite.client.plugins.gpu.GpuPlugin.MAX_DISTANCE; import static net.runelite.client.plugins.gpu.GpuPlugin.MAX_FOG_DEPTH; import net.runelite.client.plugins.gpu.config.AnisotropicFilteringMode; @@ -37,15 +38,15 @@ import net.runelite.client.plugins.gpu.config.AntiAliasingMode; @ConfigGroup("gpu") public interface GpuPluginConfig extends Config { - @ConfigItem( - keyName = "drawingStub", + @ConfigTitleSection( + keyName = "drawingTitle", name = "Drawing", description = "", position = 1 ) - default Stub drawingStub() + default Title drawingTitle() { - return new Stub(); + return new Title(); } @Range( @@ -57,7 +58,7 @@ public interface GpuPluginConfig extends Config name = "Draw Distance", description = "Draw distance", position = 2, - parent = "drawingStub" + titleSection = "drawingTitle" ) default int drawDistance() { @@ -69,22 +70,22 @@ public interface GpuPluginConfig extends Config name = "Remove Color Banding", description = "Smooths out the color banding that is present in the CPU renderer", position = 3, - parent = "drawingStub" + titleSection = "drawingTitle" ) default boolean smoothBanding() { return false; } - @ConfigItem( - keyName = "ppStub", + @ConfigTitleSection( + keyName = "ppTitle", name = "Post processing", description = "", position = 4 ) - default Stub ppStub() + default Title ppTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -92,7 +93,7 @@ public interface GpuPluginConfig extends Config name = "Anti Aliasing", description = "Configures the anti-aliasing mode", position = 5, - parent = "ppStub" + titleSection = "ppTitle" ) default AntiAliasingMode antiAliasingMode() { @@ -104,22 +105,22 @@ public interface GpuPluginConfig extends Config name = "Anisotropic Filtering", description = "Configures the anisotropic filtering mode", position = 6, - parent = "ppStub" + titleSection = "ppTitle" ) default AnisotropicFilteringMode anisotropicFilteringMode() { return AnisotropicFilteringMode.DISABLED; } - @ConfigItem( - keyName = "fogStub", + @ConfigTitleSection( + keyName = "fogTitle", name = "Fog", description = "", position = 7 ) - default Stub fogStub() + default Title fogTitle() { - return new Stub(); + return new Title(); } @Range( @@ -130,7 +131,7 @@ public interface GpuPluginConfig extends Config name = "Depth", description = "Distance from the scene edge the fog starts", position = 8, - parent = "fogStub" + titleSection = "fogTitle" ) default int fogDepth() { @@ -145,7 +146,7 @@ public interface GpuPluginConfig extends Config name = "Roundness", description = "Fog circularity in %", position = 9, - parent = "fogStub" + titleSection = "fogTitle" ) default int fogCircularity() { @@ -160,7 +161,7 @@ public interface GpuPluginConfig extends Config name = "Density", description = "Relative fog thickness", position = 10, - parent = "fogStub" + titleSection = "fogTitle" ) default int fogDensity() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java index e266f4626e..afd1586d15 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java @@ -30,7 +30,8 @@ import net.runelite.client.config.Alpha; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -import net.runelite.client.config.Stub; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; import net.runelite.client.plugins.grounditems.config.ItemHighlightMode; import net.runelite.client.plugins.grounditems.config.MenuHighlightMode; import net.runelite.client.plugins.grounditems.config.PriceDisplayMode; @@ -40,15 +41,15 @@ import net.runelite.client.plugins.grounditems.config.ValueCalculationMode; @ConfigGroup("grounditems") public interface GroundItemsConfig extends Config { - @ConfigItem( - keyName = "colorsStub", + @ConfigTitleSection( + keyName = "colorsTitle", name = "Colors", description = "", position = 1 ) - default Stub colorsStub() + default Title colorsTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -56,7 +57,7 @@ public interface GroundItemsConfig extends Config name = "Default items", description = "Configures the color for default, non-highlighted items", position = 2, - parent = "colorsStub" + titleSection = "colorsTitle" ) @Alpha default Color defaultColor() @@ -69,7 +70,7 @@ public interface GroundItemsConfig extends Config name = "Highlighted items", description = "Configures the color for highlighted items", position = 3, - parent = "colorsStub" + titleSection = "colorsTitle" ) @Alpha default Color highlightedColor() @@ -82,7 +83,7 @@ public interface GroundItemsConfig extends Config name = "Hidden items", description = "Configures the color for hidden items in right-click menu and when holding ALT", position = 4, - parent = "colorsStub" + titleSection = "colorsTitle" ) @Alpha default Color hiddenColor() @@ -90,15 +91,15 @@ public interface GroundItemsConfig extends Config return Color.GRAY; } - @ConfigItem( - keyName = "highlightedStub", + @ConfigTitleSection( + keyName = "highlightedTitle", name = "Highlighted", description = "", position = 5 ) - default Stub highlightedStub() + default Title highlightedTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -106,7 +107,7 @@ public interface GroundItemsConfig extends Config name = "Highlighted Items", description = "Configures specifically highlighted ground items. Format: (item), (item)", position = 6, - parent = "highlightedStub" + titleSection = "highlightedTitle" ) default String getHighlightItems() { @@ -125,7 +126,7 @@ public interface GroundItemsConfig extends Config name = "Show Highlighted items only", description = "Configures whether or not to draw items only on your highlighted list", position = 7, - parent = "highlightedStub" + titleSection = "highlightedTitle" ) default boolean showHighlightedOnly() { @@ -137,7 +138,7 @@ public interface GroundItemsConfig extends Config name = "Highlighted Value Calculation", description = "Configures which coin value is used to determine highlight color", position = 8, - parent = "highlightedStub" + titleSection = "highlightedTitle" ) default ValueCalculationMode valueCalculationMode() { @@ -149,7 +150,7 @@ public interface GroundItemsConfig extends Config name = "Highlight > Value", description = "Configures highlighted ground items over either GE or HA value", position = 9, - parent = "highlightedStub" + titleSection = "highlightedTitle" ) default int getHighlightOverValue() { @@ -161,22 +162,22 @@ public interface GroundItemsConfig extends Config name = "Notify for Highlighted drops", description = "Configures whether or not to notify for drops on your highlighted list", position = 10, - parent = "highlightStub" + titleSection = "highlightTitle" ) default boolean notifyHighlightedDrops() { return false; } - @ConfigItem( - keyName = "hiddenStub", + @ConfigTitleSection( + keyName = "hiddenTitle", name = "Hidden", description = "", position = 11 ) - default Stub hiddenStub() + default Title hiddenTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -184,7 +185,7 @@ public interface GroundItemsConfig extends Config name = "Do not hide untradeables", description = "Configures whether or not untradeable items ignore hiding under settings", position = 12, - parent = "hiddenStub" + titleSection = "hiddenTitle" ) default boolean dontHideUntradeables() { @@ -196,7 +197,7 @@ public interface GroundItemsConfig extends Config name = "Hidden Items", description = "Configures hidden ground items. Format: (item), (item)", position = 13, - parent = "hiddenStub" + titleSection = "hiddenTitle" ) default String getHiddenItems() { @@ -207,7 +208,7 @@ public interface GroundItemsConfig extends Config keyName = "hiddenItems", name = "", description = "", - parent = "hiddenStub" + titleSection = "hiddenTitle" ) void setHiddenItems(String key); @@ -216,7 +217,7 @@ public interface GroundItemsConfig extends Config name = "Recolor Menu Hidden Items", description = "Configures whether or not hidden items in right click menu will be recolored", position = 14, - parent = "hiddenStub" + titleSection = "hiddenTitle" ) default boolean recolorMenuHiddenItems() { @@ -228,7 +229,7 @@ public interface GroundItemsConfig extends Config name = "Hide < Value", description = "Configures hidden ground items under both GE and HA value", position = 15, - parent = "hiddenStub" + titleSection = "hiddenTitle" ) default int getHideUnderValue() { @@ -240,7 +241,7 @@ public interface GroundItemsConfig extends Config name = "Hide Hidden", description = "Remove take option for items that are on the hidden items list.", position = 16, - parent = "hiddenStub" + titleSection = "hiddenTitle" ) default boolean removeIgnored() { @@ -252,22 +253,22 @@ public interface GroundItemsConfig extends Config name = "Right click hidden items", description = "Places hidden items below the 'Walk here' option, making it so that you need to right click to pick them up", position = 17, - parent = "hiddenStub" + titleSection = "hiddenTitle" ) default boolean rightClickHidden() { return false; } - @ConfigItem( - keyName = "highlightStub", + @ConfigTitleSection( + keyName = "highlightTitle", name = "Highlight", description = "", position = 18 ) - default Stub highlightStub() + default Title highlightTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -275,7 +276,7 @@ public interface GroundItemsConfig extends Config name = "Highlight Tiles", description = "Configures whether or not to highlight tiles containing ground items", position = 19, - parent = "highlightStub" + titleSection = "highlightTitle" ) default boolean highlightTiles() { @@ -287,7 +288,7 @@ public interface GroundItemsConfig extends Config name = "Item Highlight Mode", description = "Configures how ground items will be highlighted", position = 20, - parent = "highlightStub" + titleSection = "highlightTitle" ) default ItemHighlightMode itemHighlightMode() { @@ -299,22 +300,22 @@ public interface GroundItemsConfig extends Config name = "Menu Highlight Mode", description = "Configures what to highlight in right-click menu", position = 21, - parent = "highlightStub" + titleSection = "highlightTitle" ) default MenuHighlightMode menuHighlightMode() { return MenuHighlightMode.NAME; } - @ConfigItem( - keyName = "lowValueStub", + @ConfigTitleSection( + keyName = "lowValueTitle", name = "Low value", description = "", position = 22 ) - default Stub lowValueStub() + default Title lowValueTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -322,7 +323,7 @@ public interface GroundItemsConfig extends Config name = "Low value color", description = "Configures the color for low value items", position = 23, - parent = "lowValueStub" + titleSection = "lowValueTitle" ) @Alpha default Color lowValueColor() @@ -335,7 +336,7 @@ public interface GroundItemsConfig extends Config name = "Low value price", description = "Configures the start price for low value items", position = 24, - parent = "lowValueStub" + titleSection = "lowValueTitle" ) default int lowValuePrice() { @@ -347,22 +348,22 @@ public interface GroundItemsConfig extends Config name = "Notify for low value drops", description = "Configures whether or not to notify for drops of low value", position = 25, - parent = "lowValueStub" + titleSection = "lowValueTitle" ) default boolean notifyLowValueDrops() { return false; } - @ConfigItem( - keyName = "mediumValueStub", + @ConfigTitleSection( + keyName = "mediumValueTitle", name = "Medium value", description = "", position = 26 ) - default Stub mediumValueStub() + default Title mediumValueTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -370,7 +371,7 @@ public interface GroundItemsConfig extends Config name = "Medium value color", description = "Configures the color for medium value items", position = 27, - parent = "mediumValueStub" + titleSection = "mediumValueTitle" ) @Alpha default Color mediumValueColor() @@ -383,7 +384,7 @@ public interface GroundItemsConfig extends Config name = "Medium value price", description = "Configures the start price for medium value items", position = 28, - parent = "mediumValueStub" + titleSection = "mediumValueTitle" ) default int mediumValuePrice() { @@ -395,22 +396,22 @@ public interface GroundItemsConfig extends Config name = "Notify for medium value drops", description = "Configures whether or not to notify for drops of medium value", position = 29, - parent = "mediumValueStub" + titleSection = "mediumValueTitle" ) default boolean notifyMediumValueDrops() { return false; } - @ConfigItem( - keyName = "highValueStub", + @ConfigTitleSection( + keyName = "highValueTitle", name = "High value", description = "", position = 30 ) - default Stub highValueStub() + default Title highValueTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -418,7 +419,7 @@ public interface GroundItemsConfig extends Config name = "High value color", description = "Configures the color for high value items", position = 31, - parent = "highValueStub" + titleSection = "highValueTitle" ) @Alpha default Color highValueColor() @@ -431,7 +432,7 @@ public interface GroundItemsConfig extends Config name = "High value price", description = "Configures the start price for high value items", position = 32, - parent = "highValueStub" + titleSection = "highValueTitle" ) default int highValuePrice() { @@ -443,22 +444,22 @@ public interface GroundItemsConfig extends Config name = "Notify for high value drops", description = "Configures whether or not to notify for drops of high value", position = 33, - parent = "highValueStub" + titleSection = "highValueTitle" ) default boolean notifyHighValueDrops() { return false; } - @ConfigItem( - keyName = "insaneValueStub", + @ConfigTitleSection( + keyName = "insaneValueTitle", name = "Insane value", description = "", position = 34 ) - default Stub insaneValueStub() + default Title insaneValueTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -466,7 +467,7 @@ public interface GroundItemsConfig extends Config name = "Insane value items color", description = "Configures the color for insane value items", position = 35, - parent = "insaneValueStub" + titleSection = "insaneValueTitle" ) @Alpha default Color insaneValueColor() @@ -479,7 +480,7 @@ public interface GroundItemsConfig extends Config name = "Insane value price", description = "Configures the start price for insane value items", position = 36, - parent = "insaneValueStub" + titleSection = "insaneValueTitle" ) default int insaneValuePrice() { @@ -491,22 +492,22 @@ public interface GroundItemsConfig extends Config name = "Notify for insane value drops", description = "Configures whether or not to notify for drops of insane value", position = 37, - parent = "insaneValueStub" + titleSection = "insaneValueTitle" ) default boolean notifyInsaneValueDrops() { return false; } - @ConfigItem( - keyName = "priceStub", + @ConfigTitleSection( + keyName = "priceTitle", name = "Price", description = "", position = 38 ) - default Stub priceStub() + default Title priceTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -514,7 +515,7 @@ public interface GroundItemsConfig extends Config name = "Price Display Mode", description = "Configures what price types are shown alongside of ground item name", position = 39, - parent = "priceStub" + titleSection = "priceTitle" ) default PriceDisplayMode priceDisplayMode() { @@ -526,22 +527,22 @@ public interface GroundItemsConfig extends Config name = "Sort by GE price", description = "Sorts ground items by GE price, instead of alch value", position = 40, - parent = "priceStub" + titleSection = "priceTitle" ) default boolean sortByGEPrice() { return false; } - @ConfigItem( - keyName = "miscStub", + @ConfigTitleSection( + keyName = "miscTitle", name = "Miscellaneous", description = "", position = 41 ) - default Stub miscStub() + default Title miscTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -549,7 +550,7 @@ public interface GroundItemsConfig extends Config name = "Show Menu Item Quantities", description = "Configures whether or not to show the item quantities in the menu", position = 42, - parent = "miscStub" + titleSection = "miscTitle" ) default boolean showMenuItemQuantities() { @@ -561,7 +562,7 @@ public interface GroundItemsConfig extends Config name = "Collapse ground item menu entries", description = "Collapses ground item menu entries together and appends count", position = 43, - parent = "miscStub" + titleSection = "miscTitle" ) default boolean collapseEntries() { @@ -573,7 +574,7 @@ public interface GroundItemsConfig extends Config name = "Only show loot", description = "Only shows drops from NPCs and players", position = 44, - parent = "miscStub" + titleSection = "miscTitle" ) default boolean onlyShowLoot() { @@ -585,7 +586,7 @@ public interface GroundItemsConfig extends Config name = "Show time remaining", description = "Turn on a countdown timer to show how long an item will remain on the ground", position = 45, - parent = "miscStub" + titleSection = "miscTitle" ) default TimerDisplayMode showGroundItemDuration() { @@ -597,7 +598,7 @@ public interface GroundItemsConfig extends Config name = "Delay for double-tap ALT to hide", description = "Decrease this number if you accidentally hide ground items often. (0 = Disabled)", position = 46, - parent = "miscStub" + titleSection = "miscTitle" ) default int doubleTapDelay() { @@ -609,31 +610,20 @@ public interface GroundItemsConfig extends Config name = "Text Outline", description = "Use an outline around text instead of a text shadow", position = 47, - parent = "miscStub" + titleSection = "miscTitle" ) default boolean toggleOutline() { return false; } - @ConfigItem( - keyName = "showTimer", - name = "Show ground item tick countdown timer", - description = "Shows how many ticks left until disappearing.", - position = 48, - parent = "miscStub" - ) - default boolean showTimer() - { - return false; - } - @Alpha @ConfigItem( keyName = "bordercolor", name = "Border color", description = "Change the border color", - position = 49 + position = 48, + titleSection = "miscTitle" ) default Color bordercolor() { @@ -641,14 +631,26 @@ public interface GroundItemsConfig extends Config } @ConfigItem( - keyName = "xpStub", + keyName = "showTimer", + name = "Show ground item tick countdown timer", + description = "Shows how many ticks left until disappearing.", + position = 49, + titleSection = "miscTitle" + ) + default boolean showTimer() + { + return false; + } + + @ConfigTitleSection( + keyName = "xpTitle", name = "XP", description = "Highlights various items that give xp", position = 50 ) - default Stub xpStub() + default Title xpTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -656,7 +658,7 @@ public interface GroundItemsConfig extends Config name = "Highlight Herblore xp", description = "Highlight Herblore xp related items.", position = 51, - parent = "xpStub" + titleSection = "xpTitle" ) default boolean highlightHerblore() { @@ -668,7 +670,7 @@ public interface GroundItemsConfig extends Config name = "Herblore Color", description = "Color of Herblore xp items.", position = 52, - parent = "xpStub" + titleSection = "xpTitle" ) @Alpha default Color herbloreColor() @@ -681,7 +683,7 @@ public interface GroundItemsConfig extends Config name = "Highlight Prayer xp", description = "Highlight Prayer xp related items.", position = 53, - parent = "xpStub" + titleSection = "xpTitle" ) default boolean highlightPrayer() { @@ -693,7 +695,7 @@ public interface GroundItemsConfig extends Config name = "Prayer Color", description = "Color of Prayer xp items.", position = 54, - parent = "xpStub" + titleSection = "xpTitle" ) @Alpha default Color prayerColor() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hideprayers/HidePrayersConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/hideprayers/HidePrayersConfig.java index 4acdaa8dd4..03e668140d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hideprayers/HidePrayersConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hideprayers/HidePrayersConfig.java @@ -30,6 +30,7 @@ package net.runelite.client.plugins.hideprayers; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigSection; import net.runelite.client.plugins.hideprayers.util.Armadyl; import net.runelite.client.plugins.hideprayers.util.Bandos; import net.runelite.client.plugins.hideprayers.util.Barrows; @@ -43,12 +44,45 @@ import net.runelite.client.plugins.hideprayers.util.Zulrah; @ConfigGroup("hideprayers") public interface HidePrayersConfig extends Config { + @ConfigSection( + name = "Individual Prayers", + description = "", + position = 0, + keyName = "individualPrayersSection" + ) + default boolean individualPrayersSection() + { + return false; + } + + @ConfigSection( + name = "PvM Prayers", + description = "", + position = 1, + keyName = "pvmSection" + ) + default boolean pvmSection() + { + return false; + } + + @ConfigSection( + name = "PvP Prayers", + description = "", + position = 2, + keyName = "pvpSection" + ) + default boolean pvpSection() + { + return false; + } + @ConfigItem( position = 0, keyName = "showindividualprayers", name = "Hide Individual Prayers", description = "Hide/Show Prayers.", - group = "Individual Prayers", + section = "individualPrayersSection", disabledBy = "getpvpprayers || HideRapidHealRestore || getzulrahprayers || getzamorakprayers || getvorkathprayers || getsaradominprayers || getcerberusprayers || getbandosprayers || getbarrowsprayers || getarmadylprayers" ) default boolean showindividualprayers() @@ -61,7 +95,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowTHICK_SKIN", name = "Show Thick Skin", description = "Hide/Show Thick Skin", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -75,7 +109,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowBURST_OF_STRENGTH", name = "Show Burst of Strength", description = "Hide/Show Burst of Strength", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -89,7 +123,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowCLARITY_OF_THOUGHT", name = "Show Clarity of Thought", description = "Hide/Show Clarity of Thought", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "Showindividualprayers" ) @@ -103,7 +137,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowSHARP_EYE", name = "Show Sharp Eye", description = "Hide/Show Sharp Eye", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -117,7 +151,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowMYSTIC_WILL", name = "Show Mystic Will", description = "Hide/Show Mystic Will", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -131,7 +165,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowROCK_SKIN", name = "Show Rock Skin", description = "Hide/Show Rock Skin", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -145,7 +179,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowSUPERHUMAN_STRENGTH", name = "Show Super Human Strength", description = "Hide/Show Super Human Strength", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -159,7 +193,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowIMPROVED_REFLEXES", name = "Show Improved_Reflexes", description = "Hide/Show Improved_Reflexes", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -173,7 +207,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowRapidRestore", name = "Show Rapid Restore", description = "Hide/Show Rapid Restore", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -187,7 +221,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowRapidHeal", name = "Show Rapid Heal", description = "Hide/Show Rapid Heal", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -201,7 +235,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowProtectItem", name = "Show Protect Item", description = "Hide/Show Protect Item", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -215,7 +249,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowHAWK_EYE", name = "Show Hawk Eye", description = "Hide/Show Hawk Eye", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -229,7 +263,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowMYSTIC_LORE", name = "Show Mystic Lore", description = "Hide/Show Mystic Lore", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -244,7 +278,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowSteelSkin", name = "Show Steel Skin", description = "Hide/Show Steel skin", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -258,7 +292,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowUltimateStrength", name = "Show Ultimate Strength", description = "Hide/Show Ultimate strength", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -272,7 +306,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowIncredibleReflex", name = "Show Incredible Reflex", description = "Hide/Show Incredible Reflex", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -286,7 +320,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowPTFMagic", name = "Show Protect From Magic", description = "Hide/Show Protect From Magic", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -300,7 +334,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowPTFRange", name = "Show Protect From Range", description = "Hide/Show Protect from Range", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -314,7 +348,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowPTFMelee", name = "Show Protect From Melee", description = "Hide/Show Protect From Melee", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -328,7 +362,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowEagle", name = "Show Eagle Eye", description = "Hide/Show Eagle Eye", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -342,7 +376,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowMystic", name = "Show Mystic Might", description = "Hide/Show Mystic Might", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -356,7 +390,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowRETRIBUTION", name = "Show Retribution", description = "Hide/Show Retribution", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -370,7 +404,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowRedemption", name = "Show Redemption", description = "Hide/Show Redemption", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -384,7 +418,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowSmite", name = "Show Smite", description = "Hide/Show Smite", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -398,7 +432,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowPreserve", name = "Show Preserve", description = "Hide/Show Preserve", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -412,7 +446,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowChivalry", name = "Show Chivalry", description = "Hide/Show Chivalry", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -426,7 +460,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowPiety", name = "Show Piety", description = "Hide/Show Piety", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -440,7 +474,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowRigour", name = "Show Rigour", description = "Hide/Show Rigour", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -454,7 +488,7 @@ public interface HidePrayersConfig extends Config keyName = "ShowAugury", name = "Show Augury", description = "Hide/Show Augury", - group = "Individual Prayers", + section = "individualPrayersSection", hidden = true, unhide = "showindividualprayers" ) @@ -466,11 +500,11 @@ public interface HidePrayersConfig extends Config // ----------------------------------------------------------- // @ConfigItem( - position = 29, + position = 0, keyName = "getarmadylprayers", name = "enable Armadyl Prayers", description = "Shows prayers for Armadyl", - group = "PVM Prayers", + section = "pvmSection", disabledBy = "showindividualprayers || getpvpprayers || HideRapidHealRestore || getzulrahprayers || getzamorakprayers || getvorkathprayers || getsaradominprayers || getcerberusprayers || getbandosprayers || getbarrowsprayers" ) default boolean getarmadylprayers() @@ -479,11 +513,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 30, + position = 1, keyName = "armadyl", name = "Armadyl", description = "Shows prayers for Armadyl", - group = "PVM Prayers", + section = "pvmSection", hidden = true, unhide = "getarmadylprayers" ) @@ -493,11 +527,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 31, + position = 2, keyName = "getbarrowsprayers", name = "enable Barrows Prayers", description = "Shows prayers for Barrows", - group = "PVM Prayers", + section = "pvmSection", disabledBy = "showindividualprayers || getpvpprayers || HideRapidHealRestore || getzulrahprayers || getzamorakprayers || getvorkathprayers || getsaradominprayers || getcerberusprayers || getbandosprayers || getarmadylprayers" ) default boolean getbarrowsprayers() @@ -506,11 +540,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 32, + position = 3, keyName = "barrows", name = "Barrows", description = "Shows prayers for Barrows", - group = "PVM Prayers", + section = "pvmSection", hidden = true, unhide = "getbarrowsprayers" ) @@ -520,11 +554,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 33, + position = 4, keyName = "getbandosprayers", name = "enable Bandos Prayers", description = "Shows prayers for Bandos", - group = "PVM Prayers", + section = "pvmSection", disabledBy = "showindividualprayers || getpvpprayers || HideRapidHealRestore || getzulrahprayers || getzamorakprayers || getvorkathprayers || getsaradominprayers || getcerberusprayers || getbarrowsprayers || getarmadylprayers" ) default boolean getbandosprayers() @@ -533,11 +567,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 34, + position = 5, keyName = "bandos", name = "Bandos", description = "Shows prayers for Bandos", - group = "PVM Prayers", + section = "pvmSection", hidden = true, unhide = "getbandosprayers" ) @@ -547,11 +581,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 35, + position = 6, keyName = "getcerberusprayers", name = "enable Cerberus Prayers", description = "Shows prayers for Cerberus", - group = "PVM Prayers", + section = "pvmSection", disabledBy = "showindividualprayers || getpvpprayers || HideRapidHealRestore || getzulrahprayers || getzamorakprayers || getvorkathprayers || getsaradominprayers || getbandosprayers || getbarrowsprayers || getarmadylprayers" ) default boolean getcerberusprayers() @@ -560,11 +594,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 36, + position = 7, keyName = "cerberus", name = "Cerberus", description = "Shows prayers for Cerberus", - group = "PVM Prayers", + section = "pvmSection", hidden = true, unhide = "getcerberusprayers" ) @@ -574,11 +608,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 37, + position = 8, keyName = "getsaradominprayers", name = "enable Saradomin Prayers", description = "Shows prayers for Saradomin", - group = "PVM Prayers", + section = "pvmSection", disabledBy = "showindividualprayers || getpvpprayers || HideRapidHealRestore || getzulrahprayers || getzamorakprayers || getvorkathprayers || getcerberusprayers || getbandosprayers || getbarrowsprayers || getarmadylprayers" ) default boolean getsaradominprayers() @@ -587,11 +621,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 38, + position = 9, keyName = "saradomin", name = "Saradomin", description = "Shows prayers for Saradomin", - group = "PVM Prayers", + section = "pvmSection", hidden = true, unhide = "getsaradominprayers" ) @@ -601,11 +635,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 39, + position = 10, keyName = "getvorkathprayers", name = "enable Vorkath Prayers", description = "Shows prayers for Vorkath", - group = "PVM Prayers", + section = "pvmSection", disabledBy = "showindividualprayers || getpvpprayers || HideRapidHealRestore || getzulrahprayers || getzamorakprayers || getsaradominprayers || getcerberusprayers || getbandosprayers || getbarrowsprayers || getarmadylprayers" ) default boolean getvorkathprayers() @@ -614,11 +648,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 40, + position = 11, keyName = "vorkath", name = "Vorkath", description = "Shows prayers for Vorkath", - group = "PVM Prayers", + section = "pvmSection", hidden = true, unhide = "getvorkathprayers" ) @@ -628,11 +662,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 41, + position = 12, keyName = "getzamorakprayers", name = "enable Zamorak Prayers", description = "Shows prayers for Zamorak", - group = "PVM Prayers", + section = "pvmSection", disabledBy = "showindividualprayers || getpvpprayers || HideRapidHealRestore || getzulrahprayers || getvorkathprayers || getsaradominprayers || getcerberusprayers || getbandosprayers || getbarrowsprayers || getarmadylprayers" ) default boolean getzamorakprayers() @@ -641,11 +675,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 42, + position = 13, keyName = "zamorak", name = "Zamorak", description = "Shows prayers for Zamorak", - group = "PVM Prayers", + section = "pvmSection", hidden = true, unhide = "getzamorakprayers" ) @@ -655,11 +689,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 43, + position = 14, keyName = "getzulrahprayers", name = "enable Zulrah Prayers", description = "Shows prayers for Zulrah", - group = "PVM Prayers", + section = "pvmSection", disabledBy = "showindividualprayers || getpvpprayers || HideRapidHealRestore || getzamorakprayers || getvorkathprayers || getsaradominprayers || getcerberusprayers || getbandosprayers || getbarrowsprayers || getarmadylprayers" ) default boolean getzulrahprayers() @@ -668,11 +702,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 44, + position = 15, keyName = "zulrah", name = "Zulrah", description = "Shows prayers for Zulrah", - group = "PVM Prayers", + section = "pvmSection", hidden = true, unhide = "getzulrahprayers" ) @@ -684,11 +718,11 @@ public interface HidePrayersConfig extends Config // ----------------------------------------------------------- // @ConfigItem( - position = 45, + position = 0, keyName = "getpvpprayers", name = "enable PVP Prayers", description = "Shows prayers based on prayer build", - group = "PVP Prayers", + section = "pvpSection", disabledBy = "showindividualprayers || getzulrahprayers || getzamorakprayers || getvorkathprayers || getsaradominprayers || getcerberusprayers || getbandosprayers || getbarrowsprayers || getarmadylprayers" ) default boolean getpvpprayers() @@ -697,11 +731,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 46, + position = 1, keyName = "pvpprayers", name = "PVP Prayers", description = "Shows prayers based on prayer build", - group = "PVP Prayers", + section = "pvpSection", hidden = true, unhide = "getpvpprayers" ) @@ -711,11 +745,11 @@ public interface HidePrayersConfig extends Config } @ConfigItem( - position = 47, + position = 2, keyName = "HideRapidHealRestore", name = "Hide Rapid Heal and Rapid Restore", description = "Hides the Rapid Heal and Rapid Restore prayers", - group = "PVP Prayers", + section = "pvpSection", hidden = true, unhide = "getpvpprayers" ) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierConfig.java index df04a38727..320a108e49 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierConfig.java @@ -27,6 +27,7 @@ package net.runelite.client.plugins.idlenotifier; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigSection; @ConfigGroup("idlenotifier") public interface IdleNotifierConfig extends Config @@ -85,7 +86,7 @@ public interface IdleNotifierConfig extends Config { return false; } - + @ConfigItem( keyName = "movementidle", name = "Idle Movement Notifications", @@ -240,12 +241,24 @@ public interface IdleNotifierConfig extends Config return false; } + + @ConfigSection( + position = 20, + keyName = "pvpSection", + name = "PvP", + description = "" + ) + default boolean pvpSection() + { + return false; + } + @ConfigItem( keyName = "pkers", name = "PKer Notifier", description = "Notifies if an attackable player based on your level range appears on screen.", - position = 20, - group = "PvP", + position = 21, + section = "pvpSection", warning = "This will not notify you if the player is in your cc or is online on your friends list." ) default boolean notifyPkers() @@ -254,11 +267,11 @@ public interface IdleNotifierConfig extends Config } @ConfigItem( - keyName = "resourceDoor", - name = "Resource Door Notifier", - description = "Notifies if the wilderness resource area door is opened", - position = 21, - group = "PvP" + keyName = "resourceDoor", + name = "Resource Door Notifier", + description = "Notifies if the wilderness resource area door is opened", + position = 22, + section = "pvpSection" ) default boolean notifyResourceDoor() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoConfig.java index 0fbb7e82ce..cd3eba1852 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inferno/InfernoConfig.java @@ -28,27 +28,29 @@ import java.awt.Color; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -import net.runelite.client.config.Stub; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; @ConfigGroup("inferno") public interface InfernoConfig extends Config { - @ConfigItem( - position = 0, + @ConfigTitleSection( keyName = "prayer", + position = 0, name = "Prayer", description = "" ) - default Stub prayer() + default Title prayer() { - return new Stub(); + return new Title(); } @ConfigItem( position = 1, keyName = "Prayer Helper", name = "Prayer Helper", - description = "Indicates the correct prayer" + description = "Indicates the correct prayer", + titleSection = "prayer" ) default boolean showPrayerHelp() { @@ -59,7 +61,8 @@ public interface InfernoConfig extends Config position = 2, keyName = "prayerHelperMode", name = "Prayer Helper Mode", - description = "Display prayer indicator in the prayer tab or in the bottom right corner of the screen" + description = "Display prayer indicator in the prayer tab or in the bottom right corner of the screen", + titleSection = "prayer" ) default InfernoPrayerOverlayMode prayerOverlayMode() { @@ -70,7 +73,8 @@ public interface InfernoConfig extends Config position = 3, keyName = "descendingBoxes", name = "Descending Boxes", - description = "Draws timing boxes above the prayer icons, as if you were playing Piano Tiles" + description = "Draws timing boxes above the prayer icons, as if you were playing Piano Tiles", + titleSection = "prayer" ) default boolean descendingBoxes() { @@ -81,29 +85,31 @@ public interface InfernoConfig extends Config position = 4, keyName = "indicateWhenPrayingCorrectly", name = "Indicate When Praying Correctly", - description = "Indicate the correct prayer, even if you are already praying that prayer" + description = "Indicate the correct prayer, even if you are already praying that prayer", + titleSection = "prayer" ) default boolean indicateWhenPrayingCorrectly() { return false; } - @ConfigItem( - position = 5, + @ConfigTitleSection( keyName = "monsters", + position = 5, name = "Monsters", description = "" ) - default Stub monsters() + default Title monsters() { - return new Stub(); + return new Title(); } @ConfigItem( position = 6, keyName = "Nibbler Overlay", name = "Nibbler Overlay", - description = "Shows if there are any Nibblers left" + description = "Shows if there are any Nibblers left", + titleSection = "monsters" ) default boolean displayNibblerOverlay() { @@ -114,29 +120,31 @@ public interface InfernoConfig extends Config position = 7, keyName = "indicateActiveHealers", name = "Indicate Active Healers", - description = "Indicate healers that are still healing Jad" + description = "Indicate healers that are still healing Jad", + titleSection = "monsters" ) default boolean indicateActiveHealers() { return true; } - @ConfigItem( - position = 8, + @ConfigTitleSection( keyName = "waves", + position = 8, name = "Waves", description = "" ) - default Stub waves() + default Title waves() { - return new Stub(); + return new Title(); } @ConfigItem( position = 9, keyName = "waveDisplay", name = "Wave display", - description = "Shows monsters that will spawn on the selected wave(s)." + description = "Shows monsters that will spawn on the selected wave(s).", + titleSection = "waves" ) default InfernoWaveDisplayMode waveDisplay() { @@ -147,7 +155,8 @@ public interface InfernoConfig extends Config position = 10, keyName = "getWaveOverlayHeaderColor", name = "Wave Header", - description = "Color for Wave Header" + description = "Color for Wave Header", + titleSection = "waves" ) default Color getWaveOverlayHeaderColor() { @@ -158,7 +167,8 @@ public interface InfernoConfig extends Config position = 11, keyName = "getWaveTextColor", name = "Wave Text Color", - description = "Color for Wave Texts" + description = "Color for Wave Texts", + titleSection = "waves" ) default Color getWaveTextColor() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/lootingbagviewer/LootingBagViewerConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/lootingbagviewer/LootingBagViewerConfig.java index 6f216c47df..eb9d3e13a0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/lootingbagviewer/LootingBagViewerConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/lootingbagviewer/LootingBagViewerConfig.java @@ -27,28 +27,29 @@ package net.runelite.client.plugins.lootingbagviewer; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -import net.runelite.client.config.Stub; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; @ConfigGroup("lootingbagviewer") public interface LootingBagViewerConfig extends Config { - @ConfigItem( - keyName = "overlayStub", - name = "Overlays", - description = "", - position = 0 + @ConfigTitleSection( + keyName = "overlayTitle", + name = "Overlays", + description = "", + position = 0 ) - default Stub overlayStub() + default Title overlayTitle() { - return new Stub(); + return new Title(); } @ConfigItem( - keyName = "renderViewer", - name = "Render Viewer", - description = "Shows second inventory on screen with looting bag items.", - position = 1, - parent = "overlayStub" + keyName = "renderViewer", + name = "Render Viewer", + description = "Shows second inventory on screen with looting bag items.", + position = 1, + titleSection = "overlayTitle" ) default boolean renderViewer() { @@ -56,11 +57,11 @@ public interface LootingBagViewerConfig extends Config } @ConfigItem( - keyName = "renderLootingBag", - name = "Render Looting Bag Worth", - description = "Shows current amount of GP over the looting bag.", - position = 2, - parent = "overlayStub" + keyName = "renderLootingBag", + name = "Render Looting Bag Worth", + description = "Shows current amount of GP over the looting bag.", + position = 2, + titleSection = "overlayTitle" ) default boolean renderLootingBag() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java index c8761c7169..5825a227f9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java @@ -28,16 +28,28 @@ package net.runelite.client.plugins.loottracker; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigSection; @ConfigGroup("loottracker") public interface LootTrackerConfig extends Config { + @ConfigSection( + position = 1, + keyName = "filterSection", + name = "Filter", + description = "" + ) + default boolean filterSection() + { + return false; + } + @ConfigItem( keyName = "ignoredItems", name = "Ignored items", description = "Configures which items should be ignored when calculating loot prices.", position = 0, - group = "Filters" + section = "filterSection" ) default String getIgnoredItems() { @@ -56,7 +68,7 @@ public interface LootTrackerConfig extends Config name = "Ignored NPCs", description = "Configures which NPCs should be ignored ", position = 1, - group = "Filters" + section = "filterSection" ) default String getIgnoredNPCs() { @@ -128,7 +140,7 @@ public interface LootTrackerConfig extends Config name = "NPC Whitelist", description = "Only track drops from specific NPCs", position = 1, - group = "Filters", + section = "filterSection", disabledBy = "blacklistEnabled" ) default boolean whitelistEnabled() @@ -141,7 +153,7 @@ public interface LootTrackerConfig extends Config name = "Whitelist", description = "Comma-separated list of NPCs to track drops from", position = 2, - group = "Filters", + section = "filterSection", hidden = true, unhide = "whitelistEnabled" ) @@ -155,7 +167,7 @@ public interface LootTrackerConfig extends Config name = "NPC Blacklist", description = "Track drops from all NPCs except for specified ones", position = 3, - group = "Filters", + section = "filterSection", disabledBy = "whitelistEnabled" ) default boolean blacklistEnabled() @@ -168,7 +180,7 @@ public interface LootTrackerConfig extends Config name = "Blacklist", description = "Comma-separated list of NPCs to not track drops from", position = 4, - group = "Filters", + section = "filterSection", hidden = true, unhide = "blacklistEnabled" ) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java index 493c1daefb..bffece530f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java @@ -30,6 +30,7 @@ package net.runelite.client.plugins.menuentryswapper; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigSection; import net.runelite.client.config.Keybind; import net.runelite.client.plugins.menuentryswapper.util.BurningAmuletMode; import net.runelite.client.plugins.menuentryswapper.util.CharterOption; @@ -58,6 +59,116 @@ import net.runelite.client.plugins.menuentryswapper.util.XericsTalismanMode; @ConfigGroup("menuentryswapper") public interface MenuEntrySwapperConfig extends Config { + @ConfigSection( + name = "Banking", + description = "", + position = 0, + keyName = "bankingSection" + ) + default boolean bankingSection() + { + return false; + } + + @ConfigSection( + name = "Equipment Swapper", + description = "", + position = 1, + keyName = "equipmentSwapperSection" + ) + default boolean equipmentSwapperSection() + { + return false; + } + + @ConfigSection( + name = "Miscellaneous", + description = "", + position = 1, + keyName = "miscellaneousSection" + ) + default boolean miscellaneousSection() + { + return false; + } + + @ConfigSection( + name = "Shop / Stores", + description = "", + position = 1, + keyName = "shopStoresSection" + ) + default boolean shopStoresSection() + { + return false; + } + + @ConfigSection( + name = "Skilling", + description = "", + position = 1, + keyName = "skillingSection" + ) + default boolean skillingSection() + { + return false; + } + + @ConfigSection( + name = "Talk-To", + description = "", + position = 1, + keyName = "talkSection" + ) + default boolean talkSection() + { + return false; + } + + @ConfigSection( + name = "Teleportation", + description = "", + position = 1, + keyName = "teleportationSection" + ) + default boolean teleportationSection() + { + return false; + } + + @ConfigSection( + name = "Right Click Options", + description = "", + position = 1, + keyName = "rightClickOptionsSection" + ) + default boolean rightClickOptionsSection() + { + return false; + } + + @ConfigSection( + name = "Untradeables", + description = "", + position = 1, + keyName = "untradeablesSection" + ) + default boolean untradeablesSection() + { + return false; + } + + @ConfigSection( + name = "PvM", + description = "", + position = 1, + keyName = "pvmSection" + ) + default boolean pvmSection() + { + return false; + } + //------------------------------------------------------------// // Banking //------------------------------------------------------------// @@ -67,7 +178,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Withdraw/Deposit One", description = "", position = 0, - group = "Banking" + section = "bankingSection" ) default boolean getWithdrawOne() { @@ -79,7 +190,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", position = 1, - group = "Banking", + section = "bankingSection", hidden = true, unhide = "withdrawOne" ) @@ -93,7 +204,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Withdraw/Deposit Five", description = "", position = 2, - group = "Banking" + section = "bankingSection" ) default boolean getWithdrawFive() { @@ -105,7 +216,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", position = 3, - group = "Banking", + section = "bankingSection", hidden = true, unhide = "withdrawFive" ) @@ -119,7 +230,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Withdraw/Deposit Ten", description = "", position = 4, - group = "Banking" + section = "bankingSection" ) default boolean getWithdrawTen() { @@ -131,7 +242,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", position = 5, - group = "Banking", + section = "bankingSection", hidden = true, unhide = "withdrawTen" ) @@ -145,7 +256,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Withdraw/Deposit X", description = "", position = 6, - group = "Banking" + section = "bankingSection" ) default boolean getWithdrawX() { @@ -157,7 +268,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Amount", description = "", position = 7, - group = "Banking", + section = "bankingSection", hidden = true, unhide = "withdrawX" ) @@ -171,7 +282,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", position = 8, - group = "Banking", + section = "bankingSection", hidden = true, unhide = "withdrawX" ) @@ -185,7 +296,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Withdraw/Deposit All", description = "", position = 9, - group = "Banking" + section = "bankingSection" ) default boolean getWithdrawAll() { @@ -197,7 +308,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", position = 10, - group = "Banking", + section = "bankingSection", hidden = true, unhide = "withdrawAll" ) @@ -215,7 +326,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Max Cape", description = "Enables swapping max cape options in worn interface.", position = 0, - group = "Equipment swapper" + section = "equipmentSwapperSection" ) default boolean swapMax() { @@ -227,7 +338,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 1, - group = "Equipment swapper", + section = "equipmentSwapperSection", hidden = true, unhide = "swapMax" ) @@ -241,7 +352,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Ardougne Cape", description = "Enables swapping of 'Teleport' and 'Wear'.", position = 2, - group = "Equipment swapper" + section = "equipmentSwapperSection" ) default boolean getSwapArdougneCape() { @@ -253,7 +364,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Construction Cape", description = "Enables swapping of 'Teleport' and 'Wear'.", position = 3, - group = "Equipment swapper" + section = "equipmentSwapperSection" ) default boolean getSwapConstructionCape() { @@ -265,7 +376,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 4, - group = "Equipment swapper", + section = "equipmentSwapperSection", hidden = true, unhide = "swapConstructionCape" ) @@ -279,7 +390,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Crafting Cape", description = "Enables swapping of 'Teleport' and 'Wear'.", position = 5, - group = "Equipment swapper" + section = "equipmentSwapperSection" ) default boolean getSwapCraftingCape() { @@ -291,7 +402,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Magic Cape", description = "Enables swapping of 'Spellbook' and 'Wear'.", position = 6, - group = "Equipment swapper" + section = "equipmentSwapperSection" ) default boolean getSwapMagicCape() { @@ -303,7 +414,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Explorer's Ring", description = "Enables swapping of 'Spellbook' and 'Wear'.", position = 7, - group = "Equipment swapper" + section = "equipmentSwapperSection" ) default boolean getSwapExplorersRing() { @@ -315,7 +426,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Admire", description = "Swap 'Admire' with 'Teleport', 'Spellbook' and 'Perks' (max cape) for mounted skill capes.", position = 8, - group = "Equipment swapper" + section = "equipmentSwapperSection" ) default boolean swapAdmire() { @@ -327,7 +438,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Quest Cape", description = "Enables swapping Quest cape options in worn interface.", position = 9, - group = "Equipment swapper" + section = "equipmentSwapperSection" ) default boolean swapQuestCape() { @@ -339,7 +450,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 10, - group = "Equipment swapper", + section = "equipmentSwapperSection", hidden = true, unhide = "swapQuestCape" ) @@ -357,7 +468,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Hotkey for Swaps", description = "Set this hotkey to do custom swaps on hotkeys.", position = 0, - group = "Miscellaneous" + section = "miscellaneousSection" ) default Keybind hotkeyMod() { @@ -370,7 +481,7 @@ public interface MenuEntrySwapperConfig extends Config description = "Add custom swaps here, 1 per line. Syntax: option,target:priority" + "
Note that the higher your set the priority, the more it will overtake over swaps.", position = 1, - group = "Miscellaneous", + section = "miscellaneousSection", parse = true, clazz = CustomSwapParse.class, method = "parse" @@ -387,7 +498,7 @@ public interface MenuEntrySwapperConfig extends Config "
1 per line. Syntax: option,target:priority" + "
Note that the higher your set the priority, the more it will overtake over swaps.", position = 2, - group = "Miscellaneous", + section = "miscellaneousSection", parse = true, clazz = CustomSwapParse.class, method = "parse" @@ -406,7 +517,7 @@ public interface MenuEntrySwapperConfig extends Config "
Example Syntax: follow, friendsnamehere" + "
It's important to note that these will not take precedent over other swaps.", position = 2, - group = "Miscellaneous", + section = "miscellaneousSection", parse = true, clazz = PrioParse.class, method = "parse" @@ -421,7 +532,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Coal Bag", description = "Makes Empty the left click option when in a bank", position = 3, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapCoalBag() { @@ -433,7 +544,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Birdhouse", description = "Swap 'Interact' with 'Empty' for birdhouses on Fossil Island.", position = 4, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapBirdhouseEmpty() { @@ -445,7 +556,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Bury", description = "Swap 'Bury' with 'Use' on Bones.", position = 5, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapBones() { @@ -457,7 +568,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Chase", description = "Allows to left click your cat to chase rats.", position = 6, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapChase() { @@ -469,7 +580,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Harpoon", description = "Swap 'Cage', 'Big Net' with 'Harpoon' on Fishing spots.", position = 7, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapHarpoon() { @@ -481,7 +592,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Occult Altar", description = "Swap 'Venerate' with 'Ancient', 'Lunar', or 'Arceuus' on an Altar of the Occult.", position = 8, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapOccult() { @@ -493,7 +604,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 9, - group = "Miscellaneous", + section = "miscellaneousSection", hidden = true, unhide = "swapOccult" ) @@ -507,7 +618,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Home", description = "Swap 'Enter' with 'Home', 'Build' or 'Friend's house' on Portal.", position = 10, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapHomePortal() { @@ -519,7 +630,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 11, - group = "Miscellaneous", + section = "miscellaneousSection", hidden = true, unhide = "swapHomePortal" ) @@ -533,7 +644,7 @@ public interface MenuEntrySwapperConfig extends Config name = "House Ad", description = "Swap your house advertisement entries.", position = 12, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapHouseAd() { @@ -545,7 +656,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 13, - group = "Miscellaneous", + section = "miscellaneousSection", hidden = true, unhide = "swapHouseAd" ) @@ -558,8 +669,8 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapPrivate", name = "Private", description = "Swap 'Shared' with 'Private' on the Chambers of Xeric storage units.", - position = 14, - group = "Miscellaneous" + position = 15, + section = "miscellaneousSection" ) default boolean swapPrivate() { @@ -571,7 +682,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Pick", description = "Swap 'Pick' with 'Pick-lots' of the Gourd tree in the Chambers of Xeric.", position = 15, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapPick() { @@ -583,7 +694,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Quick Pass/Open/Start/Travel", description = "Swap 'Pass' with 'Quick-Pass', 'Open' with 'Quick-Open', 'Ring' with 'Quick-Start' and 'Talk-to' with 'Quick-Travel'.", position = 16, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapQuick() { @@ -595,7 +706,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Reset", description = "Swap 'Check' with 'Reset' on box traps.", position = 17, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapBoxTrap() { @@ -607,7 +718,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Rock Cake Guzzle", description = "Enables Left Click 'Guzzle' on the Dwarven Rock Cake.", position = 18, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean rockCake() { @@ -619,7 +730,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Rogues Chests", description = "Swap Rogues Chests from 'Open' to 'Search for traps'.", position = 19, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapRogueschests() { @@ -631,7 +742,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Climb", description = "Swap 'Climb-Up'/'Climb-Down' depending on Shift or Control key.", position = 20, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapClimbUpDown() { @@ -643,7 +754,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Stun Hoop Snakes", description = "Swap 'Attack' with 'Stun'.", position = 21, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapStun() { @@ -655,7 +766,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Search", description = "Swap 'Close', 'Shut' with 'Search' on chests, cupboards, etc.", position = 22, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapSearch() { @@ -667,7 +778,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Hardwood Grove", description = "Swap 'Quick-Pay(100)' and 'Send-Parcel' at Hardwood Grove.", position = 23, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapHardWoodGrove() { @@ -680,7 +791,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Remove Objects", description = "Removes interaction with the listed objects.", position = 24, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean getRemoveObjects() { @@ -692,7 +803,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Objects", description = "Objects listed here will have all interaction be removed.", position = 25, - group = "Miscellaneous", + section = "miscellaneousSection", hidden = true, unhide = "removeObjects" ) @@ -706,7 +817,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Impling Jars", description = "Don't open implings if bank has a clue.", position = 26, - group = "Miscellaneous" + section = "miscellaneousSection" ) default boolean swapImps() { @@ -718,7 +829,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Trader Crew", description = "Configure whether you want Charter or Trade to be the first option of Trader Crewmembers.", position = 27, - group = "Miscellaneous" + section = "miscellaneousSection" ) default CharterOption charterOption() { @@ -734,7 +845,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Buy One", description = "", position = 0, - group = "Shop / stores" + section = "shopStoresSection" ) default boolean getSwapBuyOne() { @@ -745,7 +856,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "buyOneItems", name = "Items", description = "", - group = "Shop / stores", + section = "shopStoresSection", position = 1, hidden = true, unhide = "swapBuyOne" @@ -760,7 +871,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Buy Five", description = "", position = 2, - group = "Shop / stores" + section = "shopStoresSection" ) default boolean getSwapBuyFive() { @@ -772,7 +883,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", position = 3, - group = "Shop / stores", + section = "shopStoresSection", hidden = true, unhide = "swapBuyFive" ) @@ -786,7 +897,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Buy Ten", description = "", position = 4, - group = "Shop / stores" + section = "shopStoresSection" ) default boolean getSwapBuyTen() { @@ -798,7 +909,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", position = 5, - group = "Shop / stores", + section = "shopStoresSection", hidden = true, unhide = "swapBuyTen" ) @@ -812,7 +923,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Buy Fifty", description = "", position = 6, - group = "Shop / stores" + section = "shopStoresSection" ) default boolean getSwapBuyFifty() { @@ -824,7 +935,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", position = 7, - group = "Shop / stores", + section = "shopStoresSection", hidden = true, unhide = "swapBuyFifty" ) @@ -838,7 +949,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Sell One", description = "", position = 8, - group = "Shop / stores" + section = "shopStoresSection" ) default boolean getSwapSellOne() { @@ -850,7 +961,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", position = 9, - group = "Shop / stores", + section = "shopStoresSection", hidden = true, unhide = "swapSellOne" ) @@ -864,7 +975,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Sell Five", description = "", position = 10, - group = "Shop / stores" + section = "shopStoresSection" ) default boolean getSwapSellFive() { @@ -876,7 +987,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", position = 11, - group = "Shop / stores", + section = "shopStoresSection", hidden = true, unhide = "swapSellFive" ) @@ -890,7 +1001,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Sell Ten", description = "", position = 12, - group = "Shop / stores" + section = "shopStoresSection" ) default boolean getSwapSellTen() { @@ -902,7 +1013,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", position = 13, - group = "Shop / stores", + section = "shopStoresSection", hidden = true, unhide = "swapSellTen" ) @@ -916,7 +1027,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Sell Fifty", description = "", position = 14, - group = "Shop / stores" + section = "shopStoresSection" ) default boolean getSwapSellFifty() { @@ -928,7 +1039,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", position = 15, - group = "Shop / stores", + section = "shopStoresSection", hidden = true, unhide = "swapSellFifty" ) @@ -946,7 +1057,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Easy Construction", description = "Makes 'Remove'/'Build' the default option for listed items.", position = 0, - group = "Skilling" + section = "skillingSection" ) default boolean getEasyConstruction() { @@ -958,7 +1069,7 @@ public interface MenuEntrySwapperConfig extends Config name = "EZ Construction Type", description = "", position = 1, - group = "Skilling", + section = "skillingSection", hidden = true, unhide = "getEasyConstruction" ) @@ -972,7 +1083,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Tanning", description = "Enables swapping of 'Tan-1' and 'Tan-all' options.", position = 2, - group = "Skilling" + section = "skillingSection" ) default boolean getSwapTanning() { @@ -984,7 +1095,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Sawmill Operator", description = "Makes 'Buy-plank' the default option on the Sawmill Operator.", position = 3, - group = "Skilling" + section = "skillingSection" ) default boolean getSwapSawmill() { @@ -996,7 +1107,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Buy Planks", description = "Makes 'Buy All' the default option when buying planks.", position = 4, - group = "Skilling" + section = "skillingSection" ) default boolean getSwapSawmillPlanks() { @@ -1008,7 +1119,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Puro-Puro Wheat", description = "", position = 5, - group = "Skilling" + section = "skillingSection" ) default boolean getSwapPuro() { @@ -1024,7 +1135,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Assignment", description = "Swap 'Talk-to' with 'Assignment' for Slayer Masters. This will take priority over swapping Trade.", position = 0, - group = "Talk-To" + section = "talkSection" ) default boolean swapAssignment() { @@ -1036,7 +1147,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Bank/Exchange", description = "Swap Talk-to with Bank or Exchange on NPC
Example: Banker, Grand Exchange Clerk, Tool Leprechaun, Void Knight", position = 1, - group = "Talk-To" + section = "talkSection" ) default boolean swapBankExchange() { @@ -1048,7 +1159,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Contract", description = "Swap 'Talk-to' with 'Contract' on Guildmaster Jane.", position = 2, - group = "Talk-To" + section = "talkSection" ) default boolean swapContract() { @@ -1061,7 +1172,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Interact", description = "Swap options for generic interactions on NPCs
Example: Decant for Bob Barter, Repairs for Dark Mage, Claim Slime for Robin, Claim Dynamite", position = 3, - group = "Talk-To" + section = "talkSection" ) default boolean swapInteract() { @@ -1073,7 +1184,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Pickpocket", description = "Swap Talk-to with Pickpocket on NPC
Example: Man, Woman", position = 4, - group = "Talk-To" + section = "talkSection" ) default boolean swapPickpocket() { @@ -1085,7 +1196,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Pay", description = "Swap 'Talk-to' with 'Pay' on various NPCs.
Example: Elstan, Heskel, Fayeth.", position = 5, - group = "Talk-To" + section = "talkSection" ) default boolean swapPay() { @@ -1097,7 +1208,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Teleport to Abyss", description = "Swap 'Talk-to' with 'Teleport' for the Mage of Zamorak.", position = 6, - group = "Talk-To" + section = "talkSection" ) default boolean swapAbyssTeleport() { @@ -1109,7 +1220,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Trade", description = "Swap 'Talk-to' with 'Trade' on various NPCs.
Example: Shop keeper, Shop assistant.", position = 7, - group = "Talk-To" + section = "talkSection" ) default boolean swapTrade() { @@ -1121,7 +1232,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Travel", description = "Swap 'Talk-to' with 'Travel', 'Take-boat', 'Pay-fare', 'Charter' on various NPCs.
Example: Squire, Monk of Entrana, Customs officer, Trader Crewmember.", position = 8, - group = "Talk-To" + section = "talkSection" ) default boolean swapTravel() { @@ -1133,7 +1244,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Minigames", description = "Swap Talk-to with Start-Minigame, Story, Dream on NPC
Example: Guardian mummy, Juna, Dominic Onion", position = 9, - group = "Talk-To" + section = "talkSection" ) default boolean swapMinigame() { @@ -1145,7 +1256,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Buy Planks", description = "Swap 'Talk-to' with 'Buy-planks' at the Lumber Yard.", position = 10, - group = "Talk-To" + section = "talkSection" ) default boolean swapPlank() { @@ -1157,7 +1268,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Metamorphosis", description = "Swap 'Talk-to' with 'Metamorphosis' for Baby Chinchompa pet.", position = 11, - group = "Talk-To" + section = "talkSection" ) default boolean swapMetamorphosis() { @@ -1169,7 +1280,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Enchant", description = "Swap Talk-to with Enchant for Eluned", position = 12, - group = "Talk-To" + section = "talkSection" ) default boolean swapEnchant() { @@ -1185,7 +1296,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Fairy Ring", description = "Swap 'Zanaris' with 'Last-destination' or 'Configure' on Fairy rings.", position = 0, - group = "Teleportation" + section = "teleportationSection" ) default boolean swapFairyRing() { @@ -1197,7 +1308,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 1, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapFairyRing" ) @@ -1211,7 +1322,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Fairy Tree", description = "Swap options on PoH Fairy Tree", position = 2, - group = "Teleportation" + section = "teleportationSection" ) default boolean swapFairyTree() { @@ -1223,7 +1334,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 3, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapFairyTree" ) @@ -1237,7 +1348,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Obelisk", description = "Swap the options on wilderness obelisks between 'Activate', 'Set destination' or 'Teleport to destination'.", position = 4, - group = "Teleportation" + section = "teleportationSection" ) default boolean swapObelisk() { @@ -1249,7 +1360,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 5, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapObelisk" ) @@ -1263,7 +1374,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Teleport Items", description = "Swap 'Wear' or 'Wield' with 'Rub' or 'Teleport' on teleport items.
Example: Amulet of glory, Explorer's ring, Chronicle.", position = 6, - group = "Teleportation" + section = "teleportationSection" ) default boolean swapTeleportItem() { @@ -1275,7 +1386,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Wilderness Lever", description = "Swap the wilderness lever left click to be Edgeville/Ardougne.", position = 7, - group = "Teleportation" + section = "teleportationSection" ) default boolean swapWildernessLever() { @@ -1287,7 +1398,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Portal Nexus", description = "Makes the teleport menu have priority over the left click destination on the portal nexus.", position = 8, - group = "Teleportation" + section = "teleportationSection" ) default boolean swapNexus() { @@ -1299,7 +1410,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Games Necklace", description = "Swap the left click 'remove' option with the desired teleport location on a worn Games Necklace.", position = 9, - group = "Teleportation" + section = "teleportationSection" ) default boolean getGamesNecklace() { @@ -1311,7 +1422,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 10, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapGamesNecklace" ) @@ -1325,7 +1436,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Dueling Ring", description = "Swap the left click 'remove' option with the desired teleport location on a worn Ring of Dueling.", position = 11, - group = "Teleportation" + section = "teleportationSection" ) default boolean getDuelingRing() { @@ -1337,7 +1448,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 12, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapDuelingRing" ) @@ -1351,7 +1462,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Glory", description = "Swap the left click 'remove' option with the desired teleport location on a worn Amulet of Glory / Amulet of Eternal Glory.", position = 13, - group = "Teleportation" + section = "teleportationSection" ) default boolean getGlory() { @@ -1363,7 +1474,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 14, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapGlory" ) @@ -1377,7 +1488,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Skills Necklace", description = "Swap the left click 'remove' option with the desired teleport location on a worn Skills Necklace.", position = 15, - group = "Teleportation" + section = "teleportationSection" ) default boolean getSkillsNecklace() { @@ -1389,7 +1500,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 16, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapSkill" ) @@ -1403,7 +1514,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Passage Necklace", description = "Swap the left click 'remove' option with the desired teleport location on a worn Necklace of Passage.", position = 17, - group = "Teleportation" + section = "teleportationSection" ) default boolean getNecklaceofPassage() { @@ -1415,7 +1526,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 18, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapPassage" ) @@ -1429,7 +1540,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Digsite Pendant", description = "Swap the left click 'remove' option with the desired teleport location on a worn Digsite Pendant.", position = 19, - group = "Teleportation" + section = "teleportationSection" ) default boolean getDigsitePendant() { @@ -1441,7 +1552,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 20, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapDigsite" ) @@ -1455,7 +1566,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Combat Bracelet", description = "Swap the left click 'remove' option with the desired teleport location on a worn Combat Bracelet.", position = 21, - group = "Teleportation" + section = "teleportationSection" ) default boolean getCombatBracelet() { @@ -1467,7 +1578,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 22, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapCombat" ) @@ -1481,7 +1592,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Burning Amulet", description = "Swap the left click 'remove' option with the desired teleport location on a worn Burning Amulet.", position = 23, - group = "Teleportation" + section = "teleportationSection" ) default boolean getBurningAmulet() { @@ -1493,7 +1604,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 24, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapburning" ) @@ -1507,7 +1618,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Xeric's Talisman", description = "Swap the left click 'remove' option with the desired teleport location on a worn Xeric's Talisman.", position = 25, - group = "Teleportation" + section = "teleportationSection" ) default boolean getXericsTalisman() { @@ -1519,7 +1630,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 26, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapxeric" ) @@ -1533,7 +1644,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Ring of Wealth", description = "Swap the left click 'remove' option with the desired teleport location on a worn Ring of Wealth.", position = 27, - group = "Teleportation" + section = "teleportationSection" ) default boolean getRingofWealth() { @@ -1545,7 +1656,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 28, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapwealth" ) @@ -1559,7 +1670,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Slayer Ring", description = "", position = 29, - group = "Teleportation" + section = "teleportationSection" ) default boolean getSlayerRing() { @@ -1571,7 +1682,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Mode", description = "", position = 30, - group = "Teleportation", + section = "teleportationSection", hidden = true, unhide = "swapslayer" ) @@ -1589,7 +1700,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Examine", description = "Hides the 'Examine' option from the right click menu.", position = 0, - group = "Hide Right Click Options" + section = "rightClickOptionsSection" ) default boolean hideExamine() { @@ -1601,7 +1712,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Trade With", description = "Hides the 'Trade with' option from the right click menu.", position = 1, - group = "Hide Right Click Options" + section = "rightClickOptionsSection" ) default boolean hideTradeWith() { @@ -1613,7 +1724,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Report", description = "Hides the 'Report' option from the right click menu.", position = 2, - group = "Hide Right Click Options" + section = "rightClickOptionsSection" ) default boolean hideReport() { @@ -1625,7 +1736,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Lookup", description = "Hides the 'Lookup' option from the right click menu.", position = 3, - group = "Hide Right Click Options" + section = "rightClickOptionsSection" ) default boolean hideLookup() { @@ -1637,7 +1748,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Net", description = "Hides the 'Net' option from the right click menu.", position = 4, - group = "Hide Right Click Options" + section = "rightClickOptionsSection" ) default boolean hideNet() { @@ -1649,7 +1760,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Bait", description = "Hides the 'Bait' option from the right click menu.", position = 5, - group = "Hide Right Click Options" + section = "rightClickOptionsSection" ) default boolean hideBait() { @@ -1665,7 +1776,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Destroy on Rune Pouch", description = "Hides the 'Destroy' option when right clicking a Rune pouch.", position = 0, - group = "Hide Untradeable Options" + section = "untradeablesSection" ) default boolean hideDestroyRunepouch() { @@ -1677,7 +1788,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Destroy on Coal bag", description = "Hides the 'Destroy' option when right clicking a Coal bag.", position = 1, - group = "Hide Untradeable Options" + section = "untradeablesSection" ) default boolean hideDestroyCoalbag() { @@ -1689,7 +1800,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Destroy on Herb sack", description = "Hides the 'Destroy' option when right clicking a Herb sack.", position = 2, - group = "Hide Untradeable Options" + section = "untradeablesSection" ) default boolean hideDestroyHerbsack() { @@ -1701,7 +1812,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Destroy on Bolt pouch", description = "Hides the 'Destroy' option when right clicking a Bolt pouch.", position = 3, - group = "Hide Untradeable Options" + section = "untradeablesSection" ) default boolean hideDestroyBoltpouch() { @@ -1713,7 +1824,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Destroy on Gem bag", description = "Hides the 'Destroy' option when right clicking a Gem bag.", position = 4, - group = "Hide Untradeable Options" + section = "untradeablesSection" ) default boolean hideDestroyGembag() { @@ -1725,7 +1836,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Destroy on Looting bag", description = "Hides the 'Destroy' option when right clicking a Looting bag.", position = 5, - group = "Hide Untradeable Options" + section = "untradeablesSection" ) default boolean hideDestroyLootingBag() { @@ -1737,7 +1848,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Drop on RC pouches", description = "Hides the 'Drop' option when right clicking a Small, Medium, Large, or Giant pouch.", position = 6, - group = "Hide Untradeable Options" + section = "untradeablesSection" ) default boolean hideDropRunecraftingPouch() { @@ -1753,7 +1864,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Hide cast in ToB", description = "Hides the cast option for clanmates and friends in ToB", position = 0, - group = "PVM" + section = "pvmSection" ) default boolean hideCastToB() @@ -1766,7 +1877,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Ignored spells", description = "Spells that should not be hidden from being cast, separated by a comma", position = 1, - group = "PVM", + section = "pvmSection", hidden = true, unhide = "hideCastToB" ) @@ -1780,7 +1891,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Hide cast in CoX", description = "Hides the cast option for clanmates and friends in CoX", position = 2, - group = "PVM" + section = "pvmSection" ) default boolean hideCastCoX() @@ -1793,7 +1904,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Ignored spells", description = "Spells that should not be hidden from being cast, separated by a comma", position = 3, - group = "PVM", + section = "pvmSection", hidden = true, unhide = "hideCastCoX" ) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsConfig.java index 5e57404903..5e363d7895 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsConfig.java @@ -30,21 +30,22 @@ import java.awt.Color; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigTitleSection; import net.runelite.client.config.Range; -import net.runelite.client.config.Stub; +import net.runelite.client.config.Title; @ConfigGroup("objectindicators") public interface ObjectIndicatorsConfig extends Config { - @ConfigItem( - keyName = "overlayStub", + @ConfigTitleSection( + keyName = "overlayTitle", name = "Overlay Style", description = "", position = 0 ) - default Stub overlayStub() + default Title overlayTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -52,7 +53,7 @@ public interface ObjectIndicatorsConfig extends Config keyName = "objectMarkerRenderStyle", name = "Highlight Style", description = "Highlight setting", - parent = "overlayStub" + titleSection = "overlayTitle" ) default RenderStyle objectMarkerRenderStyle() { @@ -65,7 +66,7 @@ public interface ObjectIndicatorsConfig extends Config keyName = "objectMarkerOutlineRenderStyle", name = "Outline Style", description = "Highlight outline setting", - parent = "overlayStub", + titleSection = "overlayTitle", hidden = true, unhide = "objectMarkerRenderStyle", unhideValue = "OUTLINE" @@ -75,15 +76,15 @@ public interface ObjectIndicatorsConfig extends Config return OutlineRenderStyle.NORMAL_OUTLINE; } - @ConfigItem( - keyName = "colorStub", + @ConfigTitleSection( + keyName = "colorTitle", name = "Colors", description = "", position = 3 ) - default Stub colorStub() + default Title colorTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -91,7 +92,7 @@ public interface ObjectIndicatorsConfig extends Config keyName = "markerColor", name = "Marker color", description = "Configures the outer color of object marker", - parent = "colorStub" + titleSection = "colorTitle" ) default Color objectMarkerColor() { @@ -106,7 +107,7 @@ public interface ObjectIndicatorsConfig extends Config keyName = "objectMarkerAlpha", name = "Alpha", description = "Configures the opacity/alpha of object marker", - parent = "colorStub" + titleSection = "colorTitle" ) default int objectMarkerAlpha() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsConfig.java index af35be900e..c3434ff880 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pileindicators/PileIndicatorsConfig.java @@ -28,21 +28,22 @@ import java.awt.Color; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigTitleSection; import net.runelite.client.config.Range; -import net.runelite.client.config.Stub; +import net.runelite.client.config.Title; @ConfigGroup("pileindicators") public interface PileIndicatorsConfig extends Config { - @ConfigItem( - keyName = "playerPilesStub", + @ConfigTitleSection( + keyName = "playerPilesTitle", name = "Player Piles", description = "", position = 0 ) - default Stub playerPilesStub() + default Title playerPilesTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -50,7 +51,7 @@ public interface PileIndicatorsConfig extends Config keyName = "enablePlayers", name = "Enable Player Piling", description = "Enable the option to highlight players when they pile.", - parent = "playerPilesStub" + titleSection = "playerPilesTitle" ) default boolean enablePlayers() { @@ -62,7 +63,7 @@ public interface PileIndicatorsConfig extends Config keyName = "wildyOnlyPlayer", name = "Wilderness Only", description = "Show player piling only when in the Wilderness.", - parent = "playerPilesStub" + titleSection = "playerPilesTitle" ) default boolean wildyOnlyPlayer() { @@ -74,22 +75,22 @@ public interface PileIndicatorsConfig extends Config keyName = "playerPileColor", name = "Player Pile Color", description = "Color used for player piles.", - parent = "playerPilesStub" + titleSection = "playerPilesTitle" ) default Color playerPileColor() { return Color.RED; } - @ConfigItem( - keyName = "npcPilesStub", + @ConfigTitleSection( + keyName = "npcPilesTitle", name = "NPC Piles", description = "", position = 4 ) - default Stub npcPilesStub() + default Title npcPilesTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -97,7 +98,7 @@ public interface PileIndicatorsConfig extends Config keyName = "enableNPCS", name = "Enable NPC Piling", description = "Enable the option to highlight NPCs when they pile.", - parent = "npcPilesStub" + titleSection = "npcPilesTitle" ) default boolean enableNPCS() { @@ -109,22 +110,22 @@ public interface PileIndicatorsConfig extends Config keyName = "npcPileColor", name = "NPC Pile Color", description = "Color used for NPC piles.", - parent = "npcPilesStub" + titleSection = "npcPilesTitle" ) default Color npcPileColor() { return Color.BLUE; } - @ConfigItem( - keyName = "mixedPilesStub", + @ConfigTitleSection( + keyName = "mixedPilesTitle", name = "Mixed Piles", description = "", position = 7 ) - default Stub mixedPilesStub() + default Title mixedPilesTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -132,22 +133,22 @@ public interface PileIndicatorsConfig extends Config keyName = "mixedPileColor", name = "Mixed Pile Color", description = "Color used for mixed piles.", - parent = "mixedPilesStub" + titleSection = "mixedPilesTitle" ) default Color mixedPileColor() { return new Color(255, 0, 255); } - @ConfigItem( - keyName = "pilesSizeStub", + @ConfigTitleSection( + keyName = "pilesSizeTitle", name = "Pile size", description = "", position = 9 ) - default Stub pilesSizeStub() + default Title pilesSizeTitle() { - return new Stub(); + return new Title(); } @Range( @@ -158,22 +159,22 @@ public interface PileIndicatorsConfig extends Config keyName = "minimumPileSize", name = "Minimum Pile Size", description = "Any pile under this size will not show up. (Minimum: 2)", - parent = "pilesSizeStub" + titleSection = "pilesSizeTitle" ) default int minimumPileSize() { return 2; } - @ConfigItem( - keyName = "miscellaneousStub", + @ConfigTitleSection( + keyName = "miscellaneousTitle", name = "Miscellaneous", description = "", position = 11 ) - default Stub miscellaneousStub() + default Title miscellaneousTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -181,7 +182,7 @@ public interface PileIndicatorsConfig extends Config keyName = "numberOnly", name = "Display Number Only", description = "Shorten \"PILE SIZE: 1\" to \"1\"", - parent = "miscellaneousStub" + titleSection = "miscellaneousTitle" ) default boolean numberOnly() { @@ -193,7 +194,7 @@ public interface PileIndicatorsConfig extends Config keyName = "drawPileTile", name = "Draw Pile Tile", description = "Draws the tile of the pile for best visibility.", - parent = "miscellaneousStub" + titleSection = "miscellaneousTitle" ) default boolean drawPileTile() { @@ -205,7 +206,7 @@ public interface PileIndicatorsConfig extends Config keyName = "drawPileHull", name = "Draw Pile Convex Hull", description = "Draws the hull of the pile for best visibility.", - parent = "miscellaneousStub" + titleSection = "miscellaneousTitle" ) default boolean drawPileHull() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsConfig.java index caddcd871a..651be4f70b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/playerindicators/PlayerIndicatorsConfig.java @@ -30,19 +30,109 @@ import net.runelite.api.ClanMemberRank; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -import net.runelite.client.config.Stub; +import net.runelite.client.config.ConfigSection; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; @ConfigGroup("playerindicators") public interface PlayerIndicatorsConfig extends Config { EnumSet defaultPlayerIndicatorMode = EnumSet.complementOf(EnumSet.of(PlayerIndicationLocation.HULL)); + @ConfigSection( + name = "Yourself", + description = "", + position = 0, + keyName = "yourselfSection" + ) + default boolean yourselfSection() + { + return false; + } + + @ConfigSection( + name = "Friends", + description = "", + position = 1, + keyName = "friendsSection" + ) + default boolean friendsSection() + { + return false; + } + + @ConfigSection( + name = "Clan", + description = "", + position = 2, + keyName = "clanSection" + ) + default boolean clanSection() + { + return false; + } + + @ConfigSection( + name = "Team", + description = "", + position = 3, + keyName = "teamSection" + ) + default boolean teamSection() + { + return false; + } + + @ConfigSection( + name = "Target", + description = "", + position = 4, + keyName = "targetSection" + ) + default boolean targetSection() + { + return false; + } + + @ConfigSection( + name = "Other", + description = "", + position = 5, + keyName = "otherSection" + ) + default boolean otherSection() + { + return false; + } + + @ConfigSection( + name = "Callers", + description = "", + position = 6, + keyName = "callersSection" + ) + default boolean callersSection() + { + return false; + } + + @ConfigSection( + name = "Miscellaneous", + description = "", + position = 7, + keyName = "miscellaneousSection" + ) + default boolean miscellaneousSection() + { + return false; + } + @ConfigItem( position = 0, keyName = "drawOwnName", name = "Highlight own player", description = "Configures whether or not your own player should be highlighted", - group = "Yourself" + section = "yourselfSection" ) default boolean highlightOwnPlayer() { @@ -54,7 +144,7 @@ public interface PlayerIndicatorsConfig extends Config keyName = "ownNameColor", name = "Own player color", description = "Color of your own player", - group = "Yourself" + section = "yourselfSection" ) default Color getOwnPlayerColor() { @@ -66,7 +156,7 @@ public interface PlayerIndicatorsConfig extends Config keyName = "selfIndicatorModes", name = "Indicator Mode", description = "Location(s) of the overlay", - group = "Yourself", + section = "yourselfSection", enumClass = PlayerIndicationLocation.class ) default EnumSet selfIndicatorModes() @@ -75,11 +165,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 3, + position = 0, keyName = "drawFriendNames", name = "Highlight friends", description = "Configures whether or not friends should be highlighted", - group = "Friends" + section = "friendsSection" ) default boolean highlightFriends() { @@ -87,11 +177,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 4, + position = 1, keyName = "friendNameColor", name = "Friend color", description = "Color of friend names", - group = "Friends" + section = "friendsSection" ) default Color getFriendColor() { @@ -99,11 +189,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 5, + position = 2, keyName = "friendIndicatorMode", name = "Indicator Mode", description = "Location(s) of the overlay", - group = "Friends", + section = "friendsSection", enumClass = PlayerIndicationLocation.class ) @@ -113,11 +203,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 6, + position = 0, keyName = "highlightClan", name = "Highlight clan members", description = "Configures whether or clan members should be highlighted", - group = "Clan" + section = "clanSection" ) default boolean highlightClan() { @@ -125,11 +215,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 7, + position = 1, keyName = "clanMemberColor", name = "Clan member color", description = "Color of clan members", - group = "Clan" + section = "clanSection" ) default Color getClanColor() { @@ -137,11 +227,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 8, + position = 2, keyName = "clanIndicatorModes", name = "Indicator Mode", description = "Location(s) of the overlay", - group = "Clan", + section = "clanSection", enumClass = PlayerIndicationLocation.class ) @@ -151,11 +241,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 9, + position = 3, keyName = "clanMenuIcons", name = "Show clan ranks", description = "Add clan rank to right click menu and next to player names", - group = "Clan" + section = "clanSection" ) default boolean showClanRanks() { @@ -163,11 +253,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 10, + position = 0, keyName = "drawTeamMemberNames", name = "Highlight team members", description = "Configures whether or not team members should be highlighted", - group = "Team" + section = "teamSection" ) default boolean highlightTeamMembers() { @@ -175,11 +265,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 11, + position = 1, keyName = "teamMemberColor", name = "Team member color", description = "Color of team members", - group = "Team" + section = "teamSection" ) default Color getTeamcolor() { @@ -187,11 +277,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 12, + position = 2, keyName = "teamIndicatorModes", name = "Indicator Mode", description = "Location(s) of the overlay", - group = "Team", + section = "teamSection", enumClass = PlayerIndicationLocation.class ) @@ -201,11 +291,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 13, + position = 0, keyName = "drawTargetsNames", name = "Highlight attackable targets", description = "Configures whether or not attackable targets should be highlighted", - group = "Target" + section = "targetSection" ) default boolean highlightTargets() { @@ -213,11 +303,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 14, + position = 1, keyName = "targetColor", name = "Target member color", description = "Color of attackable targets", - group = "Target" + section = "targetSection" ) default Color getTargetsColor() { @@ -225,11 +315,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 15, + position = 2, keyName = "targetsIndicatorModes", name = "Indicator Mode", description = "Location(s) of the overlay", - group = "Target", + section = "targetSection", enumClass = PlayerIndicationLocation.class ) @@ -239,11 +329,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 16, + position = 3, keyName = "showAgility", name = "Show Agility Levels", description = "Show the agility level of attackable players next to their name while in the wilderness.", - group = "Target" + section = "targetSection" ) default boolean showAgilityLevel() { @@ -251,11 +341,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 17, + position = 4, keyName = "agilityFormat", name = "Format", description = "Whether to show the agility level as text, or as icons (1 skull >= 1st threshold, 2 skulls >= 2nd threshold).", - group = "Target" + section = "targetSection" ) default PlayerIndicatorsPlugin.AgilityFormats agilityFormat() { @@ -263,11 +353,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 18, + position = 5, keyName = "agilityFirstThreshold", name = "First Threshold", description = "When showing agility as icons, show one icon for agility >= this level.", - group = "Target" + section = "targetSection" ) default int agilityFirstThreshold() { @@ -275,11 +365,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 19, + position = 6, keyName = "agilitySecondThreshold", name = "Second Threshold", description = "When showing agility as icons, show two icons for agility >= this level.", - group = "Target" + section = "targetSection" ) default int agilitySecondThreshold() { @@ -287,11 +377,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 20, + position = 7, keyName = "playerSkull", name = "Show Skull Information", description = "shows", - group = "Target" + section = "targetSection" ) default boolean playerSkull() { @@ -299,11 +389,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 21, + position = 8, keyName = "minimapSkullLocation", name = "Skull Icon Location", description = "The location of the skull icon for skulled players", - group = "Target" + section = "targetSection" ) default PlayerIndicatorsPlugin.MinimapSkullLocations skullLocation() { @@ -311,11 +401,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 22, + position = 9, keyName = "targetRisk", name = "Indicate Target Risk", description = "Indicates the risk (in K GP) of the target", - group = "Target" + section = "targetSection" ) default boolean targetRisk() { @@ -323,11 +413,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 23, + position = 10, keyName = "showCombat", name = "Show Combat Levels", description = "Show the combat level of attackable players next to their name.", - group = "Target" + section = "targetSection" ) default boolean showCombatLevel() { @@ -335,11 +425,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 24, + position = 0, keyName = "drawOtherPlayerNames", name = "Highlight other players", description = "Configures whether or not other players should be highlighted", - group = "Other" + section = "otherSection" ) default boolean highlightOtherPlayers() { @@ -347,11 +437,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 25, + position = 1, keyName = "otherPlayerColor", name = "Other player color", description = "Color of other players' names", - group = "Other" + section = "otherSection" ) default Color getOtherColor() { @@ -359,11 +449,11 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 26, + position = 2, keyName = "otherIndicatorModes", name = "Indicator Mode", description = "Location(s) of the overlay", - group = "Other", + section = "otherSection", enumClass = PlayerIndicationLocation.class ) @@ -372,38 +462,25 @@ public interface PlayerIndicatorsConfig extends Config return defaultPlayerIndicatorMode; } - - @ConfigItem( - position = 11, - keyName = "playerNamePosition", - name = "Name position", - description = "Configures the position of drawn player names, or if they should be disabled", - parent = "Other Settings" - ) - default PlayerNameLocation playerNamePosition() - { - return PlayerNameLocation.ABOVE_HEAD; - } - - @ConfigItem( - position = 5, + @ConfigTitleSection( keyName = "callerConfiguration", + position = 0, name = "Caller Configuration", description = "", - group = "Callers" + section = "callersSection" ) - default Stub callerConfiguration() + default Title callerConfiguration() { - return new Stub(); + return new Title(); } @ConfigItem( - position = 30, + position = 1, keyName = "highlightCallers", name = "Highlight Callers", description = "Highlights Callers Onscreen", - group = "Callers", - parent = "callerConfiguration" + section = "callersSection", + titleSection = "callerConfiguration" ) default boolean highlightCallers() { @@ -411,12 +488,12 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 31, + position = 2, keyName = "useClanchatRanks", name = "Use Ranks as Callers", description = "Uses clanchat ranks as the list of callers", - group = "Callers", - parent = "callerConfiguration" + section = "callersSection", + titleSection = "callerConfiguration" ) default boolean useClanchatRanks() { @@ -424,12 +501,12 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 32, + position = 3, keyName = "callerRank", name = "Minimum rank for Clan Caller", description = "Chooses the minimum rank to use as clanchat callers.", - group = "Callers", - parent = "callerConfiguration" + section = "callersSection", + titleSection = "callerConfiguration" ) default ClanMemberRank callerRank() { @@ -437,38 +514,38 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 33, + position = 4, keyName = "callers", name = "List of callers to highlight", description = "Highlights callers, only highlights one at a time. Separate each entry with a comma and enter" + " in the order you want them highlighted.", - group = "Callers", - parent = "callerConfiguration" + section = "callersSection", + titleSection = "callerConfiguration" ) default String callers() { return " "; } - @ConfigItem( - position = 5, + @ConfigTitleSection( keyName = "callerIndicators", + position = 5, name = "Caller Indicators", description = "", - group = "Callers" + section = "callersSection" ) - default Stub callerIndicators() + default Title callerIndicators() { - return new Stub(); + return new Title(); } @ConfigItem( - position = 31, + position = 6, keyName = "callerColor", name = "Caller Color", description = "Color of Indicated Callers", - group = "Callers", - parent = "callerIndicators" + section = "callersSection", + titleSection = "callerIndicators" ) default Color callerColor() { @@ -476,12 +553,12 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 32, + position = 7, keyName = "callerHighlightOptions", name = "Caller indication methods", description = "Location(s) of the overlay", - group = "Callers", - parent = "callerIndicators", + section = "callersSection", + titleSection = "callerIndicators", enumClass = PlayerIndicationLocation.class ) default EnumSet callerHighlightOptions() @@ -489,25 +566,25 @@ public interface PlayerIndicatorsConfig extends Config return defaultPlayerIndicatorMode; } - @ConfigItem( - position = 5, + @ConfigTitleSection( keyName = "callerTargetIndicators", + position = 8, name = "Caller Target Indicators", description = "", - group = "Callers" + section = "callersSection" ) - default Stub callerTargetIndicators() + default Title callerTargetIndicators() { - return new Stub(); + return new Title(); } @ConfigItem( - position = 33, + position = 9, keyName = "callersTargets", name = "Calllers' targets", description = "Highlights the targets of callers", - group = "Callers", - parent = "callerTargetIndicators" + section = "callersSection", + titleSection = "callerTargetIndicators" ) default boolean callersTargets() { @@ -515,12 +592,12 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 34, + position = 10, keyName = "callerTargetColor", name = "Callers' targets color", description = "Color of the the targets of callers", - group = "Callers", - parent = "callerTargetIndicators" + section = "callersSection", + titleSection = "callerTargetIndicators" ) default Color callerTargetColor() { @@ -528,12 +605,12 @@ public interface PlayerIndicatorsConfig extends Config } @ConfigItem( - position = 35, + position = 11, keyName = "callerTargetHighlightOptions", name = "Pile indication methods", description = "How to highlight the callers' target", - group = "Callers", - parent = "callerTargetIndicators", + section = "callersSection", + titleSection = "callerTargetIndicators", enumClass = PlayerIndicationLocation.class ) default EnumSet callerTargetHighlightOptions() @@ -541,13 +618,12 @@ public interface PlayerIndicatorsConfig extends Config return defaultPlayerIndicatorMode; } - @ConfigItem( - position = 36, + position = 0, keyName = "unchargedGlory", name = "Uncharged Glory Indication", - description = "Indicates if players have an uncharged glory", - parent = "Other Settings" + description = "Indicates if players have an uncharged glory (this only works if the above head indicator is selected)", + section = "miscellaneousSection" ) default boolean unchargedGlory() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsConfig.java index c42e7e80f0..b52e719b2b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsConfig.java @@ -29,26 +29,27 @@ import java.awt.Color; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -import net.runelite.client.config.Stub; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; @ConfigGroup("raids") public interface RaidsConfig extends Config { - @ConfigItem( + @ConfigTitleSection( keyName = "scouterConfig", name = "Scouter Config", description = "", position = 0 ) - default Stub scouterConfig() + default Title scouterConfig() { - return new Stub(); + return new Title(); } @ConfigItem( position = 1, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "enhanceScouterTitle", name = "Enhance scouter title", description = "Adds #combat and good puzzles to scouter title" @@ -60,7 +61,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 2, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "hideBackground", name = "Hide Scouter Background", description = "Removes the scouter background, and makes it transparent." @@ -72,7 +73,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 2, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "raidsTimer", name = "Display elapsed raid time", description = "Display elapsed raid time" @@ -84,7 +85,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 3, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "pointsMessage", name = "Display points in chatbox after raid", description = "Display a message with total points, individual points and percentage at the end of a raid" @@ -97,7 +98,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 4, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "ptsHr", name = "Enable points per hour message", description = "Enable the message" @@ -109,7 +110,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 5, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "scoutOverlay", name = "Show scout overlay", description = "Display an overlay that shows the current raid layout (when entering lobby)" @@ -121,7 +122,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 6, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "scoutOverlayAtBank", name = "Show scout overlay outside lobby", description = "Keep the overlay active while at the raids area" @@ -133,7 +134,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 7, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "scoutOverlayInRaid", name = "Show scout overlay inside raid", description = "Keep the overlay active while inside raid" @@ -145,7 +146,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 8, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "displayFloorBreak", name = "Layout floor break", description = "Displays floor break in layout" @@ -157,7 +158,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 9, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "showRecommendedItems", name = "Show recommended items", description = "Adds overlay with recommended items to scouter" @@ -169,7 +170,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 10, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "recommendedItems", name = "Recommended items", hidden = true, @@ -183,7 +184,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 11, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "alwaysShowWorldAndCC", name = "Always show CC and World", description = "The CC and World are not removed from being in the in-game scouter" @@ -195,7 +196,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 12, - parent = "scouterConfig", + titleSection = "scouterConfig", keyName = "displayLayoutMessage", name = "Send raid layout message when entering raid", description = "Sends game message with raid layout on entering new raid" @@ -205,20 +206,20 @@ public interface RaidsConfig extends Config return true; } - @ConfigItem( + @ConfigTitleSection( keyName = "roomConfig", name = "Room Config", description = "", position = 13 ) - default Stub roomConfig() + default Title roomConfig() { - return new Stub(); + return new Title(); } @ConfigItem( position = 14, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "colorTightrope", name = "Color tightrope", description = "Colors tightrope a separate color" @@ -230,7 +231,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 15, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "tightropeColor", name = "Tightrope color", description = "The color of tightropes", @@ -244,7 +245,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 16, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "crabHandler", name = "Color crabs", description = "If your crabs are good, it will color them to your set color." + @@ -257,7 +258,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 17, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "goodCrabColor", name = "Good Crab color", description = "The color of good crabs", @@ -271,7 +272,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 17, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "rareCrabColor", name = "Rare Crab color", description = "The color of rare crabs", @@ -285,7 +286,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 18, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "enableRotationWhitelist", name = "Enable rotation whitelist", description = "Enable the rotation whitelist" @@ -297,7 +298,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 19, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "whitelistedRotations", name = "Whitelisted rotations", hidden = true, @@ -311,7 +312,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 20, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "enableLayoutWhitelist", name = "Enable layout whitelist", description = "Enable the layout whitelist" @@ -323,7 +324,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 21, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "whitelistedLayouts", name = "Whitelisted layouts", hidden = true, @@ -337,7 +338,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 22, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "showScavsFarms", name = "Show scavengers and farming", description = "Adds scavengers and farming to the room breakdown" @@ -349,7 +350,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 23, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "scavsBeforeIce", name = "Show last scavs for Ice Demon", description = "Highlights final scavengers before Ice Demon" @@ -361,7 +362,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 24, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "scavsBeforeOlm", name = "Show last scavs for Olm", description = "Highlights final scavengers before Olm" @@ -373,7 +374,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 25, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "scavPrepColor", name = "Last scavs color", description = "The color of the final scavs before Ice Demon/Olm" @@ -385,7 +386,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 26, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "whitelistedRooms", name = "Whitelisted rooms", description = "Display whitelisted rooms in green on the overlay. Separate with comma (full name)", @@ -400,7 +401,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 27, - parent = "roomConfig", + titleSection = "roomConfig", keyName = "blacklistedRooms", name = "Blacklisted rooms", description = "Display blacklisted rooms in red on the overlay. Separate with comma (full name)", @@ -413,20 +414,20 @@ public interface RaidsConfig extends Config return ""; } - @ConfigItem( + @ConfigTitleSection( keyName = "hideRooms", name = "Hide Rooms", description = "", position = 28 ) - default Stub hideRooms() + default Title hideRooms() { - return new Stub(); + return new Title(); } @ConfigItem( position = 29, - parent = "hideRooms", + titleSection = "hideRooms", keyName = "hideRopeless", name = "Hide no Tightrope raids", description = "Completely hides raids with no tightrope" @@ -438,7 +439,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 30, - parent = "hideRooms", + titleSection = "hideRooms", keyName = "hideVanguards", name = "Hide Vanguard raids", description = "Completely hides raids with Vanguards" @@ -450,7 +451,7 @@ public interface RaidsConfig extends Config @ConfigItem( position = 31, - parent = "hideRooms", + titleSection = "hideRooms", keyName = "hideUnknownCombat", name = "Hide Unknown combat raids", description = "Completely hides raids with Unknown combat" diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/runecraft/RunecraftConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/runecraft/RunecraftConfig.java index a3ac74ff88..3f1f5383b4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/runecraft/RunecraftConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/runecraft/RunecraftConfig.java @@ -28,27 +28,28 @@ package net.runelite.client.plugins.runecraft; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -import net.runelite.client.config.Stub; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; @ConfigGroup("runecraft") public interface RunecraftConfig extends Config { - @ConfigItem( - keyName = "utilStub", + @ConfigTitleSection( + keyName = "utilTitle", name = "Utility", description = "", position = 1 ) - default Stub utilStub() + default Title utilTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "lavas", name = "Lavas", description = "Swaps Ring of dueling menu entry depending on location, requires fire tiara or RC cape to be worn.", - parent = "utilStub", + titleSection = "utilTitle", warning = "
This config option is incompatible with menu-entry-swapper equipment swaps." + "
Expect bugs if you use them together.
", position = 2 @@ -62,7 +63,7 @@ public interface RunecraftConfig extends Config keyName = "essPouch", name = "Swap essence pouch", description = "Makes essence pouch left-click fill in bank", - parent = "utilStub", + titleSection = "utilTitle", position = 3 ) default boolean essPouch() @@ -75,7 +76,7 @@ public interface RunecraftConfig extends Config name = "Highlight Dark Mage NPC", description = "Configures whether to highlight the Dark Mage when pouches are degraded", position = 4, - parent = "utilStub" + titleSection = "utilTitle" ) default boolean hightlightDarkMage() { @@ -87,23 +88,22 @@ public interface RunecraftConfig extends Config name = "Notify when pouch degrades", description = "Send a notification when a pouch degrades", position = 5, - parent = "utilStub" + titleSection = "utilTitle" ) default boolean degradingNotification() { return true; } - - @ConfigItem( - keyName = "riftsStub", + @ConfigTitleSection( + keyName = "riftsTitle", name = "Rifts", description = "", position = 6 ) - default Stub riftsStub() + default Title riftsTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -111,7 +111,7 @@ public interface RunecraftConfig extends Config name = "Show Rifts in Abyss", description = "Configures whether the rifts in the abyss will be displayed", position = 7, - parent = "riftsStub" + titleSection = "riftsTitle" ) default boolean showRifts() { @@ -123,7 +123,7 @@ public interface RunecraftConfig extends Config name = "Show Air rift", description = "Configures whether to display the air rift", position = 8, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -137,7 +137,7 @@ public interface RunecraftConfig extends Config name = "Show Blood rift", description = "Configures whether to display the Blood rift", position = 9, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -151,7 +151,7 @@ public interface RunecraftConfig extends Config name = "Show Body rift", description = "Configures whether to display the Body rift", position = 10, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -165,7 +165,7 @@ public interface RunecraftConfig extends Config name = "Show Chaos rift", description = "Configures whether to display the Chaos rift", position = 11, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -179,7 +179,7 @@ public interface RunecraftConfig extends Config name = "Show Cosmic rift", description = "Configures whether to display the Cosmic rift", position = 12, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -193,7 +193,7 @@ public interface RunecraftConfig extends Config name = "Show Death rift", description = "Configures whether to display the Death rift", position = 13, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -207,7 +207,7 @@ public interface RunecraftConfig extends Config name = "Show Earth rift", description = "Configures whether to display the Earth rift", position = 14, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -221,7 +221,7 @@ public interface RunecraftConfig extends Config name = "Show Fire rift", description = "Configures whether to display the Fire rift", position = 15, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -235,7 +235,7 @@ public interface RunecraftConfig extends Config name = "Show Law rift", description = "Configures whether to display the Law rift", position = 16, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -249,7 +249,7 @@ public interface RunecraftConfig extends Config name = "Show Mind rift", description = "Configures whether to display the Mind rift", position = 17, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -263,7 +263,7 @@ public interface RunecraftConfig extends Config name = "Show Nature rift", description = "Configures whether to display the Nature rift", position = 18, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -277,7 +277,7 @@ public interface RunecraftConfig extends Config name = "Show Soul rift", description = "Configures whether to display the Soul rift", position = 19, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -291,7 +291,7 @@ public interface RunecraftConfig extends Config name = "Show Water rift", description = "Configures whether to display the Water rift", position = 20, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) @@ -305,7 +305,7 @@ public interface RunecraftConfig extends Config name = "Show Rift click box", description = "Configures whether to display the click box of the rift", position = 21, - parent = "riftsStub", + titleSection = "riftsTitle", hidden = true, unhide = "showRifts" ) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuConfig.java index ab4face95a..876fe20b4a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/runedoku/RunedokuConfig.java @@ -28,21 +28,22 @@ import java.awt.Color; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -import net.runelite.client.config.Stub; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; @ConfigGroup("runedoku") public interface RunedokuConfig extends Config { - @ConfigItem( + @ConfigTitleSection( + keyName = "colorTitle", position = 0, - keyName = "colorStub", name = "Colors", description = "" //stubs don't show descriptions when hovered over ) - default Stub colorStub() + default Title colorTitle() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -50,7 +51,7 @@ public interface RunedokuConfig extends Config keyName = "mindRuneColor", name = "Mind Rune Color", description = "Color used to highlight Mind runes.", - parent = "colorStub" + titleSection = "colorTitle" ) default Color mindRuneColor() { @@ -62,7 +63,7 @@ public interface RunedokuConfig extends Config keyName = "fireRuneColor", name = "Fire Rune Color", description = "Color used to highlight Fire runes.", - parent = "colorStub" + titleSection = "colorTitle" ) default Color fireRuneColor() { @@ -74,7 +75,7 @@ public interface RunedokuConfig extends Config keyName = "bodyRuneColor", name = "Body Rune Color", description = "Color used to highlight Body runes.", - parent = "colorStub" + titleSection = "colorTitle" ) default Color bodyRuneColor() { @@ -86,7 +87,7 @@ public interface RunedokuConfig extends Config keyName = "airRuneColor", name = "Air Rune Color", description = "Color used to highlight Air runes.", - parent = "colorStub" + titleSection = "colorTitle" ) default Color airRuneColor() { @@ -98,7 +99,7 @@ public interface RunedokuConfig extends Config keyName = "deathRuneColor", name = "Death Rune Color", description = "Color used to highlight Death runes.", - parent = "colorStub" + titleSection = "colorTitle" ) default Color deathRuneColor() { @@ -110,7 +111,7 @@ public interface RunedokuConfig extends Config keyName = "waterRuneColor", name = "Water Rune Color", description = "Color used to highlight Water runes.", - parent = "colorStub" + titleSection = "colorTitle" ) default Color waterRuneColor() { @@ -122,7 +123,7 @@ public interface RunedokuConfig extends Config keyName = "chaosRuneColor", name = "Chaos Rune Color", description = "Color used to highlight Chaos runes.", - parent = "colorStub" + titleSection = "colorTitle" ) default Color chaosRuneColor() { @@ -134,7 +135,7 @@ public interface RunedokuConfig extends Config keyName = "earthRuneColor", name = "Earth Rune Color", description = "Color used to highlight Earth runes.", - parent = "colorStub" + titleSection = "colorTitle" ) default Color earthRuneColor() { @@ -146,29 +147,30 @@ public interface RunedokuConfig extends Config keyName = "lawRuneColor", name = "Law Rune Color", description = "Color used to highlight Law runes.", - parent = "colorStub" + titleSection = "colorTitle" ) default Color lawRuneColor() { return Color.CYAN; } - @ConfigItem( - position = 10, + @ConfigTitleSection( keyName = "miscFeature", + position = 10, name = "Miscellaneous Features", description = "" ) - default Stub miscFeature() + default Title miscFeature() { - return new Stub(); + return new Title(); } @ConfigItem( position = 11, keyName = "onlyHighlightSelectedPiece", name = "Only Highlight Selected Piece", - description = "Instead of showing all, this option only show what rune you have selected." + description = "Instead of showing all, this option only show what rune you have selected.", + titleSection = "miscFeature" ) default boolean onlyHighlightSelectedPiece() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/statusorbs/StatusOrbsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/statusorbs/StatusOrbsConfig.java index c05c47645d..6968024f2f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/statusorbs/StatusOrbsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/statusorbs/StatusOrbsConfig.java @@ -28,27 +28,28 @@ package net.runelite.client.plugins.statusorbs; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -import net.runelite.client.config.Stub; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; @ConfigGroup("statusorbs") public interface StatusOrbsConfig extends Config { - @ConfigItem( + @ConfigTitleSection( keyName = "hp", name = "Hitpoints", description = "", position = 0 ) - default Stub hp() + default Title hp() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "dynamicHpHeart", name = "Dynamic hitpoints heart", description = "Changes the HP heart color to match players current affliction", - parent = "hp", + titleSection = "hp", position = 1 ) default boolean dynamicHpHeart() @@ -60,7 +61,7 @@ public interface StatusOrbsConfig extends Config keyName = "showHitpoints", name = "Show hitpoints regen", description = "Show a ring around the hitpoints orb", - parent = "hp", + titleSection = "hp", position = 2 ) default boolean showHitpoints() @@ -72,7 +73,7 @@ public interface StatusOrbsConfig extends Config keyName = "showWhenNoChange", name = "Show hitpoints regen at full hitpoints", description = "Always show the hitpoints regen orb, even if there will be no stat change", - parent = "hp", + titleSection = "hp", position = 3 ) default boolean showWhenNoChange() @@ -84,7 +85,7 @@ public interface StatusOrbsConfig extends Config keyName = "notifyBeforeHpRegenDuration", name = "Hitpoint Regen Notification (seconds)", description = "Notify approximately when your next hitpoint is about to regen. A value of 0 will disable notification.", - parent = "hp", + titleSection = "hp", position = 4 ) default int getNotifyBeforeHpRegenSeconds() @@ -92,22 +93,22 @@ public interface StatusOrbsConfig extends Config return 0; } - @ConfigItem( + @ConfigTitleSection( keyName = "spec", name = "Special attack", description = "", position = 5 ) - default Stub spec() + default Title spec() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "showSpecial", name = "Show Spec. Attack regen", description = "Show a ring around the Special Attack orb", - parent = "spec", + titleSection = "spec", position = 6 ) default boolean showSpecial() @@ -115,15 +116,15 @@ public interface StatusOrbsConfig extends Config return true; } - @ConfigItem( + @ConfigTitleSection( keyName = "run", name = "Run energy", description = "", position = 7 ) - default Stub run() + default Title run() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -131,7 +132,7 @@ public interface StatusOrbsConfig extends Config name = "Show run energy regen", description = "Show a ring around the run regen orb", position = 8, - parent = "run" + titleSection = "run" ) default boolean showRun() { @@ -143,7 +144,7 @@ public interface StatusOrbsConfig extends Config name = "Replace run orb text with run time left", description = "Show the remaining run time (in seconds) next in the energy orb", position = 9, - parent = "run" + titleSection = "run" ) default boolean replaceOrbText() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/theatre/TheatreConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/theatre/TheatreConfig.java index 456365821f..1654719cf1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/theatre/TheatreConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/theatre/TheatreConfig.java @@ -12,17 +12,29 @@ import java.awt.Color; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigSection; @ConfigGroup("Theatre") public interface TheatreConfig extends Config { - @ConfigItem( + @ConfigSection( position = 0, + keyName = "maidenSection", + name = "Maiden", + description = "" + ) + default boolean experimentalSection() + { + return false; + } + + @ConfigItem( + position = 1, keyName = "showMaidenBloodToss", name = "Show Maiden Blood Toss", description = "Displays the tile location where tossed blood will land.", - group = "Maiden" + section = "maidenSection" ) default boolean showMaidenBloodToss() { @@ -30,11 +42,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 1, + position = 2, keyName = "showMaidenBloodSpawns", name = "Show Maiden Blood Spawns", description = "Show the tiles that blood spawns will travel to.", - group = "Maiden" + section = "maidenSection" ) default boolean showMaidenBloodSpawns() { @@ -42,23 +54,34 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 2, + position = 3, keyName = "showNyloFreezeHighlights", name = "Show Nylo Freeze Highlights", description = "Show when to freeze Nylos at maiden. Say n1,n2,s1,s2 in chat for it to register.", - group = "Maiden" + section = "maidenSection" ) default boolean showNyloFreezeHighlights() { return true; } + @ConfigSection( + position = 4, + keyName = "bloatSection", + name = "Bloat", + description = "" + ) + default boolean bloatSection() + { + return false; + } + @ConfigItem( - position = 2, + position = 5, keyName = "showBloatIndicator", name = "Show Bloat Status", description = "Displays Bloat's status (asleep, wake, and enrage) using color code.", - group = "Bloat" + section = "bloatSection" ) default boolean showBloatIndicator() { @@ -66,11 +89,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 3, + position = 6, keyName = "showBloatHands", name = "Show Bloat Hands", description = "Highlights the falling hands inside Bloat.", - group = "Bloat" + section = "bloatSection" ) default boolean showBloatHands() { @@ -78,11 +101,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 4, + position = 7, keyName = "bloatFeet", name = "Bloat Hands Rave Edition", description = "", - group = "Bloat" + section = "bloatSection" ) default boolean BloatFeetIndicatorRaveEdition() { @@ -90,23 +113,34 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 4, + position = 8, keyName = "showBloatTimer", name = "Show Bloat Timer", description = "Show the estimated time when Bloat will go down.", - group = "Bloat" + section = "bloatSection" ) default boolean showBloatTimer() { return false; } + @ConfigSection( + position = 9, + keyName = "nylocasSection", + name = "Nylocas", + description = "" + ) + default boolean nylocasSection() + { + return false; + } + @ConfigItem( - position = 5, + position = 10, keyName = "showNyloPillarHealth", name = "Show Nylocas Pillar Health", description = "Show the health bars of the Nylocas pillars.", - group = "Nylocas" + section = "nylocasSection" ) default boolean showNyloPillarHealth() { @@ -114,11 +148,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 6, + position = 11, keyName = "showNylocasExplosions", name = "Highlight Old Nylocas", description = "Either a timer on the nylo counting down to explosion, or a tile underneath.", - group = "Nylocas" + section = "nylocasSection" ) default NYLOOPTION showNylocasExplosions() { @@ -126,11 +160,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 7, + position = 12, keyName = "showNylocasAmount", name = "Show Nylocas Amount", description = "An overlay will appear that counts the amount of Nylocas in the room.", - group = "Nylocas" + section = "nylocasSection" ) default boolean showNylocasAmount() { @@ -138,11 +172,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 8, + position = 13, keyName = "nylocasMenuSwap", name = "Hide Nylocas wrong attack options", description = "hides attack options on small nylos of the wrong style", - group = "Nylocas" + section = "nylocasSection" ) default boolean nylocasMenuSwap() { @@ -180,23 +214,35 @@ public interface TheatreConfig extends Config **/ @ConfigItem( - position = 11, + position = 14, keyName = "highlightNyloAgros", name = "Show Nylocas Agros", description = "Highlight the Nylocas that are aggressive to the player.", - group = "Nylocas" + section = "nylocasSection" ) default boolean highlightNyloAgros() { return true; } + + @ConfigSection( + position = 15, + keyName = "sotetsegSection", + name = "Sotetseg", + description = "" + ) + default boolean sotetsegSection() + { + return false; + } + @ConfigItem( - position = 12, + position = 16, keyName = "showSotetsegAttacks", name = "Show Sotetseg Attacks", description = "Highlight the attacks which Sotetseg throws at you.", - group = "Sotetseg" + section = "sotetsegSection" ) default boolean showSotetsegAttacks() { @@ -204,11 +250,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 13, + position = 17, keyName = "showSotetsegMaze", name = "Mark Sotetseg Maze", description = "Marks the tiles of Sotetseg's maze while in the overworld.", - group = "Sotetseg" + section = "sotetsegSection" ) default boolean showSotetsegMaze() { @@ -216,11 +262,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 14, + position = 18, keyName = "showSotetsegSolo", name = "Mark Sotetseg Maze (Solo)", description = "Marks the tiles of Sotetseg's maze while in the underworld.", - group = "Sotetseg" + section = "sotetsegSection" ) default boolean showSotetsegSolo() { @@ -228,23 +274,34 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 14, + position = 19, keyName = "markerColor", name = "Sotey Tile Colour", description = "Configures the color of marked tile", - group = "Sotetseg" + section = "sotetsegSection" ) default Color mazeTileColour() { return Color.WHITE; } + @ConfigSection( + position = 20, + keyName = "xarpusSection", + name = "Xarpus", + description = "" + ) + default boolean xarpusSection() + { + return false; + } + @ConfigItem( - position = 15, + position = 21, keyName = "showXarpusHeals", name = "Show Xarpus Heals", description = "Highlights the tiles that Xarpus is healing with.", - group = "Xarpus" + section = "xarpusSection" ) default boolean showXarpusHeals() { @@ -252,23 +309,34 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 16, + position = 22, keyName = "showXarpusTick", name = "Show Xarpus Turn Tick", description = "Count down the ticks until Xarpus turns their head.", - group = "Xarpus" + section = "xarpusSection" ) default boolean showXarpusTick() { return true; } + @ConfigSection( + position = 23, + keyName = "verzikSection", + name = "Verzik", + description = "" + ) + default boolean verzikSection() + { + return false; + } + @ConfigItem( - position = 17, + position = 24, keyName = "showVerzikAttacks", name = "Show Verzik Attack Tick", description = "Count down the ticks until Verzik attacks.", - group = "Verzik" + section = "verzikSection" ) default boolean showVerzikAttacks() { @@ -276,11 +344,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 18, + position = 25, keyName = "showVerzikYellows", name = "Show Yellows Tick", description = "Count down the ticks until Verzik yellow's damage tick.", - group = "Verzik" + section = "verzikSection" ) default boolean showVerzikYellows() { @@ -288,11 +356,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 19, + position = 26, keyName = "showCrabTargets", name = "Show Crab Targets", description = "Shows the target of crabs at Verzik.", - group = "Verzik" + section = "verzikSection" ) default boolean showCrabTargets() { @@ -300,11 +368,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 20, + position = 27, keyName = "VerzikTankTile", name = "Verzik P3 Tile Overlay", description = "", - group = "Verzik" + section = "verzikSection" ) default boolean VerzikTankTile() { @@ -312,11 +380,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 22, + position = 28, keyName = "verzikrangeattacks", name = "Show Verzik Range Attacks", description = "", - group = "Verzik" + section = "verzikSection" ) default boolean verzikRangeAttacks() { @@ -324,11 +392,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 23, + position = 29, keyName = "extratimers", name = "Show Extra Timers", description = "", - group = "Verzik" + section = "verzikSection" ) default boolean extraTimers() { @@ -336,11 +404,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 24, + position = 30, keyName = "p1attacks", name = "Verzik P1 Timer", description = "", - group = "Verzik" + section = "verzikSection" ) default boolean p1attacks() { @@ -348,11 +416,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 25, + position = 31, keyName = "p2attacks", name = "Verzik P2 Timer", description = "", - group = "Verzik" + section = "verzikSection" ) default boolean p2attacks() { @@ -360,11 +428,11 @@ public interface TheatreConfig extends Config } @ConfigItem( - position = 26, + position = 32, keyName = "p3attacks", name = "Verzik P3 Timer", description = "", - group = "Verzik" + section = "verzikSection" ) default boolean p3attacks() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/ticktimers/TickTimersConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/ticktimers/TickTimersConfig.java index c61c121a2d..fed238e356 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/ticktimers/TickTimersConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/ticktimers/TickTimersConfig.java @@ -30,21 +30,22 @@ import lombok.Getter; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigTitleSection; import net.runelite.client.config.Range; -import net.runelite.client.config.Stub; +import net.runelite.client.config.Title; @ConfigGroup("TickTimers") public interface TickTimersConfig extends Config { - @ConfigItem( - position = 0, + @ConfigTitleSection( keyName = "mainConfig", + position = 0, name = "Main Config", description = "" ) - default Stub mainConfig() + default Title mainConfig() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -52,7 +53,7 @@ public interface TickTimersConfig extends Config keyName = "prayerWidgetHelper", name = "Prayer Widget Helper", description = "Shows you which prayer to click and the time until click.", - parent = "mainConfig" + titleSection = "mainConfig" ) default boolean showPrayerWidgetHelper() { @@ -64,7 +65,7 @@ public interface TickTimersConfig extends Config keyName = "showHitSquares", name = "Show Hit Squares", description = "Shows you where the melee bosses can hit you from.", - parent = "mainConfig" + titleSection = "mainConfig" ) default boolean showHitSquares() { @@ -77,22 +78,22 @@ public interface TickTimersConfig extends Config name = "Change Tick Color", description = "If this is enabled, it will change the tick color to white" + "
at 1 tick remaining, signaling you to swap.", - parent = "mainConfig" + titleSection = "mainConfig" ) default boolean changeTickColor() { return false; } - @ConfigItem( - position = 4, + @ConfigTitleSection( keyName = "bosses", + position = 4, name = "Bosses", description = "" ) - default Stub bosses() + default Title bosses() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -100,7 +101,7 @@ public interface TickTimersConfig extends Config keyName = "gwd", name = "God Wars Dungeon", description = "Show tick timers for GWD Bosses. This must be enabled before you zone in.", - parent = "bosses" + titleSection = "bosses" ) default boolean gwd() { @@ -112,22 +113,22 @@ public interface TickTimersConfig extends Config keyName = "dks", name = "Dagannoth Kings", description = "Show tick timers for Dagannoth Kings. This must be enabled before you zone in.", - parent = "bosses" + titleSection = "bosses" ) default boolean dks() { return true; } - @ConfigItem( - position = 7, + @ConfigTitleSection( keyName = "text", + position = 7, name = "Text", description = "" ) - default Stub text() + default Title text() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -135,7 +136,7 @@ public interface TickTimersConfig extends Config keyName = "fontStyle", name = "Font Style", description = "Plain | Bold | Italics", - parent = "text" + titleSection = "text" ) default FontStyle fontStyle() { @@ -151,7 +152,7 @@ public interface TickTimersConfig extends Config keyName = "textSize", name = "Text Size", description = "Text Size for Timers.", - parent = "text" + titleSection = "text" ) default int textSize() { @@ -163,7 +164,7 @@ public interface TickTimersConfig extends Config keyName = "shadows", name = "Shadows", description = "Adds Shadows to text.", - parent = "text" + titleSection = "text" ) default boolean shadows() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java index c718bc84cd..9e514f2164 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java @@ -26,20 +26,22 @@ package net.runelite.client.plugins.tmorph; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -import net.runelite.client.config.Stub; +import net.runelite.client.config.ConfigSection; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; @ConfigGroup("TMorph") public interface TMorphConfig extends Config { - @ConfigItem( + @ConfigTitleSection( keyName = "swaps", name = "Morphers", description = "", position = 0 ) - default Stub swaps() + default Title swaps() { - return new Stub(); + return new Title(); } @ConfigItem( @@ -48,7 +50,7 @@ public interface TMorphConfig extends Config description = "
Proper Format is id,id:Slot" + "
For example: 6570,21295:Cape" + "
Valid Slots: Helmet, Cape, Amulet, Weapon, Torso, Shield, Legs, Head, Hands, Boots, Jaw, Ring, Ammo
", - parent = "swaps", + titleSection = "swaps", position = 1, parse = true, clazz = Parse.class, @@ -65,7 +67,7 @@ public interface TMorphConfig extends Config description = "
Proper Format is id,id:Slot" + "
For example: 6570,21295:Cape" + "
Valid Slots: Helmet, Cape, Amulet, Weapon, Torso, Shield, Legs, Head, Hands, Boots, Jaw, Ring, Ammo
", - parent = "swaps", + titleSection = "swaps", position = 2, parse = true, clazz = Parse.class, @@ -82,7 +84,7 @@ public interface TMorphConfig extends Config description = "
Proper Format is id,id:Slot" + "
For example: 6570,21295:Cape" + "
Valid Slots: Helmet, Cape, Amulet, Weapon, Torso, Shield, Legs, Head, Hands, Boots, Jaw, Ring, Ammo
", - parent = "swaps", + titleSection = "swaps", position = 3, parse = true, clazz = Parse.class, @@ -93,27 +95,39 @@ public interface TMorphConfig extends Config return ""; } + //////////////////Experimental Functions + + @ConfigSection( + position = 4, + keyName = "experimentalSection", + name = "Experimental Functions", + description = "" + ) + default boolean experimentalSection() + { + return false; + } + @ConfigItem( keyName = "experimentalFunctions", name = "Experimental Functions", description = "May bug out in unintended ways.", - parent = "swaps", - position = 4 + section = "experimentalSection", + position = 0 ) default boolean experimentalFunctions() { return false; } - //////////////////Experimental Functions - @ConfigItem( keyName = "globalAnimSwap", name = "Global Animation Swap", description = "DO NOT USE WITH ANIMATION SWAP BELOW", - group = "Experimental Functions", + section = "experimentalSection", hidden = true, - unhide = "experimentalFunctions" + unhide = "experimentalFunctions", + position = 1 ) default int globalAnimSwap() { @@ -124,9 +138,10 @@ public interface TMorphConfig extends Config keyName = "animationSwap", name = "Animation Swap", description = "ID", - group = "Experimental Functions", + section = "experimentalSection", hidden = true, - unhide = "experimentalFunctions" + unhide = "experimentalFunctions", + position = 2 ) default int animationSwap() { @@ -137,9 +152,10 @@ public interface TMorphConfig extends Config keyName = "animationTarget", name = "Animation Target", description = "ID", - group = "Experimental Functions", + section = "experimentalSection", hidden = true, - unhide = "experimentalFunctions" + unhide = "experimentalFunctions", + position = 3 ) default int animationTarget() { @@ -150,9 +166,10 @@ public interface TMorphConfig extends Config keyName = "globalGraphicSwap", name = "Global Graphic Swap", description = "DO NOT USE WITH GRAPHIC SWAP BELOW", - group = "Experimental Functions", + section = "experimentalSection", hidden = true, - unhide = "experimentalFunctions" + unhide = "experimentalFunctions", + position = 4 ) default int globalGraphicSwap() { @@ -163,9 +180,10 @@ public interface TMorphConfig extends Config keyName = "graphicSwap", name = "Graphic Swap", description = "ID", - group = "Experimental Functions", + section = "experimentalSection", hidden = true, - unhide = "experimentalFunctions" + unhide = "experimentalFunctions", + position = 5 ) default int graphicSwap() { @@ -176,9 +194,10 @@ public interface TMorphConfig extends Config keyName = "graphicTarget", name = "Graphic Target", description = "ID", - group = "Experimental Functions", + section = "experimentalSection", hidden = true, - unhide = "experimentalFunctions" + unhide = "experimentalFunctions", + position = 6 ) default int graphicTarget() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/zalcano/ZalcanoConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/zalcano/ZalcanoConfig.java index 6c84d5d155..aa011828a0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/zalcano/ZalcanoConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/zalcano/ZalcanoConfig.java @@ -30,28 +30,29 @@ import java.awt.Color; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -import net.runelite.client.config.Stub; +import net.runelite.client.config.ConfigTitleSection; +import net.runelite.client.config.Title; @ConfigGroup("zalcano") public interface ZalcanoConfig extends Config { - @ConfigItem( - keyName = "zalcanoStub", + @ConfigTitleSection( + keyName = "zalcanoTitle", name = "Zalcano", description = "", position = 0 ) - default Stub zalcanoStub() + default Title zalcanoTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "highlightZalcanoHull", name = "Highlight Zalcano", description = "Highlight Zalcano\'s convex hull.", - parent = "zalcanoStub", + titleSection = "zalcanoTitle", position = 1 ) default boolean highlightZalcanoHull() @@ -63,7 +64,7 @@ public interface ZalcanoConfig extends Config keyName = "zalcanoHullColor", name = "Color for highlight", description = "", - parent = "zalcanoStub", + titleSection = "zalcanoTitle", position = 2 ) default Color zalcanoHullColor() @@ -71,22 +72,22 @@ public interface ZalcanoConfig extends Config return new Color(255, 25, 0); } - @ConfigItem( - keyName = "zalcanoAoesStub", + @ConfigTitleSection( + keyName = "zalcanoAoesTitle", name = "Area of Effect", description = "", position = 3 ) - default Stub zalcanoAoesStub() + default Title zalcanoAoesTitle() { - return new Stub(); + return new Title(); } @ConfigItem( keyName = "showAoeZalcanoWakeup", name = "Zalcano Wakeup", description = "Shows an AOE warning for Zalcano waking back up.", - parent = "zalcanoAoesStub", + titleSection = "zalcanoAoesTitle", position = 4 ) default boolean showAoeZalcanoWakeup() @@ -98,7 +99,7 @@ public interface ZalcanoConfig extends Config keyName = "showAoeForRockfall", name = "Small Rocks", description = "Shows an AOE warning for the rocks that fall occasionally.", - parent = "zalcanoAoesStub", + titleSection = "zalcanoAoesTitle", position = 5 ) default boolean showAoeForRockfall() @@ -110,7 +111,7 @@ public interface ZalcanoConfig extends Config keyName = "showAoeForRedSymbols", name = "Red Symbols", description = "Shows an AOE warning for the 3x3 red symbols that appear.", - parent = "zalcanoAoesStub", + titleSection = "zalcanoAoesTitle", position = 6 ) default boolean showAoeForRedSymbols() @@ -122,7 +123,7 @@ public interface ZalcanoConfig extends Config keyName = "highlightMiningSpot", name = "Mining spot", description = "Highlights the glowing rock and warns you if Zalcano attacks it.", - parent = "zalcanoAoesStub", + titleSection = "zalcanoAoesTitle", position = 7 ) default boolean highlightMiningSpot() @@ -130,15 +131,15 @@ public interface ZalcanoConfig extends Config return true; } - @ConfigItem( - keyName = "helperStub", + @ConfigTitleSection( + keyName = "helperTitle", name = "Helpers", description = "", position = 8 ) - default Stub helperStub() + default Title helperTitle() { - return new Stub(); + return new Title(); } /** @@ -148,7 +149,7 @@ public interface ZalcanoConfig extends Config keyName = "showSteps", name = "Show Step", description = "", - parent = "helperStub", + titleSection = "helperTitle", position = 9, hidden = true //hidden until fully functional ) @@ -161,7 +162,7 @@ public interface ZalcanoConfig extends Config keyName = "showAoeZalcanoMineable", name = "Zalcano Mineable", description = "Highlights Zalcano if she is mineable.", - parent = "helperStub", + titleSection = "helperTitle", position = 10 ) default boolean showAoeZalcanoMineable() @@ -173,7 +174,7 @@ public interface ZalcanoConfig extends Config keyName = "highlightGolem", name = "Highlight Golem", description = "Highlights the Golem that Zalcano spawns in.", - parent = "helperStub", + titleSection = "helperTitle", position = 11 ) default boolean highlightGolem() diff --git a/runelite-client/src/main/java/net/runelite/client/ui/components/IconButton.java b/runelite-client/src/main/java/net/runelite/client/ui/components/IconButton.java index 1d54bf601c..a9291230fe 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/components/IconButton.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/IconButton.java @@ -27,6 +27,7 @@ package net.runelite.client.ui.components; import java.awt.Insets; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JButton; @@ -50,22 +51,29 @@ public class IconButton extends JButton setOpaque(false); setRolloverEnabled(false); - if (hoverIcon != null) - { - addMouseListener(new MouseAdapter() - { - @Override - public void mouseEntered(MouseEvent e) - { - setIcon(hoverIcon); - } - - @Override - public void mouseExited(MouseEvent e) - { - setIcon(icon); - } - }); - } + setHoverIcon(hoverIcon); } -} + + public void setHoverIcon(ImageIcon hoverIcon) + { + if (hoverIcon == null) + { + return; + } + final Icon icon = getIcon(); + addMouseListener(new MouseAdapter() + { + @Override + public void mouseEntered(MouseEvent e) + { + setIcon(hoverIcon); + } + + @Override + public void mouseExited(MouseEvent e) + { + setIcon(icon); + } + }); + } +} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/config/ConfigItemsGroup.java b/runelite-client/src/main/java/net/runelite/client/ui/components/MinimumSizedPanel.java similarity index 71% rename from runelite-client/src/main/java/net/runelite/client/config/ConfigItemsGroup.java rename to runelite-client/src/main/java/net/runelite/client/ui/components/MinimumSizedPanel.java index 41347a59ef..87c24770c2 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/ConfigItemsGroup.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/MinimumSizedPanel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Craftiii4 + * Copyright (c) 2019, Hydrox6 * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,31 +22,18 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.client.config; +package net.runelite.client.ui.components; -import java.util.ArrayList; -import java.util.Collection; -import lombok.AccessLevel; -import lombok.Getter; +import javax.swing.JPanel; +import java.awt.Dimension; -public class ConfigItemsGroup +public class MinimumSizedPanel extends JPanel { - - @Getter(AccessLevel.PUBLIC) - private final String group; - - @Getter(AccessLevel.PUBLIC) - private Collection items; - - public ConfigItemsGroup(String group) + @Override + public Dimension getPreferredSize() { - this.group = group; - this.items = new ArrayList<>(); + final Dimension pref = super.getPreferredSize(); + final Dimension minimum = super.getMinimumSize(); + return new Dimension(Math.max(pref.width, minimum.width), Math.max(pref.height, minimum.height)); } - - public void addItem(ConfigItemDescriptor item) - { - items.add(item); - } - -} +} \ No newline at end of file