Fix a few applications of the "hidden from users" modifer (#11186)

* Respect hidden modifier in a nation's unique improvements display

* Respect hidden modifier in the Unhappiness stat overview

* No auto-icons for an ExpanderTab title
This commit is contained in:
SomeTroglodyte
2024-02-24 21:38:02 +01:00
committed by GitHub
parent 6092702f96
commit 84902b7957
3 changed files with 8 additions and 5 deletions

View File

@ -253,8 +253,10 @@ class Nation : RulesetObject() {
) )
} }
} }
for (unique in improvement.uniques) for (unique in improvement.uniqueObjects) {
if (unique.isHiddenToUsers()) continue
yield(FormattedLine(unique, indent = 1)) yield(FormattedLine(unique, indent = 1))
}
} }
} }

View File

@ -54,7 +54,7 @@ class ExpanderTab(
} }
val header = Table(skin) // Header with label and icon, touchable to show/hide val header = Table(skin) // Header with label and icon, touchable to show/hide
private val headerLabel = title.toLabel(fontSize = fontSize) private val headerLabel = title.toLabel(fontSize = fontSize, hideIcons = true)
private val headerIcon = ImageGetter.getImage(arrowImage) private val headerIcon = ImageGetter.getImage(arrowImage)
private val contentWrapper = Table() // Wrapper for innerTable, this is what will be shown/hidden private val contentWrapper = Table() // Wrapper for innerTable, this is what will be shown/hidden

View File

@ -137,10 +137,11 @@ class StatsOverviewTab(
uniques = sequenceOf( uniques = sequenceOf(
UniqueType.ConditionalBetweenHappiness, UniqueType.ConditionalBetweenHappiness,
UniqueType.ConditionalBelowHappiness UniqueType.ConditionalBelowHappiness
).flatMap { conditional -> ).flatMap { conditionalType ->
viewingPlayer.getTriggeredUniques(conditional) viewingPlayer.getTriggeredUniques(conditionalType)
.sortedBy { it.type } // otherwise order might change as a HashMap is involved .sortedBy { it.type } // otherwise order might change as a HashMap is involved
}.toSet() }.filterNot { it.isHiddenToUsers() }
.toSet()
show = uniques.isNotEmpty() show = uniques.isNotEmpty()
} }