From 2b43ecc2a03c0e03fd51674cbd2b3cff3e9ba711 Mon Sep 17 00:00:00 2001 From: martimavocado <39881008+martimavocado@users.noreply.github.com> Date: Mon, 26 Aug 2024 01:57:15 +0100 Subject: Improvement: Add toggle to UserLuck Breakdown (#2357) --- .../java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java | 6 ++++++ .../java/at/hannibal2/skyhanni/features/misc/UserLuckBreakdown.kt | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'src/main') 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 -- cgit