From 8a9bbf4154f4c3ec5f697d540e71db9a93593185 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Tue, 3 Mar 2020 17:43:07 +0200 Subject: [PATCH] City state diplomacy screen cleanup --- core/src/com/unciv/ui/trade/DiplomacyScreen.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt index fa8368452e..fcc31f5a89 100644 --- a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt +++ b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt @@ -99,16 +99,15 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() { val ally = otherCiv.getAllyCiv() if (ally != "") { - diplomacyTable.add(("Ally: ".tr() + ally.tr() + " " + "Influence: ".tr() - + otherCiv.getDiplomacyManager(ally).influence.toString().tr()).toLabel()).row() + val allyString = "{Ally: }{$ally} {Influence: }".tr() + + otherCiv.getDiplomacyManager(ally).influence.toString() + diplomacyTable.add(allyString.toLabel()).row() } - val nextLevelString: String - if (otherCivDiplomacyManager.influence.toInt() < 30) { - nextLevelString = "Reach 30 for friendship." - } else if (ally == viewingCiv.civName) { - nextLevelString = "" - } else { - nextLevelString = "Reach highest influence above 60 for alliance." + + val nextLevelString = when { + otherCivDiplomacyManager.influence.toInt() < 30 -> "Reach 30 for friendship." + ally == viewingCiv.civName -> "" + else -> "Reach highest influence above 60 for alliance." } diplomacyTable.add(getRelationshipTable(otherCivDiplomacyManager)).row() if (nextLevelString != "") { @@ -158,6 +157,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() { tradeLogic.currentTrade.theirOffers.add(TradeOffer(Constants.peaceTreaty, TradeType.Treaty, 30)) tradeLogic.acceptTrade() updateLeftSideTable() + updateRightSide(otherCiv) }, this).open() } diplomacyTable.add(peaceButton).row()