mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
More field deprecation
This commit is contained in:
parent
bad6692207
commit
6e6192c369
@ -256,7 +256,7 @@ class Nation : RulesetObject() {
|
|||||||
unique.text.tr(), indent = 1)
|
unique.text.tr(), indent = 1)
|
||||||
}
|
}
|
||||||
for (promotion in unit.promotions.filter { it !in originalUnit.promotions }) {
|
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
|
// "{$promotion} ({$effect})" won't work as effect may contain [] and tr() does not support that kind of nesting
|
||||||
textList += FormattedLine(
|
textList += FormattedLine(
|
||||||
"${promotion.tr()} (${effect.joinToString(",") { it.tr() }})",
|
"${promotion.tr()} (${effect.joinToString(",") { it.tr() }})",
|
||||||
|
@ -409,12 +409,6 @@ class Ruleset {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (promotion in unitPromotions.values) {
|
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)
|
checkUniques(promotion, lines, UniqueType.UniqueComplianceErrorSeverity.RulesetInvariant)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,16 +12,8 @@ import com.unciv.ui.civilopedia.FormattedLine
|
|||||||
class Promotion : RulesetObject() {
|
class Promotion : RulesetObject() {
|
||||||
var prerequisites = listOf<String>()
|
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. =(
|
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
|
override fun getUniqueTarget() = UniqueTarget.Promotion
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +21,7 @@ class Promotion : RulesetObject() {
|
|||||||
fun getDescription(promotionsForUnitType: Collection<Promotion>):String {
|
fun getDescription(promotionsForUnitType: Collection<Promotion>):String {
|
||||||
val textList = ArrayList<String>()
|
val textList = ArrayList<String>()
|
||||||
|
|
||||||
for (unique in uniquesWithEffect()) {
|
for (unique in uniques) {
|
||||||
textList += unique.tr()
|
textList += unique.tr()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user