diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt index 2d231f5c6..126212ba6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt @@ -167,20 +167,20 @@ class BingoCardDisplay { } private fun MutableList<Renderable>.addGoals(goals: MutableList<BingoGoal>, format: (BingoGoal) -> String) { - val currentlyOpen = Minecraft.getMinecraft().currentScreen is GuiInventory + val editDisplay = canEditDisplay() val showOnlyHighlighted = goals.count { it.highlight } > 0 - val filter = showOnlyHighlighted && !currentlyOpen + val filter = showOnlyHighlighted && !editDisplay val finalGoal = if (filter) { goals.filter { it.highlight } } else goals finalGoal.mapTo(this) { val currentlyHighlighted = it.highlight - val highlightColor = if (currentlyHighlighted && currentlyOpen) "§e" else "§7" + val highlightColor = if (currentlyHighlighted && editDisplay) "§e" else "§7" val display = " $highlightColor" + format(it) - if (currentlyOpen) { + if (editDisplay) { val clickName = if (currentlyHighlighted) "remove" else "add" Renderable.clickAndHover( display, @@ -223,7 +223,7 @@ class BingoCardDisplay { if (!LorenzUtils.isBingoProfile) return if (!config.enabled) return - val currentlyOpen = Minecraft.getMinecraft().currentScreen is GuiInventory + val currentlyOpen = canEditDisplay() if (inventoryOpen != currentlyOpen) { inventoryOpen = currentlyOpen update() @@ -250,6 +250,9 @@ class BingoCardDisplay { } } + private fun canEditDisplay() = + Minecraft.getMinecraft().currentScreen is GuiInventory || InventoryUtils.openInventoryName() == "Bingo Card" + @SubscribeEvent fun onBingoCardUpdate(event: BingoCardUpdateEvent) { if (!config.enabled) return |