From 9f0e74be1f0bd4b72fe552dd1166dcfa668fd2e3 Mon Sep 17 00:00:00 2001 From: JackRainy Date: Sun, 23 Feb 2020 11:25:11 +0200 Subject: [PATCH] Display the current amount of gold in the prompt dialog (#1995) --- .../assets/jsons/translationsByLanguage/Russian.properties | 1 + .../assets/jsons/translationsByLanguage/Ukrainian.properties | 3 ++- .../assets/jsons/translationsByLanguage/template.properties | 1 + core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt | 4 +++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/android/assets/jsons/translationsByLanguage/Russian.properties b/android/assets/jsons/translationsByLanguage/Russian.properties index 598f5fe2b3..642962f4d0 100644 --- a/android/assets/jsons/translationsByLanguage/Russian.properties +++ b/android/assets/jsons/translationsByLanguage/Russian.properties @@ -854,6 +854,7 @@ Raze city = Разрушить город Stop razing city = Отменить разрушение города Buy for [amount] gold = Купить за [amount] золота Buy = Купить +Currently you have [amount] gold. = Сейчас у вас есть [amount] золота. Would you like to purchase [constructionName] for [buildingGoldCost] gold? = Хотите купить [constructionName] за [buildingGoldCost] золота? Maintenance cost = Стоимость обслуживания Pick construction = Выбрать здание diff --git a/android/assets/jsons/translationsByLanguage/Ukrainian.properties b/android/assets/jsons/translationsByLanguage/Ukrainian.properties index 6adf6ef9e5..686d2172ec 100644 --- a/android/assets/jsons/translationsByLanguage/Ukrainian.properties +++ b/android/assets/jsons/translationsByLanguage/Ukrainian.properties @@ -858,7 +858,8 @@ Raze city = Зруйнувати місто Stop razing city = Зупинити руйнування міста Buy for [amount] gold = Купити за [amount] золота Buy = Купити -Would you like to purchase [constructionName] for [buildingGoldCost] gold? = Чи хотіли б ви придбати [constructionName] за [buildingGoldCost]? +Currently you have [amount] gold. = Зараз у вас в наявності [amount] золота. +Would you like to purchase [constructionName] for [buildingGoldCost] gold? = Бажаєте придбати [constructionName] за [buildingGoldCost] золота? Maintenance cost = Вартість обслуговування Pick construction = Вибрати споруду Pick improvement = Вибрати вдосконалення diff --git a/android/assets/jsons/translationsByLanguage/template.properties b/android/assets/jsons/translationsByLanguage/template.properties index 50252fe205..16a6fdc3bd 100644 --- a/android/assets/jsons/translationsByLanguage/template.properties +++ b/android/assets/jsons/translationsByLanguage/template.properties @@ -854,6 +854,7 @@ Raze city = Stop razing city = Buy for [amount] gold = Buy = +Currently you have [amount] gold. = Would you like to purchase [constructionName] for [buildingGoldCost] gold? = Maintenance cost = Pick construction = diff --git a/core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt b/core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt index c58bf65db1..9e0dbfda17 100644 --- a/core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt +++ b/core/src/com/unciv/ui/cityscreen/ConstructionsTable.kt @@ -288,7 +288,9 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre button.add(ImageGetter.getStatIcon(Stat.Gold.name)).size(20f).padBottom(2f) button.onClick(UncivSound.Coin) { - YesNoPopup("Would you like to purchase [${construction.name}] for [$constructionGoldCost] gold?".tr(), { + val purchasePrompt = "Currently you have [${city.civInfo.gold}] gold.".tr() + "\n\n" + + "Would you like to purchase [${construction.name}] for [$constructionGoldCost] gold?".tr() + YesNoPopup(purchasePrompt, { cityConstructions.purchaseConstruction(construction.name) if (isSelectedQueueEntry()) { // currentConstruction is removed from the queue by purchaseConstruction