diff options
| author | J10a1n15 <45315647+j10a1n15@users.noreply.github.com> | 2024-10-26 02:53:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-26 02:53:19 +0200 |
| commit | 26835af63de4f0f6808c55ee7f249827df3c58db (patch) | |
| tree | c73faa254520e8e6da90e1a1eb8804e3a8ca1e2d | |
| parent | 0507e8b55ad2e5756191ad546a1eb1d23aafb4d9 (diff) | |
| download | SkyHanni-26835af63de4f0f6808c55ee7f249827df3c58db.tar.gz SkyHanni-26835af63de4f0f6808c55ee7f249827df3c58db.tar.bz2 SkyHanni-26835af63de4f0f6808c55ee7f249827df3c58db.zip | |
Improvement + Fix: Profile Type in Custom Scoreboard (#2810)
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 @@ -150,6 +150,11 @@ public class DisplayConfig { 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 public boolean dateInLobbyCode = true; 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" |
