mirror of
https://github.com/yairm210/Unciv.git
synced 2025-08-02 08:09:28 +07:00
Non-replacing buildings display uniques nicely in nation picker
This commit is contained in:
@ -62,7 +62,7 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
|
||||
private var replacementTextForUniques = ""
|
||||
|
||||
/** Used for AlertType.WonderBuilt, and as sub-text in Nation and Tech descriptions */
|
||||
fun getShortDescription(): String { // should fit in one line
|
||||
fun getShortDescription(multiline:Boolean = false): String {
|
||||
val infoList = mutableListOf<String>()
|
||||
this.clone().toString().also { if (it.isNotEmpty()) infoList += it }
|
||||
for ((key, value) in getStatPercentageBonuses(null))
|
||||
@ -76,7 +76,8 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
|
||||
}
|
||||
if (cityStrength != 0) infoList += "{City strength} +$cityStrength"
|
||||
if (cityHealth != 0) infoList += "{City health} +$cityHealth"
|
||||
return infoList.joinToString("; ") { it.tr() }
|
||||
val separator = if (multiline) "\n" else "; "
|
||||
return infoList.joinToString(separator) { it.tr() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -210,7 +210,7 @@ class Nation : RulesetObject() {
|
||||
} else if (building.replaces != null) {
|
||||
yield(FormattedLine("Replaces [${building.replaces}], which is not found in the ruleset!", indent=1))
|
||||
} else {
|
||||
yield(FormattedLine(building.getShortDescription(), indent=1))
|
||||
yield(FormattedLine(building.getShortDescription(true), indent=1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user