mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 22:37:02 -04:00
Bugfix - cities with maintenance but no gold production now display gold breakdown
This commit is contained in:
parent
921dd28296
commit
46bd65e45a
@ -139,6 +139,14 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(CameraStageBaseS
|
|||||||
unifiedStatList[entry.key]!!.happiness=entry.value
|
unifiedStatList[entry.key]!!.happiness=entry.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add maintenance if relevant
|
||||||
|
|
||||||
|
val maintenance = cityStats.cityInfo.cityConstructions.getMaintenanceCosts()
|
||||||
|
if(maintenance>0)
|
||||||
|
unifiedStatList["Maintenance"]=Stats().add(Stat.Gold,-maintenance.toFloat())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(stat in Stat.values()){
|
for(stat in Stat.values()){
|
||||||
if(unifiedStatList.all { it.value.get(stat)==0f }) continue
|
if(unifiedStatList.all { it.value.get(stat)==0f }) continue
|
||||||
|
|
||||||
@ -157,13 +165,6 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(CameraStageBaseS
|
|||||||
val decimal = DecimalFormat("0.#").format(specificStatValue)
|
val decimal = DecimalFormat("0.#").format(specificStatValue)
|
||||||
statValuesTable.add("+$decimal%".toLabel()).row()
|
statValuesTable.add("+$decimal%".toLabel()).row()
|
||||||
}
|
}
|
||||||
if(stat==Stat.Gold){
|
|
||||||
val maintenance = cityStats.cityInfo.cityConstructions.getMaintenanceCosts()
|
|
||||||
if(maintenance>0){
|
|
||||||
statValuesTable.add("Maintenance".toLabel())
|
|
||||||
statValuesTable.add("-$maintenance".toLabel())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(stat==Stat.Food){
|
if(stat==Stat.Food){
|
||||||
statValuesTable.add("Food eaten".toLabel())
|
statValuesTable.add("Food eaten".toLabel())
|
||||||
statValuesTable.add(("-"+DecimalFormat("0.#").format(cityStats.foodEaten)).toLabel()).row()
|
statValuesTable.add(("-"+DecimalFormat("0.#").format(cityStats.foodEaten)).toLabel()).row()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user