Resolved #12571 - resource icons in city screen look good with resistance

This commit is contained in:
yairm210 2024-12-05 21:51:07 +02:00
parent 855479fe7a
commit 3194af64d4

View File

@ -183,11 +183,13 @@ class CityStatsTable(private val cityScreen: CityScreen) : Table() {
lowerTable.add(turnsToExpansionString.toLabel()).row() lowerTable.add(turnsToExpansionString.toLabel()).row()
lowerTable.add(turnsToPopString.toLabel()).row() lowerTable.add(turnsToPopString.toLabel()).row()
val tableWithIcons = Table() val tableWithIcons = Table() // Each row has a SINGLE actor
tableWithIcons.defaults().pad(2f) tableWithIcons.defaults().pad(2f)
if (city.isInResistance()) { if (city.isInResistance()) {
tableWithIcons.add(ImageGetter.getImage("StatIcons/Resistance")).size(20f) tableWithIcons.add(Table().apply {
tableWithIcons.add("In resistance for another [${city.getFlag(CityFlags.Resistance)}] turns".toLabel()).row() add(ImageGetter.getImage("StatIcons/Resistance")).size(20f).padRight(2f)
add("In resistance for another [${city.getFlag(CityFlags.Resistance)}] turns".toLabel())
})
} }
val resourceTable = Table() val resourceTable = Table()
@ -214,11 +216,13 @@ class CityStatsTable(private val cityScreen: CityScreen) : Table() {
else -> null to null else -> null to null
} }
if (wltkLabel != null) { if (wltkLabel != null) {
tableWithIcons.add(wltkIcon!!).size(20f).padRight(5f) tableWithIcons.add(Table().apply {
add(wltkIcon!!).size(20f).padRight(5f)
add(wltkLabel).row()
})
wltkLabel.onClick { wltkLabel.onClick {
cityScreen.openCivilopedia("Tutorial/We Love The King Day") cityScreen.openCivilopedia("Tutorial/We Love The King Day")
} }
tableWithIcons.add(wltkLabel).row()
} }
lowerTable.add(tableWithIcons).row() lowerTable.add(tableWithIcons).row()