summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorEmpa <42304516+ItsEmpa@users.noreply.github.com>2024-04-12 14:27:44 +0200
committerGitHub <noreply@github.com>2024-04-12 14:27:44 +0200
commitd07088973b3662cfa70407a33a2ca9855605837e (patch)
tree12f9841637985a6f60fb6a26bb0f7106e5d5041a /src/main/java/at/hannibal2/skyhanni/features/misc
parent388819e61cf1229ef4a5d6ddeca1bd1dafd05e71 (diff)
downloadskyhanni-d07088973b3662cfa70407a33a2ca9855605837e.tar.gz
skyhanni-d07088973b3662cfa70407a33a2ca9855605837e.tar.bz2
skyhanni-d07088973b3662cfa70407a33a2ca9855605837e.zip
Fix + Improvement: No Bits Warning (#1425)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt
index 0b2e6069e..2529c026b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.BitsUpdateEvent
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
@@ -14,17 +15,22 @@ class NoBitsWarning {
private val config get() = SkyHanniMod.feature.misc.noBitsWarning
@SubscribeEvent
- fun onBitsUpdate(event: BitsUpdateEvent) {
+ fun onBitsGain(event: BitsUpdateEvent.BitsGain) {
if (!isEnabled()) return
- if (event.bitsToClaim != 0) return
+ if (event.bitsAvailable != 0) return
ChatUtils.clickableChat(
"§bNo Bits Available! §eClick to run /bz booster cookie.",
"bz booster cookie"
)
LorenzUtils.sendTitle("§bNo Bits Available", 5.seconds)
- SoundUtils.repeatSound(100,10, createSound("note.pling", 0.6f))
+ if (config.notificationSound) SoundUtils.repeatSound(100, 10, createSound("note.pling", 0.6f))
}
- private fun isEnabled() = LorenzUtils.inSkyBlock && config
+ @SubscribeEvent
+ fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
+ event.move(35, "misc.noBitsWarning", "misc.noBitsWarning.enabled")
+ }
+
+ private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled
}