diff options
author | martimavocado <39881008+martimavocado@users.noreply.github.com> | 2024-08-26 01:57:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-26 02:57:15 +0200 |
commit | 2b43ecc2a03c0e03fd51674cbd2b3cff3e9ba711 (patch) | |
tree | bc97d9b09228b2dc04fff8c523f2c570756e0c9f | |
parent | 03a1d0eeaca98c004dee6e8eacf3be0c73090be1 (diff) | |
download | skyhanni-2b43ecc2a03c0e03fd51674cbd2b3cff3e9ba711.tar.gz skyhanni-2b43ecc2a03c0e03fd51674cbd2b3cff3e9ba711.tar.bz2 skyhanni-2b43ecc2a03c0e03fd51674cbd2b3cff3e9ba711.zip |
Improvement: Add toggle to UserLuck Breakdown (#2357)
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/UserLuckBreakdown.kt | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java index beb7f2225..95d3281ec 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java @@ -303,4 +303,10 @@ public class MiscConfig { @ConfigEditorBoolean @FeatureToggle public boolean maintainGameVolume = false; + + @Expose + @ConfigOption(name = "SkyHanni User Luck", desc = "Shows SkyHanni User Luck in the SkyBlock Stats.") + @ConfigEditorBoolean + @FeatureToggle + public boolean userluckEnabled = true; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/UserLuckBreakdown.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/UserLuckBreakdown.kt index 8592a0d72..d4532a775 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/UserLuckBreakdown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/UserLuckBreakdown.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.misc +import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -33,6 +34,7 @@ object UserLuckBreakdown { private var skillCalcCoolDown = SimpleTimeMark.farPast() private val storage get() = ProfileStorageData.playerSpecific + private val config get() = SkyHanniMod.feature.misc private lateinit var mainLuckItem: ItemStack private val mainLuckID = "ENDER_PEARL".asInternalName() @@ -71,6 +73,7 @@ object UserLuckBreakdown { @SubscribeEvent fun replaceItem(event: ReplaceItemEvent) { + if (!config.userluckEnabled) return if (event.inventory !is ContainerLocalMenu) return if (!inMiscStats) return @@ -151,6 +154,7 @@ object UserLuckBreakdown { @SubscribeEvent fun onHoverItem(event: LorenzToolTipEvent) { + if (!config.userluckEnabled) return if (!LorenzUtils.inSkyBlock) return if (skillCalcCoolDown.passedSince() > 3.seconds) { skillCalcCoolDown = SimpleTimeMark.now() @@ -212,6 +216,7 @@ object UserLuckBreakdown { @SubscribeEvent fun onStackClick(event: GuiContainerEvent.SlotClickEvent) { + if (!config.userluckEnabled) return if (!inMiscStats) return val limboUserLuck = storage?.limbo?.userLuck ?: 0.0f if (limboUserLuck == 0.0f && !showAllStats) return |