diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-05-31 02:44:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-31 02:44:55 +0200 |
commit | 39797310d19ae83be9d4b9180ba38e8961177187 (patch) | |
tree | 244f411a4235e7f5aada55533758eb787bc264cd | |
parent | 3c020f8f3472907e7160268e8ebc8dcc151372e2 (diff) | |
download | skyhanni-39797310d19ae83be9d4b9180ba38e8961177187.tar.gz skyhanni-39797310d19ae83be9d4b9180ba38e8961177187.tar.bz2 skyhanni-39797310d19ae83be9d4b9180ba38e8961177187.zip |
Improvement: Fewer diana yellow chat moments (#1954)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt index ebdb83bcf..e2e323933 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.events.BurrowGuessEvent import at.hannibal2.skyhanni.events.ItemClickEvent +import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.features.event.diana.DianaAPI.isDianaSpade import at.hannibal2.skyhanni.test.command.ErrorManager @@ -23,6 +24,7 @@ class DianaFixChat { private var lastParticleQualityPrompt = SimpleTimeMark.farPast() private var lastToggleMusicPrompt = SimpleTimeMark.farPast() private var errorCounter = 0 + private var successfulCounter = 0 private var lastSpadeUse = SimpleTimeMark.farPast() private var lastErrorTime = SimpleTimeMark.farPast() @@ -51,7 +53,9 @@ class DianaFixChat { private fun noGuessFound() { errorCounter++ if (errorCounter == 1) { - ChatUtils.chat("Could not find Diana Guess using sound and particles, please try again. (Was this a funny sound easter egg?)") + if (successfulCounter < 5) { + ChatUtils.chat("Could not find Diana Guess using sound and particles, please try again. (Was this a funny sound easter egg?)") + } return } @@ -86,7 +90,8 @@ class DianaFixChat { ErrorManager.logErrorStateWithData( "Could not find diana guess point", "diana guess point failed to load after /pq and /togglemusic", - "errorCounter" to errorCounter + "errorCounter" to errorCounter, + "successfulCounter" to successfulCounter, ) } } @@ -118,6 +123,12 @@ class DianaFixChat { hasSetParticleQuality = false hasSetToggleMusic = false errorCounter = 0 + successfulCounter++ + } + + @SubscribeEvent + fun onWorldChange(event: LorenzWorldChangeEvent) { + successfulCounter = 0 } private fun isEnabled() = DianaAPI.isDoingDiana() && config.burrowsSoopyGuess |