From 3292e4197799fbfc4245241ee6c2d74b445e3c78 Mon Sep 17 00:00:00 2001 From: Duan Tao Date: Sun, 5 May 2019 11:18:33 +0800 Subject: [PATCH] Fix city state diplomacy popup title. --- core/src/com/unciv/ui/trade/DiplomacyScreen.kt | 9 +++++++-- core/src/com/unciv/ui/worldscreen/AlertPopup.kt | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt index eba595f261..6111ff59fd 100644 --- a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt +++ b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt @@ -74,7 +74,7 @@ class DiplomacyScreen:CameraStageBaseScreen() { diplomacyTable.defaults().pad(10f) val leaderName: String if (otherCiv.isCityState()) { - leaderName = otherCiv.civName + leaderName = "City state [" + otherCiv.civName + "]" } else { leaderName = "[" + otherCiv.getNation().leaderName + "] of [" + otherCiv.civName + "]" } @@ -102,7 +102,12 @@ class DiplomacyScreen:CameraStageBaseScreen() { diplomacyManager.declareWar() val responsePopup = PopupTable(this) - val otherCivLeaderName = otherCiv.getNation().leaderName + " of " + otherCiv.civName + val otherCivLeaderName: String + if (otherCiv.isCityState()) { + otherCivLeaderName = "City state [" + otherCiv.civName + "]" + } else { + otherCivLeaderName = "[" + otherCiv.getNation().leaderName + "] of [" + otherCiv.civName + "]" + } responsePopup.add(otherCivLeaderName.toLabel()) responsePopup.addSeparator() responsePopup.addGoodSizedLabel(otherCiv.getNation().attacked).row() diff --git a/core/src/com/unciv/ui/worldscreen/AlertPopup.kt b/core/src/com/unciv/ui/worldscreen/AlertPopup.kt index 57e54fde36..1a94e390f5 100644 --- a/core/src/com/unciv/ui/worldscreen/AlertPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/AlertPopup.kt @@ -19,7 +19,13 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu } fun addLeaderName(translatedNation: Nation){ - val otherCivLeaderName = "[${translatedNation.leaderName}] of [${translatedNation.getNameTranslation()}]".tr() + val otherCivLeaderName: String + if (translatedNation.isCityState()) { + otherCivLeaderName = "City state [${translatedNation.getNameTranslation()}]".tr() + } else { + otherCivLeaderName = "[${translatedNation.leaderName}] of [${translatedNation.getNameTranslation()}]".tr() + } + add(otherCivLeaderName.toLabel()) addSeparator() }