Fixed bug in GetProductionCost that was probably caused by the construction changing while the city button was rendering

This commit is contained in:
Yair Morgenstern 2019-05-28 23:09:47 +03:00
parent 8f81fd0c3d
commit b6512535fb
2 changed files with 4 additions and 4 deletions

View File

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.app"
minSdkVersion 14
targetSdkVersion 28
versionCode 248
versionName "2.16.10-patch1"
versionCode 249
versionName "2.17.0"
}
// Had to add this crap for Travis to build, it wanted to sign the app

View File

@ -149,8 +149,8 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
group.addActor(label)
val adoptedPolicies = cityConstructions.cityInfo.civInfo.policies.adoptedPolicies
val constructionPercentage = cityConstructions.getWorkDone(cityConstructions.currentConstruction) /
cityConstructions.getCurrentConstruction().getProductionCost(adoptedPolicies).toFloat()
val constructionPercentage = cityConstructions.getWorkDone(cityCurrentConstruction.name) /
cityCurrentConstruction.getProductionCost(adoptedPolicies).toFloat()
val productionBar = ImageGetter.getProgressBarVertical(2f, groupHeight, constructionPercentage
, Color.BROWN.cpy().lerp(Color.WHITE, 0.5f), Color.BLACK)
productionBar.x = 10f