diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-04 11:42:59 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-04 11:42:59 +0100 |
commit | 460a8c696a70faf67dcbea9c3feea5995683bafe (patch) | |
tree | 757d94838f8023d127d806f447c4ccff6a0c133f /src/main/java | |
parent | e33f0e08f18965c2bdaf38ed0c6f7ff8e8f2e07f (diff) | |
download | skyhanni-460a8c696a70faf67dcbea9c3feea5995683bafe.tar.gz skyhanni-460a8c696a70faf67dcbea9c3feea5995683bafe.tar.bz2 skyhanni-460a8c696a70faf67dcbea9c3feea5995683bafe.zip |
Remove the background color in the difficulty once the goal is done.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/event/bingo/BingoCardConfig.java | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt | 14 |
2 files changed, 10 insertions, 9 deletions
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<Boolean> 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), |