diff options
| author | J10a1n15 <45315647+j10a1n15@users.noreply.github.com> | 2024-10-23 21:38:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-23 21:38:32 +0200 |
| commit | 8392ec3fe96214ebb289c403a2b408889f8b3f15 (patch) | |
| tree | ceba805aafd6aca2f863eff2f8ddf833f88cd5f3 | |
| parent | 5de4a25674517407dc2eaf63e34dbeadb050884d (diff) | |
| download | SkyHanni-8392ec3fe96214ebb289c403a2b408889f8b3f15.tar.gz SkyHanni-8392ec3fe96214ebb289c403a2b408889f8b3f15.tar.bz2 SkyHanni-8392ec3fe96214ebb289c403a2b408889f8b3f15.zip | |
Improvement: Date in Custom Scoreboard!! (#2802)
2 files changed, 15 insertions, 5 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 39d8c09bf..b54d7519d 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 = "Date in Lobby Code", desc = "Show the current date infront of the server name, like Hypixel does.") + @ConfigEditorBoolean + public boolean dateInLobbyCode = true; + + @Expose @ConfigOption( name = "Cache Scoreboard on Island Switch", desc = "Will stop the Scoreboard from updating while switching islands.\n" + diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/elements/ScoreboardElementLobbyCode.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/elements/ScoreboardElementLobbyCode.kt index a3b2b7c1f..f4f64ed17 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/elements/ScoreboardElementLobbyCode.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/elements/ScoreboardElementLobbyCode.kt @@ -2,15 +2,20 @@ package at.hannibal2.skyhanni.features.gui.customscoreboard.elements import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.features.dungeon.DungeonAPI +import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboard +import java.time.LocalDate +import java.time.format.DateTimeFormatter // internal // update on island change and every second while in dungeons object ScoreboardElementLobbyCode : ScoreboardElement() { - override fun getDisplay(): String? { - val lobbyCode = HypixelData.serverId ?: return null - val roomId = DungeonAPI.getRoomID()?.let { " §8$it" }.orEmpty() - return "§8$lobbyCode$roomId" + private val formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy") + + override fun getDisplay() = buildString { + if (CustomScoreboard.displayConfig.dateInLobbyCode) append("§7${LocalDate.now().format(formatter)} ") + append(HypixelData.serverId?.let { "§8$it" }) + append(DungeonAPI.getRoomID()?.let { " §8$it" }) } - override val configLine = "§8mega77CK" + override val configLine = "§710/23/2024 §8mega77CK" } |
