From 460a8c696a70faf67dcbea9c3feea5995683bafe Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 4 Dec 2023 11:42:59 +0100 Subject: Remove the background color in the difficulty once the goal is done. --- .../config/features/event/bingo/BingoCardConfig.java | 5 +++++ .../at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt | 14 +++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/bingo/BingoCardConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/bingo/BingoCardConfig.java index 2bc7e1f8f..36eaf5d6c 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/bingo/BingoCardConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/bingo/BingoCardConfig.java @@ -47,4 +47,9 @@ public class BingoCardConfig { @ConfigOption(name = "Next Tip Duration", desc = "Show the duration until the next hidden personal goal gets a tip revealed.") @ConfigEditorBoolean public Property nextTipDuration = Property.of(true); + + @Expose + @ConfigOption(name = "Hide Difficulty When Done", desc = "Remove the background color in the difficulty once the goal is done.") + @ConfigEditorBoolean + public boolean hideDoneDifficulty = true; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt index 54351750b..f08b2be2f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt @@ -4,7 +4,6 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.jsonobjects.repo.BingoJson.BingoTip import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils @@ -16,6 +15,7 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class BingoCardTips { + private val config get() = SkyHanniMod.feature.event.bingo.bingoCard @SubscribeEvent fun onItemTooltipLow(event: ItemTooltipEvent) { @@ -60,24 +60,20 @@ class BingoCardTips { val guiChest = event.gui val chest = guiChest.inventorySlots as ContainerChest - for (slot in chest.inventorySlots) { if (slot == null) continue - if (slot.slotNumber != slot.slotIndex) continue - val stack = slot.stack ?: continue - val itemName = stack.name ?: continue - val communityGoal = stack.getLore().getOrNull(1) == "ยง8Community Goal" - if (communityGoal) continue + val goal = BingoAPI.personalGoals.firstOrNull { it.slot == slot.slotNumber } ?: continue + if (config.hideDoneDifficulty && goal.done) continue - BingoAPI.tips[itemName.removeColor()]?.let { + BingoAPI.tips[goal.displayName]?.let { val difficulty = Difficulty.valueOf(it.difficulty.uppercase()) slot highlight difficulty.color.addOpacity(120) } } } - fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.event.bingo.bingoCard.bingoSplashGuide + fun isEnabled() = LorenzUtils.inSkyBlock && config.bingoSplashGuide enum class Difficulty(rawName: String, val color: LorenzColor) { EASY("Easy", LorenzColor.GREEN), -- cgit