From 26835af63de4f0f6808c55ee7f249827df3c58db Mon Sep 17 00:00:00 2001 From: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Date: Sat, 26 Oct 2024 02:53:19 +0200 Subject: Improvement + Fix: Profile Type in Custom Scoreboard (#2810) --- .../features/gui/customscoreboard/DisplayConfig.java | 5 +++++ .../elements/ScoreboardElementProfile.kt | 17 +++++++++++++++-- .../events/ScoreboardEventBroodmother.kt | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/DisplayConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/DisplayConfig.java index b54d7519d..26c6b125e 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/DisplayConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/DisplayConfig.java @@ -149,6 +149,11 @@ public class DisplayConfig { @ConfigEditorDropdown public RenderUtils.HorizontalAlignment textAlignment = RenderUtils.HorizontalAlignment.LEFT; + @Expose + @ConfigOption(name = "Show Profile Name", desc = "Show profile name instead of the type in the profile element.") + @ConfigEditorBoolean + public boolean showProfileName = false; + @Expose @ConfigOption(name = "Date in Lobby Code", desc = "Show the current date infront of the server name, like Hypixel does.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/elements/ScoreboardElementProfile.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/elements/ScoreboardElementProfile.kt index c8a4bc993..2d85d6776 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/elements/ScoreboardElementProfile.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/elements/ScoreboardElementProfile.kt @@ -1,15 +1,28 @@ package at.hannibal2.skyhanni.features.gui.customscoreboard.elements import at.hannibal2.skyhanni.data.HypixelData +import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboard import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboardUtils import at.hannibal2.skyhanni.utils.StringUtils.firstLetterUppercase // internal and scoreboard // island change event object ScoreboardElementProfile : ScoreboardElement() { - override fun getDisplay() = CustomScoreboardUtils.getProfileTypeSymbol() + HypixelData.profileName.firstLetterUppercase() + override fun getDisplay() = buildString { + append(CustomScoreboardUtils.getProfileTypeSymbol()) + if (CustomScoreboard.displayConfig.showProfileName) { + append(HypixelData.profileName.firstLetterUppercase()) + } else { + when { + HypixelData.ironman -> append("Ironman") + HypixelData.stranded -> append("Stranded") + HypixelData.bingo -> append("Bingo") + else -> append("Normal") + } + } + } - override val configLine = "§7♲ Blueberry" + override val configLine = "§7♲ Ironman" } // click: does a command for profile management exist? diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/events/ScoreboardEventBroodmother.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/events/ScoreboardEventBroodmother.kt index 2d10a1847..3b6a23a18 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/events/ScoreboardEventBroodmother.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/events/ScoreboardEventBroodmother.kt @@ -7,7 +7,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland // scoreboard // widget update event object ScoreboardEventBroodmother : ScoreboardEvent() { - override fun getDisplay() = TabWidget.BROODMOTHER.lines + override fun getDisplay() = TabWidget.BROODMOTHER.lines.map { it.trim() } override val configLine = "Broodmother§7: §eDormant" -- cgit