mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 15:27:50 +07:00
Fixed all renamed units being called 'instanceName' (#5140)
* Fixed all renamed units being called 'instanceName' * Removed extreneous square brackets resulting in incorrect translations * Fixed translation problems
This commit is contained in:
@ -495,7 +495,7 @@ object UnitAutomation {
|
||||
if (unit.isDestroyed) return // Opening ruins _might_ have upgraded us to another unit
|
||||
if (unit.health < 80 && tryHealUnit(unit)) return
|
||||
if (tryExplore(unit)) return
|
||||
unit.civInfo.addNotification("[${unit.displayName()}] finished exploring.", unit.currentTile.position, unit.name, "OtherIcons/Sleep")
|
||||
unit.civInfo.addNotification("${unit.shortDisplayName()} finished exploring.", unit.currentTile.position, unit.name, "OtherIcons/Sleep")
|
||||
unit.action = null
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ class WorkerAutomation(
|
||||
|
||||
if (WorkerAutomationConst.consoleOutput)
|
||||
println("WorkerAutomation: ${unit.label()} -> nothing to do")
|
||||
unit.civInfo.addNotification("[${unit.displayName()}] has no work to do.", currentTile.position, unit.name, "OtherIcons/Sleep")
|
||||
unit.civInfo.addNotification("${unit.shortDisplayName()} has no work to do.", currentTile.position, unit.name, "OtherIcons/Sleep")
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -644,8 +644,8 @@ class CivilizationInfo {
|
||||
val unitToDisband = civMilitaryUnits.first()
|
||||
unitToDisband.disband()
|
||||
civMilitaryUnits -= unitToDisband
|
||||
val unitName = unitToDisband.displayName()
|
||||
addNotification("Cannot provide unit upkeep for [$unitName] - unit has been disbanded!", unitName, NotificationIcon.Death)
|
||||
val unitName = unitToDisband.shortDisplayName()
|
||||
addNotification("Cannot provide unit upkeep for $unitName - unit has been disbanded!", unitName, NotificationIcon.Death)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -111,11 +111,16 @@ class MapUnit {
|
||||
fun displayName(): String {
|
||||
val baseName =
|
||||
if (instanceName == null) "[$name]"
|
||||
else "instanceName ([$name])"
|
||||
else "$instanceName ([$name])"
|
||||
|
||||
return if (religion == null) baseName
|
||||
else "$baseName ([${getReligionDisplayName()}])"
|
||||
}
|
||||
|
||||
fun shortDisplayName(): String {
|
||||
return if (instanceName != null) "[$instanceName]"!!
|
||||
else "[$name]"
|
||||
}
|
||||
|
||||
var currentMovement: Float = 0f
|
||||
var health: Int = 100
|
||||
|
Reference in New Issue
Block a user