From effec4856c6b83251057f9d42aa84b6e65ec20a7 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 20 Jan 2019 22:44:09 +0200 Subject: [PATCH] Resolved #424 and upgraded gradle --- android/assets/jsons/Translations.json | 5 +++++ build.gradle | 2 +- core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt | 9 ++++++--- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/android/assets/jsons/Translations.json b/android/assets/jsons/Translations.json index 37ac7da93c..b8aa61abf3 100644 --- a/android/assets/jsons/Translations.json +++ b/android/assets/jsons/Translations.json @@ -662,6 +662,11 @@ Simplified_Chinese:"购买花费 [amount] 钱" Portuguese:"Comprar por [amount] peças de ouro" } + + "Buy":{ // for when the construction is a wonder/special and can't be bought, the button is disabled but still displays text + } + + "Would you like to purchase [constructionName] for [buildingGoldCost] gold?":{} "Maintenance cost":{ Italian:"Costo di manutenzione" diff --git a/build.gradle b/build.gradle index 6f44677442..a7bded603e 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ buildscript { } dependencies { classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6' - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.3.0' classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.1' } } diff --git a/core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt b/core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt index b7319ebb47..d1e68f06b2 100644 --- a/core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt +++ b/core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt @@ -14,6 +14,7 @@ import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.tr import com.unciv.models.gamebasics.unit.BaseUnit import com.unciv.ui.utils.* +import com.unciv.ui.worldscreen.optionstable.YesNoPopupTable class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScreen.skin){ @@ -128,14 +129,16 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre val buildingGoldCost = construction.getGoldCost(city.civInfo.policies.getAdoptedPolicies()) purchaseConstructionButton = TextButton("Buy for [$buildingGoldCost] gold".tr(), CameraStageBaseScreen.skin) purchaseConstructionButton.onClick("coin") { - city.cityConstructions.purchaseBuilding(city.cityConstructions.currentConstruction) - update() + YesNoPopupTable("Would you like to purchase [${construction.name}] for [$buildingGoldCost] gold?".tr(), { + city.cityConstructions.purchaseBuilding(city.cityConstructions.currentConstruction) + update() + }, cityScreen) } if (buildingGoldCost > city.civInfo.gold) { purchaseConstructionButton.disable() } } else { - purchaseConstructionButton = TextButton("Buy", CameraStageBaseScreen.skin) + purchaseConstructionButton = TextButton("Buy".tr(), CameraStageBaseScreen.skin) purchaseConstructionButton.disable() } add(purchaseConstructionButton).pad(10f).row() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 33d01fa641..0ed7f1d13e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Dec 02 12:14:58 IST 2018 +#Sun Jan 20 22:21:26 IST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip