Made 'go to on map' translatable & fixed crash (#6565)

This commit is contained in:
Xander Lenstra 2022-04-18 10:48:03 +02:00 committed by GitHub
parent 3d93dafb13
commit a92057eed5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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] =

View File

@ -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)