From ccf37af4685d2f2a5344be50fea34a23ec416c8b Mon Sep 17 00:00:00 2001 From: WhoIsJohannes <126110113+WhoIsJohannes@users.noreply.github.com> Date: Mon, 17 Apr 2023 07:20:18 +0200 Subject: [PATCH] Show garrison in city screen, so that it's easier to decide whether one should produce a military unit. (#9202) --- .../ui/screens/cityscreen/CityScreenCityPickerTable.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/com/unciv/ui/screens/cityscreen/CityScreenCityPickerTable.kt b/core/src/com/unciv/ui/screens/cityscreen/CityScreenCityPickerTable.kt index 6efba04961..882e148b57 100644 --- a/core/src/com/unciv/ui/screens/cityscreen/CityScreenCityPickerTable.kt +++ b/core/src/com/unciv/ui/screens/cityscreen/CityScreenCityPickerTable.kt @@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.Touchable import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.utils.Align +import com.unciv.ui.components.UnitGroup import com.unciv.ui.components.extensions.onClick import com.unciv.ui.components.extensions.toLabel import com.unciv.ui.images.ImageGetter @@ -66,6 +67,11 @@ class CityScreenCityPickerTable(private val cityScreen: CityScreen) : Table() { cityNameTable.add(currentCityLabel) + val garrison = city.getGarrison() + if (garrison != null) { + cityNameTable.add(UnitGroup(garrison, 30f)).padLeft(5f) + } + add(cityNameTable).width(stage.width / 4) if (civInfo.cities.size > 1) {