diff options
author | Vixid <52578495+VixidDev@users.noreply.github.com> | 2023-10-14 10:05:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-14 11:05:48 +0200 |
commit | 16ef943b3c2ce8db2331332261143a12bdba61cf (patch) | |
tree | 52c764205ef2464c62b05e3585390b61c69bcdda /src/main/java/at/hannibal2/skyhanni/config | |
parent | bfae99cb54988568b2752c7d6a8d3d5babed1bbc (diff) | |
download | skyhanni-16ef943b3c2ce8db2331332261143a12bdba61cf.tar.gz skyhanni-16ef943b3c2ce8db2331332261143a12bdba61cf.tar.bz2 skyhanni-16ef943b3c2ce8db2331332261143a12bdba61cf.zip |
Feature: SBA Chroma but in SH (#487)
Porting SBA's chroma into SkyHanni with many more options and chroma everything. #487
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/Features.java | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/ChromaConfig.java | 62 |
2 files changed, 67 insertions, 0 deletions
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; @@ -68,6 +69,10 @@ public class Features extends Config { 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; + } +} |