diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-02 09:56:10 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-02 09:56:10 +0200 |
commit | 2d7b3849f8a5476080f90e6c1697023166793907 (patch) | |
tree | 29fbaf4771dcdc60d5f1086e462531a937624e5e /src/main/java | |
parent | c8f83a06c0bb6fbc8a9eccc43733799d6e59b133 (diff) | |
download | skyhanni-2d7b3849f8a5476080f90e6c1697023166793907.tar.gz skyhanni-2d7b3849f8a5476080f90e6c1697023166793907.tar.bz2 skyhanni-2d7b3849f8a5476080f90e6c1697023166793907.zip |
Added option to disable qucik toggle behaviour and added /shbingotoggle and
Diffstat (limited to 'src/main/java')
3 files changed, 34 insertions, 11 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt index 4c8c455fd..66f291f26 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -133,6 +133,7 @@ object Commands { "Clear farming items saved for the Farming Fortune Guide" ) { clearFarmingItems() } registerCommand("shresetghostcounter", "Resets the ghost counter stats") { GhostUtil.reset() } + registerCommand("shbingotoggle", "Toggle the bingo card display mode") { BingoCardDisplay.toggleCommand() } } private fun usersBugFix() { diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java b/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java index b9270b03c..f777fc903 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java @@ -16,9 +16,13 @@ public class Bingo { public static class BingoCard { @Expose - @ConfigOption(name = "Enable", desc = "Displays the bingo card. Toggle by sneaking with SkyBlock menu in hand.") + @ConfigOption(name = "Enable", desc = "Displays the bingo card.") @ConfigEditorBoolean public boolean enabled = true; + @Expose + @ConfigOption(name = "Quick Toggle", desc = "Quickly toggle the bingo card or the step helper by sneaking with SkyBlock menu in hand.") + @ConfigEditorBoolean + public boolean quickToggle = true; @Expose @ConfigOption(name = "Bingo Steps", desc = "Show help with the next step in bingo instead of the bingo card. " + diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt index 7332c6571..a495d1e12 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt @@ -21,7 +21,6 @@ import net.minecraft.client.gui.GuiChat import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class BingoCardDisplay { - private val config get() = SkyHanniMod.feature.bingo.bingoCard private val MAX_PERSONAL_GOALS = 20 private val MAX_COMMUNITY_GOALS = 5 @@ -34,6 +33,8 @@ class BingoCardDisplay { } companion object { + private val config get() = SkyHanniMod.feature.bingo.bingoCard + private var displayMode = 0 val personalGoals = mutableListOf<PersonalGoal>() private val communityGoals = mutableListOf<CommunityGoal>() @@ -45,6 +46,25 @@ class BingoCardDisplay { personalGoals.clear() communityGoals.clear() } + + fun toggleCommand() { + if (!LorenzUtils.isBingoProfile) { + LorenzUtils.chat("§cThis command only works on a bingo profile!") + return + } + if (!config.enabled) { + LorenzUtils.chat("§cBingo Card is disabled in the config!") + return + } + toggleMode() + } + + private fun toggleMode() { + displayMode++ + if (displayMode == 3) { + displayMode = 0 + } + } } @SubscribeEvent @@ -116,21 +136,19 @@ class BingoCardDisplay { } private var lastSneak = false - private var displayMode = 0 @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!LorenzUtils.isBingoProfile) return if (!config.enabled) return - if (ItemUtils.isSkyBlockMenuItem(InventoryUtils.getItemInHand())) { - val sneaking = Minecraft.getMinecraft().thePlayer.isSneaking - if (lastSneak != sneaking) { - lastSneak = sneaking - if (sneaking) { - displayMode++ - if (displayMode == 3) { - displayMode = 0 + if (config.quickToggle) { + if (ItemUtils.isSkyBlockMenuItem(InventoryUtils.getItemInHand())) { + val sneaking = Minecraft.getMinecraft().thePlayer.isSneaking + if (lastSneak != sneaking) { + lastSneak = sneaking + if (sneaking) { + toggleMode() } } } |