Unit name translation (#4635)

This commit is contained in:
SomeTroglodyte
2021-07-25 18:05:56 +02:00
committed by GitHub
parent 966f70d0d4
commit 3e482182b3
4 changed files with 12 additions and 20 deletions

View File

@ -3336,20 +3336,11 @@ Send your best explorers on a quest to discover Natural Wonders. Nobody knows th
#################### Lines from Religions from Civ V - Vanilla #################### #################### Lines from Religions from Civ V - Vanilla ####################
# Requires translation! Buddhism = Buddhismus
Buddhism = Christianity = Christentum
Hinduism = Hinduismus
# Requires translation! Islam = Islam
Christianity = Taoism = Taoismus
# Requires translation!
Hinduism =
# Requires translation!
Islam =
# Requires translation!
Taoism =
#################### Lines from Specialists from Civ V - Vanilla #################### #################### Lines from Specialists from Civ V - Vanilla ####################

View File

@ -89,11 +89,14 @@ class MapUnit {
/** /**
* Name which should be displayed in UI * 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 { fun displayName(): String {
val name = if (instanceName == null) name val name = if (instanceName == null) name
else "$instanceName (${name})" else "$instanceName ({${name}})"
return if (religion != null && maxReligionSpreads() > 0) "$name ($religion)" return if (religion != null && maxReligionSpreads() > 0) "[$name] ([$religion])"
else name else name
} }

View File

@ -18,8 +18,6 @@ class IdleUnitButton (
val image = ImageGetter.getImage("OtherIcons/BackArrow") val image = ImageGetter.getImage("OtherIcons/BackArrow")
fun hasIdleUnits() = unitTable.worldScreen.viewingCiv.getIdleUnits().any()
init { init {
val imageSize = 25f val imageSize = 25f
if(!previous) { if(!previous) {

View File

@ -91,7 +91,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
val position = selectedUnit?.currentTile?.position val position = selectedUnit?.currentTile?.position
?: selectedCity?.location ?: selectedCity?.location
if (position != null) if (position != null)
worldScreen.mapHolder.setCenterPosition(position, false, false) worldScreen.mapHolder.setCenterPosition(position, immediately = false, selectUnit = false)
} }
}).expand() }).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() prevIdleUnitButton.enable()
nextIdleUnitButton.enable() nextIdleUnitButton.enable()
} else { } else {