diff options
5 files changed, 38 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt index 75569686c..51bf33dbb 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt @@ -11,7 +11,7 @@ import com.google.gson.JsonPrimitive object ConfigUpdaterMigrator { val logger = LorenzLogger("ConfigMigration") - const val CONFIG_VERSION = 36 + const val CONFIG_VERSION = 37 fun JsonElement.at(chain: List<String>, init: Boolean): JsonElement? { if (chain.isEmpty()) return this if (this !is JsonObject) return null 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 37e2a2098..e775c74fd 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 @@ -176,6 +176,7 @@ class CustomScoreboard { val prefix = "gui.customScoreboard" val displayConfigPrefix = "$prefix.displayConfig" val displayPrefix = "$prefix.display" + event.move(28, "$prefix.displayConfig.showAllActiveEvents", "$prefix.displayConfig.eventsConfig.showAllActiveEvents") event.transform(30, "$prefix.displayConfig.eventsConfig.eventEntries") { element -> val array = element.asJsonArray @@ -203,5 +204,11 @@ class CustomScoreboard { event.move(31, "$displayConfigPrefix.eventsConfig", "$displayPrefix.events") event.move(31, "$prefix.mayorConfig", "$displayPrefix.mayor") event.move(31, "$prefix.partyConfig", "$displayPrefix.party") + + event.transform(37, "$displayPrefix.events.eventEntries") { element -> + val array = element.asJsonArray + array.add(JsonPrimitive(ScoreboardEvents.QUEUE.name)) + array + } } } 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 6e21e7610..57d95665f 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 @@ -154,6 +154,12 @@ enum class ScoreboardEvents( ::getEffigiesShowWhen, "Effigies: §c⧯§c⧯⧯§7⧯§c⧯§c⧯" ), + QUEUE( + ::getQueueLines, + ::getQueueShowWhen, + "Queued: Glacite Mineshafts\n" + + "Position: §b#45 §fSince: §a00:00" + ), ACTIVE_TABLIST_EVENTS( ::getActiveEventLine, ::getActiveEventShowWhen, @@ -538,6 +544,15 @@ private fun getEffigiesShowWhen(): Boolean { return RiftBloodEffigies.heartsPattern.anyMatches(getSbLines()) } +private fun getQueueLines(): List<String> { + return listOf(getSbLines().first { SbPattern.queuePattern.matches(it) }) + + (getSbLines().first { SbPattern.queuePositionPattern.matches(it) }) +} + +private fun getQueueShowWhen(): Boolean { + return SbPattern.queuePattern.anyMatches(getSbLines()) +} + private fun getRedstoneLines(): List<String> { return listOf(getSbLines().first { SbPattern.redstonePattern.matches(it) }) } 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 34a5d9f45..faeebb721 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 @@ -227,6 +227,10 @@ object ScoreboardPattern { val yourGoblinKillsPattern by miningSb.pattern( "yourgoblin", "^Your kills: §c\\d+ ☠( §a\\(\\+\\d+\\))?$" ) + val mineshaftNotStartedPattern by miningSb.pattern( + "mineshaft.notstarted", + "(?:§.)*Not started.*" + ) // combat private val combatSb = scoreboardGroup.group("combat") @@ -321,6 +325,14 @@ object ScoreboardPattern { "objective", "^(§.)*(Objective|Quest).*" ) + val queuePattern by miscSb.pattern( + "queued", + "Queued:.*" + ) + val queuePositionPattern by miscSb.pattern( + "queueposition", + "Position: (?:§.)*#\\d+ (?:§.)*Since: (?:§.)*.*" + ) // this thirdObjectiveLinePattern includes all those weird objective lines that go into a third scoreboard line val thirdObjectiveLinePattern by miscSb.pattern( @@ -423,12 +435,4 @@ object ScoreboardPattern { "eventtime", "^\\s+Ends In: §r§e(?<time>.*)$" ) - val boosterCookieEffectsWidgetPattern by tablistGroup.pattern( - "boostereffects", - "\\s*(?:§.)*Cookie Buff(?:§.)*: (?:§r)*(?<time>.*)" - ) - val cookieNotActivePattern by tablistGroup.pattern( - "cookienotactive", - "((?:§.)*Not active.*)|(§c§lINACTIVE)" - ) } 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 f0f434b06..e40e63b12 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 @@ -113,6 +113,9 @@ object UnknownLinesHandler { SbPattern.coldPattern, SbPattern.riftHotdogTitlePattern, SbPattern.riftHotdogEatenPattern, + SbPattern.mineshaftNotStartedPattern, + SbPattern.queuePattern, + SbPattern.queuePositionPattern, ) unknownLines = unknownLines.filterNot { line -> |