mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 23:40:01 +07:00
More field deprecation
This commit is contained in:
@ -256,7 +256,7 @@ class Nation : RulesetObject() {
|
||||
unique.text.tr(), indent = 1)
|
||||
}
|
||||
for (promotion in unit.promotions.filter { it !in originalUnit.promotions }) {
|
||||
val effect = ruleset.unitPromotions[promotion]!!.uniquesWithEffect()
|
||||
val effect = ruleset.unitPromotions[promotion]!!.uniques
|
||||
// "{$promotion} ({$effect})" won't work as effect may contain [] and tr() does not support that kind of nesting
|
||||
textList += FormattedLine(
|
||||
"${promotion.tr()} (${effect.joinToString(",") { it.tr() }})",
|
||||
|
@ -409,12 +409,6 @@ class Ruleset {
|
||||
}
|
||||
|
||||
for (promotion in unitPromotions.values) {
|
||||
if (promotion.effect != "")
|
||||
lines.add(
|
||||
"`Promotion.effect` used in ${promotion.name} is deprecated, please use `uniques` instead",
|
||||
RulesetErrorSeverity.WarningOptionsOnly
|
||||
)
|
||||
|
||||
checkUniques(promotion, lines, UniqueType.UniqueComplianceErrorSeverity.RulesetInvariant)
|
||||
}
|
||||
|
||||
|
@ -12,16 +12,8 @@ import com.unciv.ui.civilopedia.FormattedLine
|
||||
class Promotion : RulesetObject() {
|
||||
var prerequisites = listOf<String>()
|
||||
|
||||
@Deprecated("As of 3.16.12", ReplaceWith("uniques"))
|
||||
var effect = ""
|
||||
|
||||
var unitTypes = listOf<String>() // The json parser wouldn't agree to deserialize this as a list of UnitTypes. =(
|
||||
|
||||
fun uniquesWithEffect() = sequence {
|
||||
if (effect.isNotEmpty()) yield(effect)
|
||||
yieldAll(uniques)
|
||||
}
|
||||
|
||||
override fun getUniqueTarget() = UniqueTarget.Promotion
|
||||
|
||||
|
||||
@ -29,7 +21,7 @@ class Promotion : RulesetObject() {
|
||||
fun getDescription(promotionsForUnitType: Collection<Promotion>):String {
|
||||
val textList = ArrayList<String>()
|
||||
|
||||
for (unique in uniquesWithEffect()) {
|
||||
for (unique in uniques) {
|
||||
textList += unique.tr()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user