Cities in unit overview are translated - #2242

This commit is contained in:
Yair Morgenstern 2020-03-29 01:51:33 +03:00
parent 29624bfa12
commit c6d054431c
2 changed files with 6 additions and 4 deletions

View file

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

View file

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