From 16ef943b3c2ce8db2331332261143a12bdba61cf Mon Sep 17 00:00:00 2001 From: Vixid <52578495+VixidDev@users.noreply.github.com> Date: Sat, 14 Oct 2023 10:05:48 +0100 Subject: Feature: SBA Chroma but in SH (#487) Porting SBA's chroma into SkyHanni with many more options and chroma everything. #487 --- .../at/hannibal2/skyhanni/config/Features.java | 5 ++ .../skyhanni/config/features/ChromaConfig.java | 62 ++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/ChromaConfig.java (limited to 'src/main/java/at/hannibal2/skyhanni/config') diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index 95ffa7f6c..f5916cda8 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod; import at.hannibal2.skyhanni.config.features.About; import at.hannibal2.skyhanni.config.features.BazaarConfig; import at.hannibal2.skyhanni.config.features.ChatConfig; +import at.hannibal2.skyhanni.config.features.ChromaConfig; import at.hannibal2.skyhanni.config.features.CombatConfig; import at.hannibal2.skyhanni.config.features.CommandsConfig; import at.hannibal2.skyhanni.config.features.CrimsonIsleConfig; @@ -67,6 +68,10 @@ public class Features extends Config { @Category(name = "GUI", desc = "Change the locations of GUI elements. (§e/sh gui§7)") public GUIConfig gui = new GUIConfig(); + @Expose + @Category(name = "Chroma", desc = "Settings for Chroma text. (Credit to SBA)") + public ChromaConfig chroma = new ChromaConfig(); + @Expose @Category(name = "Chat", desc = "Change how the chat looks.") public ChatConfig chat = new ChatConfig(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/ChromaConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/ChromaConfig.java new file mode 100644 index 000000000..80c40cd98 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/ChromaConfig.java @@ -0,0 +1,62 @@ +package at.hannibal2.skyhanni.config.features; + +import at.hannibal2.skyhanni.SkyHanniMod; +import at.hannibal2.skyhanni.config.FeatureToggle; +import com.google.gson.annotations.Expose; +import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; +import io.github.moulberry.moulconfig.annotations.ConfigEditorButton; +import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown; +import io.github.moulberry.moulconfig.annotations.ConfigEditorInfoText; +import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider; +import io.github.moulberry.moulconfig.annotations.ConfigOption; + +public class ChromaConfig { + + @Expose + @ConfigOption(name = "Chroma Preview", desc = "§fPlease star the mod on GitHub!") + @ConfigEditorInfoText(infoTitle = "Only In SkyBlock") + public boolean chromaPreview = false; + + @Expose + @ConfigOption(name = "Enabled", desc = "Toggle for SkyHanni's chroma. (Disables Patcher's Optimized Font Renderer while enabled)") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = false; + + @Expose + @ConfigOption(name = "Chroma Size", desc = "Change the size of each color in the chroma.") + @ConfigEditorSlider(minValue = 1f, maxValue = 100f, minStep = 1f) + public float chromaSize = 30f; + + @Expose + @ConfigOption(name = "Chroma Speed", desc = "Change how fast the chroma animation moves.") + @ConfigEditorSlider(minValue = 0.5f, maxValue = 20f, minStep = 0.5f) + public float chromaSpeed = 6f; + + @Expose + @ConfigOption(name = "Chroma Saturation", desc = "Change the saturation of the chroma.") + @ConfigEditorSlider(minValue = 0f, maxValue = 1f, minStep = 0.01f) + public float chromaSaturation = 0.75f; + + @Expose + @ConfigOption(name = "Chroma Direction", desc = "Change the slant and direction of the chroma.") + @ConfigEditorDropdown(values = {"Forward + Right", "Forward + Left", "Backward + Right", "Backward + Left"}) + public int chromaDirection = 0; + + @ConfigOption(name = "Reset to Default", desc = "Resets all chroma settings to the default.") + @ConfigEditorButton(buttonText = "Reset") + public Runnable resetSettings = this::resetChromaSettings; + + @Expose + @ConfigOption(name = "Everything Chroma", desc = "Renders §4§l§oALL §r§7text in chroma. (Some enchants may appear white with SBA enchant parsing)") + @ConfigEditorBoolean + public boolean allChroma = false; + + private void resetChromaSettings() { + SkyHanniMod.getFeature().chroma.chromaSize = 30f; + SkyHanniMod.getFeature().chroma.chromaSpeed = 6f; + SkyHanniMod.getFeature().chroma.chromaSaturation = 0.75f; + SkyHanniMod.getFeature().chroma.allChroma = false; + SkyHanniMod.getFeature().chroma.chromaDirection = 0; + } +} -- cgit