Another minor bugfix

This commit is contained in:
Yair Morgenstern 2018-10-02 00:10:11 +03:00
parent 5beac5cd03
commit b99d6c67b6
3 changed files with 6 additions and 5 deletions

View file

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.game"
minSdkVersion 14
targetSdkVersion 26
versionCode 141
versionName "2.8.9"
versionCode 142
versionName "2.8.10"
}
buildTypes {
release {

View file

@ -80,6 +80,7 @@ class CityConstructions {
else if (GameBasics.Units.containsKey(constructionName))
return GameBasics.Units[constructionName]!!
else{
if(constructionName=="") return getConstruction("Nothing")
val special = SpecialConstruction.getSpecialConstructions().firstOrNull{it.name==constructionName}
if(special!=null) return special
}
@ -120,10 +121,9 @@ class CityConstructions {
// Let's try to remove the building from the city, and see if we can still build it (we need to remove because of wonders etc.)
val saveCurrentConstruction = currentConstruction
currentConstruction = "lie"
currentConstruction = ""
if (!construction.isBuildable(this)) {
// We can't build this building anymore! (Wonder has been built / resource is gone / etc.)
currentConstruction=""
cityInfo.civInfo.addNotification("Cannot continue work on [$saveCurrentConstruction]", cityInfo.location, Color.BROWN)
Automation().chooseNextConstruction(this)
construction = getConstruction(currentConstruction)

View file

@ -174,8 +174,9 @@ class WorldScreen : CameraStageBaseScreen() {
val percentageComplete = civInfo.tech.costOfTech(tech) / civInfo.tech.costOfTech(tech).toFloat()
// todo
techButton.add()
val turnsToTech = civInfo.tech.turnsToTech(tech)
techButton.add(Label(tech.tr() + "\r\n"
+ civInfo.tech.turnsToTech(tech) + " {turns}".tr(),skin)
+ turnsToTech + (if(turnsToTech>1) " {turns}".tr() else " {turn}".tr()),skin)
.setFontColor(Color.WHITE).setFont(22))
}