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
2 changed files with 3 additions and 2 deletions

View File

@ -97,6 +97,7 @@ Peace =
Research Agreement = Research Agreement =
Declare war = Declare war =
Declare war on [civName]? = Declare war on [civName]? =
Go to on map =
Let's begin! = Let's begin! =
[civName] has declared war on us! = [civName] has declared war on us! =
[leaderName] of [nation] = [leaderName] of [nation] =

View File

@ -748,7 +748,7 @@ class DiplomacyScreen(
diplomacyTable.add(demandsButton).row() diplomacyTable.add(demandsButton).row()
if (isNotPlayersTurn()) demandsButton.disable() 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() diplomacyTable.add(getGoToOnMapButton(otherCiv)).row()
if (!otherCiv.isPlayerCivilization()) { // human players make their own choices if (!otherCiv.isPlayerCivilization()) { // human players make their own choices
@ -932,7 +932,7 @@ class DiplomacyScreen(
} }
private fun getGoToOnMapButton(civilization: CivilizationInfo): TextButton { private fun getGoToOnMapButton(civilization: CivilizationInfo): TextButton {
val goToOnMapButton = TextButton("Go To on Map", skin) val goToOnMapButton = TextButton("Go to on map", skin)
goToOnMapButton.onClick { goToOnMapButton.onClick {
UncivGame.Current.setWorldScreen() UncivGame.Current.setWorldScreen()
UncivGame.Current.worldScreen.mapHolder.setCenterPosition(civilization.getCapital().location, selectUnit = false) UncivGame.Current.worldScreen.mapHolder.setCenterPosition(civilization.getCapital().location, selectUnit = false)