mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-25 23:29:47 +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() {
|
private fun Table.addStatInfo() {
|
||||||
val cityStats = cityScreen.city.cityStats
|
val cityStats = cityScreen.city.cityStats
|
||||||
|
|
||||||
|
val showFaith = cityScreen.city.civInfo.gameInfo.isReligionEnabled()
|
||||||
for (stat in Stat.values()) {
|
for (stat in Stat.values()) {
|
||||||
|
if (stat == Stat.Faith && !showFaith) continue
|
||||||
val statValuesTable = Table()
|
val statValuesTable = Table()
|
||||||
statValuesTable.touchable = Touchable.enabled
|
statValuesTable.touchable = Touchable.enabled
|
||||||
addCategory(stat.name, statValuesTable)
|
addCategory(stat.name, statValuesTable)
|
||||||
@ -241,12 +243,15 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(BaseScreen.skin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
statValuesTable.pack()
|
statValuesTable.pack()
|
||||||
val toggleButtonChar = if (showDetails) "-" else "+"
|
|
||||||
val toggleButton = toggleButtonChar.toLabel().apply { setAlignment(Align.center) }
|
if (stat != Stat.Happiness) {
|
||||||
.surroundWithCircle(25f, color = ImageGetter.getBlue())
|
val toggleButtonChar = if (showDetails) "-" else "+"
|
||||||
.surroundWithCircle(27f, false)
|
val toggleButton = toggleButtonChar.toLabel().apply { setAlignment(Align.center) }
|
||||||
statValuesTable.addActor(toggleButton)
|
.surroundWithCircle(25f, color = ImageGetter.getBlue())
|
||||||
toggleButton.setPosition(0f, statValuesTable.height, Align.topLeft)
|
.surroundWithCircle(27f, false)
|
||||||
|
statValuesTable.addActor(toggleButton)
|
||||||
|
toggleButton.setPosition(0f, statValuesTable.height, Align.topLeft)
|
||||||
|
}
|
||||||
|
|
||||||
statValuesTable.padBottom(4f)
|
statValuesTable.padBottom(4f)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user