From a92057eed5c9b6327a814dd2de80d72b4837459a Mon Sep 17 00:00:00 2001 From: Xander Lenstra <71121390+xlenstra@users.noreply.github.com> Date: Mon, 18 Apr 2022 10:48:03 +0200 Subject: [PATCH] Made 'go to on map' translatable & fixed crash (#6565) --- android/assets/jsons/translations/template.properties | 1 + core/src/com/unciv/ui/trade/DiplomacyScreen.kt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index 4b6e2aadcc..a177690871 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -97,6 +97,7 @@ Peace = Research Agreement = Declare war = Declare war on [civName]? = +Go to on map = Let's begin! = [civName] has declared war on us! = [leaderName] of [nation] = diff --git a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt index 3f325bed7d..80bba6127f 100644 --- a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt +++ b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt @@ -748,7 +748,7 @@ class DiplomacyScreen( diplomacyTable.add(demandsButton).row() if (isNotPlayersTurn()) demandsButton.disable() - if (otherCiv.getCapital().location in viewingCiv.exploredTiles) + if (otherCiv.cities.isNotEmpty() && otherCiv.getCapital().location in viewingCiv.exploredTiles) diplomacyTable.add(getGoToOnMapButton(otherCiv)).row() if (!otherCiv.isPlayerCivilization()) { // human players make their own choices @@ -932,7 +932,7 @@ class DiplomacyScreen( } private fun getGoToOnMapButton(civilization: CivilizationInfo): TextButton { - val goToOnMapButton = TextButton("Go To on Map", skin) + val goToOnMapButton = TextButton("Go to on map", skin) goToOnMapButton.onClick { UncivGame.Current.setWorldScreen() UncivGame.Current.worldScreen.mapHolder.setCenterPosition(civilization.getCapital().location, selectUnit = false)