mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-16 18:59:15 +07:00
Hide irrelevant items from CityInfoTable stats (#6254)
This commit is contained in:
@ -159,7 +159,9 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(BaseScreen.skin)
|
||||
private fun Table.addStatInfo() {
|
||||
val cityStats = cityScreen.city.cityStats
|
||||
|
||||
val showFaith = cityScreen.city.civInfo.gameInfo.isReligionEnabled()
|
||||
for (stat in Stat.values()) {
|
||||
if (stat == Stat.Faith && !showFaith) continue
|
||||
val statValuesTable = Table()
|
||||
statValuesTable.touchable = Touchable.enabled
|
||||
addCategory(stat.name, statValuesTable)
|
||||
@ -241,12 +243,15 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(BaseScreen.skin)
|
||||
}
|
||||
|
||||
statValuesTable.pack()
|
||||
val toggleButtonChar = if (showDetails) "-" else "+"
|
||||
val toggleButton = toggleButtonChar.toLabel().apply { setAlignment(Align.center) }
|
||||
.surroundWithCircle(25f, color = ImageGetter.getBlue())
|
||||
.surroundWithCircle(27f, false)
|
||||
statValuesTable.addActor(toggleButton)
|
||||
toggleButton.setPosition(0f, statValuesTable.height, Align.topLeft)
|
||||
|
||||
if (stat != Stat.Happiness) {
|
||||
val toggleButtonChar = if (showDetails) "-" else "+"
|
||||
val toggleButton = toggleButtonChar.toLabel().apply { setAlignment(Align.center) }
|
||||
.surroundWithCircle(25f, color = ImageGetter.getBlue())
|
||||
.surroundWithCircle(27f, false)
|
||||
statValuesTable.addActor(toggleButton)
|
||||
toggleButton.setPosition(0f, statValuesTable.height, Align.topLeft)
|
||||
}
|
||||
|
||||
statValuesTable.padBottom(4f)
|
||||
}
|
||||
|
Reference in New Issue
Block a user