diff options
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" } |
