From dc337e273420fbc987fabdfb07f42a78116da164 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 17 Sep 2023 10:54:24 +0200 Subject: migrate city project config into event and real time, tps display, and custom text box config into gui --- .../skyhanni/config/features/EventConfig.java | 29 ++++++++ .../skyhanni/config/features/GUIConfig.java | 49 ++++++++++++- .../skyhanni/config/features/MiscConfig.java | 85 ---------------------- .../skyhanni/features/fame/CityProjectFeatures.kt | 8 +- .../skyhanni/features/misc/CustomTextBox.kt | 8 +- .../skyhanni/features/misc/TimeFeatures.kt | 7 +- .../hannibal2/skyhanni/features/misc/TpsCounter.kt | 19 +++-- 7 files changed, 107 insertions(+), 98 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java index a76c49858..79224ce80 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/EventConfig.java @@ -277,6 +277,35 @@ public class EventConfig { } + @ConfigOption(name = "City Project", desc = "") + @Accordion + @Expose + public CityProjectConfig cityProject = new CityProjectConfig(); + + public static class CityProjectConfig { + + @Expose + @ConfigOption(name = "Show Materials", desc = "Show materials needed for contributing to the City Project.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showMaterials = true; + + @Expose + @ConfigOption(name = "Show Ready", desc = "Mark contributions that are ready to participate.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showReady = true; + + @Expose + @ConfigOption(name = "Daily Reminder", desc = "Remind every 24 hours to participate.") + @ConfigEditorBoolean + @FeatureToggle + public boolean dailyReminder = true; + + @Expose + public Position pos = new Position(150, 150, false, true); + } + // comment in if the event is needed again // @ConfigOption(name = "300þ Anniversary Celebration", desc = "Features for the 300þ year of SkyBlock") @Accordion diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java index cf9f0cc39..f885bfc82 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java @@ -1,11 +1,11 @@ package at.hannibal2.skyhanni.config.features; +import at.hannibal2.skyhanni.config.FeatureToggle; +import at.hannibal2.skyhanni.config.core.config.Position; import at.hannibal2.skyhanni.data.GuiEditManager; import com.google.gson.annotations.Expose; -import io.github.moulberry.moulconfig.annotations.ConfigEditorButton; -import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind; -import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider; -import io.github.moulberry.moulconfig.annotations.ConfigOption; +import io.github.moulberry.moulconfig.annotations.*; +import io.github.moulberry.moulconfig.observer.Property; import org.lwjgl.input.Keyboard; public class GUIConfig { @@ -23,4 +23,45 @@ public class GUIConfig { @ConfigOption(name = "Global GUI scale", desc = "Globally scale all SkyHanni GUIs") @ConfigEditorSlider(minValue = 0.1F, maxValue = 10, minStep = 0.05F) public float globalScale = 1F; + + @Expose + @ConfigOption(name = "Custom Text box", desc = "") + @Accordion + public TextBoxConfig customTextBox = new TextBoxConfig(); + + public static class TextBoxConfig { + + @Expose + @ConfigOption(name = "Enabled", desc = "Enables showing the textbox while in SkyBlock.") + @ConfigEditorBoolean + public boolean enabled = false; + + @Expose + @ConfigOption(name = "Text", desc = "Enter text you want to display here.\n" + + "§eUse '&' as the colour code character.\n" + + "§eUse '\\n' as the line break character.") + @ConfigEditorText + public Property text = Property.of("&aYour Text Here\\n&bYour new line here"); + + @Expose + public Position position = new Position(10, 80, false, true); + } + + @Expose + @ConfigOption(name = "Real Time", desc = "Display the current computer time, a handy feature when playing in full-screen mode.") + @ConfigEditorBoolean + @FeatureToggle + public boolean realTime = false; + + @Expose + public Position realTimePosition = new Position(10, 10, false, true); + + @Expose + @ConfigOption(name = "Tps Display", desc = "Show the TPS of the current server, like in Soopy.") + @ConfigEditorBoolean + @FeatureToggle + public boolean tpsDisplay = false; + + @Expose + public Position tpsDisplayPosition = new Position(10, 10, false, true); } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java index bd231257d..d29b14f9b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -54,24 +54,6 @@ public class MiscConfig { @Expose public Position petDisplayPos = new Position(-330, -15, false, true); - // rename this to just "time will cause a config reset - @ConfigOption(name = "Time Features", desc = "") - @Accordion - @Expose - public TimeConfig timeConfigs = new TimeConfig(); - - public static class TimeConfig { - - @Expose - @ConfigOption(name = "Real Time", desc = "Display the current computer time, a handy feature when playing in full-screen mode.") - @ConfigEditorBoolean - @FeatureToggle - public boolean realTime = false; - - @Expose - public Position realTimePos = new Position(10, 10, false, true); - } - @ConfigOption(name = "Hide Armor", desc = "") @Accordion @Expose @@ -115,21 +97,6 @@ public class MiscConfig { @Expose public Position nonGodPotEffectPos = new Position(10, 10, false, true); - @Expose - @ConfigOption(name = "Tps Display", desc = "") - @ConfigEditorAccordion(id = 8) - public boolean tpsDisplay = false; - - @Expose - @ConfigOption(name = "Tps Display", desc = "Show the TPS of the current server, like in Soopy.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 8) - @FeatureToggle - public boolean tpsDisplayEnabled = false; - - @Expose - public Position tpsDisplayPosition = new Position(10, 10, false, true); - @Expose @ConfigOption(name = "Particle Hider", desc = "") @ConfigEditorAccordion(id = 9) @@ -378,35 +345,6 @@ public class MiscConfig { public boolean inventoryNumbers = false; } - @ConfigOption(name = "City Project", desc = "") - @Accordion - @Expose - public CityProject cityProject = new CityProject(); - - public static class CityProject { - - @Expose - @ConfigOption(name = "Show Materials", desc = "Show materials needed for contributing to the City Project.") - @ConfigEditorBoolean - @FeatureToggle - public boolean showMaterials = true; - - @Expose - @ConfigOption(name = "Show Ready", desc = "Mark contributions that are ready to participate.") - @ConfigEditorBoolean - @FeatureToggle - public boolean showReady = true; - - @Expose - @ConfigOption(name = "Daily Reminder", desc = "Remind every 24 hours to participate.") - @ConfigEditorBoolean - @FeatureToggle - public boolean dailyReminder = true; - - @Expose - public Position pos = new Position(150, 150, false, true); - } - @ConfigOption(name = "Pocket Sack-In-A-Sack", desc = "") @Accordion @Expose @@ -510,29 +448,6 @@ public class MiscConfig { public Position position = new Position(10, 80, false, true); } - @Expose - @ConfigOption(name = "Custom Text box", desc = "") - @Accordion - public TextBox textBox = new TextBox(); - - public static class TextBox { - - @Expose - @ConfigOption(name = "Enabled", desc = "Enables showing the textbox while in SkyBlock.") - @ConfigEditorBoolean - public boolean enabled = false; - - @Expose - @ConfigOption(name = "Text", desc = "Enter text you want to display here.\n" + - "§eUse '&' as the colour code character.\n" + - "§eUse '\\n' as the line break character.") - @ConfigEditorText - public Property text = Property.of("&aYour Text Here\\n&bYour new line here"); - - @Expose - public Position position = new Position(10, 80, false, true); - } - @Expose @ConfigOption(name = "Cosmetic", desc = "") @Accordion diff --git a/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt index 706de6807..2e8154d6a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fame import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.features.bazaar.BazaarApi @@ -27,7 +28,7 @@ class CityProjectFeatures { private val contributeAgainPattern = "§7Contribute again: §e(?