mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 12:54:06 -04:00
Non-replacing buildings display uniques nicely in nation picker
This commit is contained in:
parent
6c708d537f
commit
5941beba26
@ -62,7 +62,7 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
|
|||||||
private var replacementTextForUniques = ""
|
private var replacementTextForUniques = ""
|
||||||
|
|
||||||
/** Used for AlertType.WonderBuilt, and as sub-text in Nation and Tech descriptions */
|
/** 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>()
|
val infoList = mutableListOf<String>()
|
||||||
this.clone().toString().also { if (it.isNotEmpty()) infoList += it }
|
this.clone().toString().also { if (it.isNotEmpty()) infoList += it }
|
||||||
for ((key, value) in getStatPercentageBonuses(null))
|
for ((key, value) in getStatPercentageBonuses(null))
|
||||||
@ -76,7 +76,8 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
|
|||||||
}
|
}
|
||||||
if (cityStrength != 0) infoList += "{City strength} +$cityStrength"
|
if (cityStrength != 0) infoList += "{City strength} +$cityStrength"
|
||||||
if (cityHealth != 0) infoList += "{City health} +$cityHealth"
|
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) {
|
} else if (building.replaces != null) {
|
||||||
yield(FormattedLine("Replaces [${building.replaces}], which is not found in the ruleset!", indent=1))
|
yield(FormattedLine("Replaces [${building.replaces}], which is not found in the ruleset!", indent=1))
|
||||||
} else {
|
} else {
|
||||||
yield(FormattedLine(building.getShortDescription(), indent=1))
|
yield(FormattedLine(building.getShortDescription(true), indent=1))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user