mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 20:59:18 +07:00
Unit name translation (#4635)
This commit is contained in:
@ -89,11 +89,14 @@ class MapUnit {
|
||||
|
||||
/**
|
||||
* Name which should be displayed in UI
|
||||
*
|
||||
* Note this is translated after being returned from this function, so let's pay
|
||||
* attention to combined names (renamed units, religion).
|
||||
*/
|
||||
fun displayName(): String {
|
||||
val name = if (instanceName == null) name
|
||||
else "$instanceName (${name})"
|
||||
return if (religion != null && maxReligionSpreads() > 0) "$name ($religion)"
|
||||
else "$instanceName ({${name}})"
|
||||
return if (religion != null && maxReligionSpreads() > 0) "[$name] ([$religion])"
|
||||
else name
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,6 @@ class IdleUnitButton (
|
||||
|
||||
val image = ImageGetter.getImage("OtherIcons/BackArrow")
|
||||
|
||||
fun hasIdleUnits() = unitTable.worldScreen.viewingCiv.getIdleUnits().any()
|
||||
|
||||
init {
|
||||
val imageSize = 25f
|
||||
if(!previous) {
|
||||
|
@ -91,7 +91,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
|
||||
val position = selectedUnit?.currentTile?.position
|
||||
?: selectedCity?.location
|
||||
if (position != null)
|
||||
worldScreen.mapHolder.setCenterPosition(position, false, false)
|
||||
worldScreen.mapHolder.setCenterPosition(position, immediately = false, selectUnit = false)
|
||||
}
|
||||
}).expand()
|
||||
|
||||
@ -109,7 +109,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
|
||||
}
|
||||
}
|
||||
|
||||
if (prevIdleUnitButton.hasIdleUnits()) { // more efficient to do this check once for both
|
||||
if (worldScreen.viewingCiv.getIdleUnits().any()) { // more efficient to do this check once for both
|
||||
prevIdleUnitButton.enable()
|
||||
nextIdleUnitButton.enable()
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user