diff options
author | J10a1n15 <45315647+j10a1n15@users.noreply.github.com> | 2024-01-21 12:15:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-21 12:15:13 +0100 |
commit | e5004a6748110ea35d075050cbf4a59bfe64b62b (patch) | |
tree | dd7d482a9543c83be531789700bb1857ec7647e1 /src/main/java/at | |
parent | e0299c912d8754d04bdcad9184a2a4763a10b0e8 (diff) | |
download | skyhanni-e5004a6748110ea35d075050cbf4a59bfe64b62b.tar.gz skyhanni-e5004a6748110ea35d075050cbf4a59bfe64b62b.tar.bz2 skyhanni-e5004a6748110ea35d075050cbf4a59bfe64b62b.zip |
Feature: Colored month in scoreboard (#926)
Color the month names in the Scoreboard. #926
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java | 9 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt | 23 |
2 files changed, 31 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java index 757e5495b..fc7bac1e1 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java @@ -20,7 +20,7 @@ public class MiscConfig { @ConfigOption(name = "Hide Armor", desc = "") @Accordion @Expose - // TOOD maybe we can migrate this already + // TODO maybe we can migrate this already public HideArmorConfig hideArmor2 = new HideArmorConfig(); @Expose @@ -113,6 +113,7 @@ public class MiscConfig { @FeatureToggle public boolean brewingStandOverlay = true; + // TODO move into scoreboard accordion @Expose @ConfigOption(name = "Red Scoreboard Numbers", desc = "Hide the red scoreboard numbers on the right side of the screen.") @ConfigEditorBoolean @@ -126,6 +127,12 @@ public class MiscConfig { public boolean hidePiggyScoreboard = true; @Expose + @ConfigOption(name = "Color Month Names", desc = "Color the month names in the Scoreboard.") + @ConfigEditorBoolean + @FeatureToggle + public boolean colorMonthNames = false; + + @Expose @ConfigOption(name = "Explosions Hider", desc = "Hide explosions.") @ConfigEditorBoolean @FeatureToggle diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt index 896313d12..6399c3e2b 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt @@ -51,5 +51,28 @@ private fun replaceString(text: String): String? { } } + if (SkyHanniMod.feature.misc.colorMonthNames) { + for (season in Season.entries) { + if (text.trim().startsWith(season.prefix)) { + return season.colorCode + text + } + } + } + return text } + +enum class Season(val prefix: String, val colorCode: String) { + EARLY_SPRING("Early Spring", "§d"), + SPRING("Spring", "§d"), + LATE_SPRING("Late Spring", "§d"), + EARLY_SUMMER("Early Summer", "§6"), + SUMMER("Summer", "§6"), + LATE_SUMMER("Late Summer", "§6"), + EARLY_AUTUMN("Early Autumn", "§e"), + AUTUMN("Autumn", "§e"), + LATE_AUTUMN("Late Autumn", "§e"), + EARLY_WINTER("Early Winter", "§9"), + WINTER("Winter", "§9"), + LATE_WINTER("Late Winter", "§9") +} |