diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
4 files changed, 25 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt index f0601c557..31a3b31c8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt @@ -262,6 +262,11 @@ object CustomScoreboard { newArray } + event.transform(50, "$displayPrefix.events.eventEntries") { element -> + val array = element.asJsonArray + array.add(JsonPrimitive(ScoreboardEvents.ANNIVERSARY.name)) + array + } event.move(43, "$displayPrefix.alignment.alignRight", "$displayPrefix.alignment.horizontalAlignment") { JsonPrimitive( diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt index f8e7313d1..e0cbaff28 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt @@ -173,6 +173,11 @@ enum class ScoreboardEvents( ::getRedstoneShowWhen, "§e§l⚡ §cRedstone: §e§b7%" ), + ANNIVERSARY( + ::getAnniversaryLines, + ::getAnniversaryShowWhen, + "§d5th Anniversary§f 167:59:54", + ), ; override fun toString() = configLine @@ -390,7 +395,7 @@ private fun getActiveEventLine(): List<String> { // Some Active Events are better not shown from the tablist, // but from other locations like the scoreboard - val blockedEvents = listOf("Spooky Festival") + val blockedEvents = listOf("Spooky Festival", "5th SkyBlock Anniversary") if (blockedEvents.contains(currentActiveEvent.removeColor())) return emptyList() val currentActiveEventTime = TabListData.getTabList().firstOrNull { SbPattern.eventTimeEndsPattern.matches(it) } @@ -529,3 +534,7 @@ private fun getQueueShowWhen(): Boolean = SbPattern.queuePattern.anyMatches(getS private fun getRedstoneLines(): List<String> = listOf(getSbLines().first { SbPattern.redstonePattern.matches(it) }) private fun getRedstoneShowWhen(): Boolean = SbPattern.redstonePattern.anyMatches(getSbLines()) + +private fun getAnniversaryLines() = listOf(getSbLines().first { SbPattern.anniversaryPattern.matches(it) }) + +private fun getAnniversaryShowWhen(): Boolean = SbPattern.anniversaryPattern.anyMatches(getSbLines()) diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardPattern.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardPattern.kt index c04461433..6b70cd683 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardPattern.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardPattern.kt @@ -360,7 +360,15 @@ object ScoreboardPattern { ) val queuePositionPattern by miscSb.pattern( "queueposition", - "Position: (?:§.)*#\\d+ (?:§.)*Since: (?:§.)*.*" + "Position: (?:§.)*#\\d+ (?:§.)*Since: (?:§.)*.*", + ) + + /** + * REGEX-TEST: §d5th Anniversary§f 167:59:54 + */ + val anniversaryPattern by miscSb.pattern( + "anniversary", + "§d\\d+(?:st|nd|rd|th) Anniversary§f (?:\\d|:)+", ) // this thirdObjectiveLinePattern includes all those weird objective lines that go into a third scoreboard line diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/UnknownLinesHandler.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/UnknownLinesHandler.kt index eeaa0b447..75bfa1a80 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/UnknownLinesHandler.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/UnknownLinesHandler.kt @@ -88,6 +88,7 @@ object UnknownLinesHandler { SbPattern.slayerQuestPattern, SbPattern.essencePattern, SbPattern.redstonePattern, + SbPattern.anniversaryPattern, SbPattern.visitingPattern, SbPattern.flightDurationPattern, SbPattern.dojoChallengePattern, |