From 2f8737997d2539772456932ada630417d5a48b24 Mon Sep 17 00:00:00 2001 From: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:13:03 +0100 Subject: Fix: Fixed Hotdog Contest Error in Custom Scoreboard (#1273) --- .../gui/customscoreboard/ScoreboardEvents.kt | 25 +++++++++++++++------- .../gui/customscoreboard/ScoreboardPattern.kt | 8 +++++++ .../gui/customscoreboard/UnknownLinesHandler.kt | 2 ++ 3 files changed, 27 insertions(+), 8 deletions(-) (limited to 'src/main/java/at') 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 6c914a50c..dabe6968b 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 @@ -138,6 +138,12 @@ enum class ScoreboardEvents( "§7Damage Soaked:\n" + "§e▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎§7▎▎▎▎▎" ), + HOT_DOG_CONTEST( + ::getHotDogLines, + ::getHotDogShowWhen, + "§6Hot Dog Contest\n" + + "Eaten: §c0/50" + ), ESSENCE( ::getEssenceLines, ::getEssenceShowWhen, @@ -202,6 +208,7 @@ enum class ScoreboardEvents( MINING_EVENTS, DAMAGE, MAGMA_BOSS, + HOT_DOG_CONTEST, ESSENCE, EFFIGIES, ACTIVE_TABLIST_EVENTS @@ -429,14 +436,6 @@ private fun getBroodmotherShowWhen(): Boolean { return getSbLines().any { SbPattern.broodmotherPattern.matches(it) } } -private fun getOringoLines(): List { - return listOf(getSbLines().first { SbPattern.travelingZooPattern.matches(it) }) -} - -private fun getOringoShowWhen(): Boolean { - return getSbLines().any { SbPattern.travelingZooPattern.matches(it) } -} - private fun getMiningEventsLines() = buildList { // Wind if (getSbLines().any { SbPattern.windCompassPattern.matches(it) } @@ -515,6 +514,16 @@ private fun getMagmaBossShowWhen(): Boolean { return SbPattern.magmaChamberPattern.matches(HypixelData.skyBlockArea) } +private fun getHotDogLines(): List { + return listOf(getSbLines().first { SbPattern.riftHotdogTitlePattern.matches(it) }) + + (getSbLines().first { SbPattern.timeLeftPattern.matches(it) }) + + (getSbLines().first { SbPattern.riftHotdogEatenPattern.matches(it) }) +} + +private fun getHotDogShowWhen(): Boolean { + return SbPattern.riftHotdogTitlePattern.anyMatches(getSbLines()) +} + private fun getEssenceLines(): List { return listOf(getSbLines().first { SbPattern.essencePattern.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 dd46d2a44..e59878812 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 @@ -383,6 +383,14 @@ object ScoreboardPattern { "dimension", "^\\s*§fRift Dimension$" ) + val riftHotdogTitlePattern by riftSb.pattern( + "hotdogtitle", + "^§6Hot Dog Contest$" + ) + val riftHotdogEatenPattern by riftSb.pattern( + "hotdogeaten", + "^Eaten: §.\\d+\\/\\d+$" + ) // Stats from the tablist 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 260b1ed48..f0f434b06 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 @@ -111,6 +111,8 @@ object UnknownLinesHandler { SbPattern.timeLeftPattern, SbPattern.darkAuctionCurrentItemPattern, SbPattern.coldPattern, + SbPattern.riftHotdogTitlePattern, + SbPattern.riftHotdogEatenPattern, ) unknownLines = unknownLines.filterNot { line -> -- cgit