diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
4 files changed, 58 insertions, 28 deletions
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 6f52bc890..2b04d895c 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java @@ -2,30 +2,56 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; +import io.github.moulberry.moulconfig.annotations.Accordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigOption; public class Bingo { @Expose - @ConfigOption(name = "Compact Chat Messages", desc = "Shortens chat messages about skill level ups, collection gains, " + - "new area discoveries, and bestiary upgrades while on bingo.") - @ConfigEditorBoolean - public boolean compactChatMessages = true; - - @Expose - @ConfigOption(name = "Bingo Card View", desc = "Simply showing the bingo card. Toggle by sneaking with SkyBlock menu in hand.") - @ConfigEditorBoolean - public boolean cardDisplay = true; - - @Expose - @ConfigOption(name = "Bingo Steps", desc = "Show help with the next step in bingo instead of the bingo card. " + - "§cThis feature is in early development. Expect bugs and missing goals.") - @ConfigEditorBoolean - public boolean stepHelper = false; + @ConfigOption(name = "Bingo Card", desc = "") + @Accordion + public BingoCard bingoCard = new BingoCard(); + + public static class BingoCard { + @Expose + @ConfigOption(name = "Enable", desc = "Displays the bingo card. Toggle by sneaking with SkyBlock menu in hand.") + @ConfigEditorBoolean + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Bingo Steps", desc = "Show help with the next step in bingo instead of the bingo card. " + + "§cThis feature is in early development. Expect bugs and missing goals.") + @ConfigEditorBoolean + public boolean stepHelper = false; + + @Expose + public Position bingoCardPos = new Position(10, 10, false, true); + } @Expose - public Position bingoCardPos = new Position(10, 10, false, true); + @ConfigOption(name = "Compact Chat Messages", desc = "") + @Accordion + public CompactChat compactChat = new CompactChat(); + + public static class CompactChat { + + @Expose + @ConfigOption(name = "Enable", desc = "Shortens chat messages about skill level ups, collection gains, " + + "new area discoveries, bestiary upgrades and skyblock level up messages while on bingo.") + @ConfigEditorBoolean + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Hide Border", desc = "Hide the border messages before and after the compact level up messages.") + @ConfigEditorBoolean + public boolean hideBorder = true; + + @Expose + @ConfigOption(name = "Outside Bingo", desc = "Compact the level up chat messages outside of an bingo profile as well.") + @ConfigEditorBoolean + public boolean outsideBingo = false; + } @Expose @ConfigOption(name = "Minion Craft Helper", desc = "Show how many more items you need to upgrade the minion in your inventory. Especially useful for bingo.") 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 229c3fc69..1dc407bf1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt @@ -27,7 +27,7 @@ class BingoCardDisplay { private var tick = 0 private var display = listOf<String>() - private val config get() = SkyHanniMod.feature.bingo + private val config get() = SkyHanniMod.feature.bingo.bingoCard private val goalCompletePattern = "§6§lBINGO GOAL COMPLETE! §r§e(?<name>.*)".toPattern() init { @@ -54,7 +54,7 @@ class BingoCardDisplay { @SubscribeEvent fun onTick(event: TickEvent.ClientTickEvent) { if (!LorenzUtils.isBingoProfile) return - if (!config.cardDisplay) return + if (!config.enabled) return if (event.phase != TickEvent.Phase.START) return tick++ @@ -148,7 +148,7 @@ class BingoCardDisplay { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!LorenzUtils.isBingoProfile) return - if (!config.cardDisplay) return + if (!config.enabled) return val stack = Minecraft.getMinecraft().thePlayer.heldItem //TODO into ItemUtils or InventoryUtils if (ItemUtils.isSkyBlockMenuItem(stack)) { @@ -178,7 +178,7 @@ class BingoCardDisplay { @SubscribeEvent fun onChat(event: LorenzChatEvent) { if (!LorenzUtils.isBingoProfile) return - if (!config.cardDisplay) return + if (!config.enabled) return goalCompletePattern.matchMatcher(event.message) { val name = group("name") diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt index 472fe1a81..e68566ab7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt @@ -17,6 +17,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.TickEvent class BingoNextStepHelper { + private val config get() = SkyHanniMod.feature.bingo.bingoCard private var tick = 0 private var dirty = true @@ -107,7 +108,7 @@ class BingoNextStepHelper { @SubscribeEvent fun onTick(event: TickEvent.ClientTickEvent) { if (!LorenzUtils.isBingoProfile) return - if (!SkyHanniMod.feature.bingo.cardDisplay) return + if (!config.enabled) return if (event.phase != TickEvent.Phase.START) return tick++ @@ -125,7 +126,7 @@ class BingoNextStepHelper { @SubscribeEvent fun onChat(event: LorenzChatEvent) { if (!LorenzUtils.isBingoProfile) return - if (!SkyHanniMod.feature.bingo.cardDisplay) return + if (!config.enabled) return for (currentStep in currentSteps) { if (currentStep.displayName == "Obtain a Topaz Crystal") { @@ -191,7 +192,7 @@ class BingoNextStepHelper { done = true updateResult() if (!silent) { - if (SkyHanniMod.feature.bingo.stepHelper) { + if (config.stepHelper) { LorenzUtils.chat("§e[SkyHanni] A bingo goal step is done! ($displayName)") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt index c0159a5e0..1af6e521e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt @@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class CompactBingoChat { + private val config get() = SkyHanniMod.feature.bingo.compactChat private var blockedSkillLevelUp = false private var blockedSkyblockLevelUp = false @@ -20,14 +21,16 @@ class CompactBingoChat { @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { - if (!LorenzUtils.isBingoProfile) return - if (!SkyHanniMod.feature.bingo.compactChatMessages) return + if (!config.enabled) return + if (!LorenzUtils.isBingoProfile && !config.outsideBingo) return val message = event.message if (message == "§3§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") { blockedSkillLevelUp = false blockedSkyblockLevelUp = false - event.blockedReason = "compact_skill_or_skyblock_level_up" + if (config.hideBorder) { + event.blockedReason = "compact_skill_or_skyblock_level_up" + } return } @@ -86,7 +89,7 @@ class CompactBingoChat { return false } if (message == "§e§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") { - blockedCollectionLevelUp = false + blockedCollectionLevelUp = config.hideBorder return true } @@ -139,7 +142,7 @@ class CompactBingoChat { return false } if (message == "§3§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") { - blockedBestiarity = false + blockedBestiarity = config.hideBorder return true } |