From c6d054431c5d7535b0c7111b3f6c627f15c3cbfb Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 29 Mar 2020 01:51:33 +0300 Subject: [PATCH] Cities in unit overview are translated - #2242 --- core/src/com/unciv/logic/civilization/TechManager.kt | 5 +++-- core/src/com/unciv/ui/EmpireOverviewScreen.kt | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/com/unciv/logic/civilization/TechManager.kt b/core/src/com/unciv/logic/civilization/TechManager.kt index 96925992..380cfa59 100644 --- a/core/src/com/unciv/logic/civilization/TechManager.kt +++ b/core/src/com/unciv/logic/civilization/TechManager.kt @@ -234,8 +234,9 @@ class TechManager { ) } } - getRuleset().policyBranches.values.filter { it.era == currentEra } - .forEach { civInfo.addNotification("[" + it.name + "] policy branch unlocked!", null, Color.PURPLE) } + for (it in getRuleset().policyBranches.values.filter { it.era == currentEra }) { + civInfo.addNotification("[" + it.name + "] policy branch unlocked!", null, Color.PURPLE) + } } for(revealedResource in getRuleset().tileResources.values.filter{ techName == it.revealedBy }){ diff --git a/core/src/com/unciv/ui/EmpireOverviewScreen.kt b/core/src/com/unciv/ui/EmpireOverviewScreen.kt index 7ec67b73..e3245bfa 100644 --- a/core/src/com/unciv/ui/EmpireOverviewScreen.kt +++ b/core/src/com/unciv/ui/EmpireOverviewScreen.kt @@ -345,7 +345,8 @@ class EmpireOverviewScreen(private val viewingPlayer:CivilizationInfo) : CameraS table.row() table.addSeparator() - for(unit in viewingPlayer.getCivUnits().sortedWith(compareBy({it.name},{!it.due},{it.currentMovement<0.1f},{abs(it.currentTile.position.x)+abs(it.currentTile.position.y)}))) { + for(unit in viewingPlayer.getCivUnits().sortedWith(compareBy({it.name},{!it.due}, + {it.currentMovement<0.1f},{abs(it.currentTile.position.x)+abs(it.currentTile.position.y)}))) { val baseUnit = unit.baseUnit() val button = TextButton(unit.name.tr(), skin) button.onClick { @@ -359,7 +360,7 @@ class EmpireOverviewScreen(private val viewingPlayer:CivilizationInfo) : CameraS if(baseUnit.rangedStrength>0) table.add(baseUnit.rangedStrength.toString()) else table.add() table.add(DecimalFormat("0.#").format(unit.currentMovement)+"/"+unit.getMaxMovement()) val closestCity = unit.getTile().getTilesInDistance(3).firstOrNull{it.isCityCenter()} - if (closestCity!=null) table.add(closestCity.getCity()!!.name) else table.add() + if (closestCity!=null) table.add(closestCity.getCity()!!.name.tr()) else table.add() val promotionsTable = Table() val promotionsForUnit = unit.civInfo.gameInfo.ruleSet.unitPromotions.values.filter { unit.promotions.promotions.contains(it.name) } // force same sorting as on picker (.sorted() would be simpler code, but...) for(promotion in promotionsForUnit)