mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Mod error detection improvements!
Separated Warning vs Error, show "options only" warning in options only, color warnings by severity
This commit is contained in:
parent
2e8934af17
commit
bae8bd2468
@ -296,10 +296,13 @@ class Ruleset {
|
|||||||
val deprecationAnnotation = unique.type.declaringClass.getField(unique.type.name)
|
val deprecationAnnotation = unique.type.declaringClass.getField(unique.type.name)
|
||||||
.getAnnotation(Deprecated::class.java)
|
.getAnnotation(Deprecated::class.java)
|
||||||
if (deprecationAnnotation != null) {
|
if (deprecationAnnotation != null) {
|
||||||
// Not user-visible
|
val deprecationText = "$name's unique \"${unique.text}\" is deprecated ${deprecationAnnotation.message}," +
|
||||||
lines.add("$name's unique \"${unique.text}\" is deprecated ${deprecationAnnotation.message}," +
|
" replace with \"${deprecationAnnotation.replaceWith.expression}\""
|
||||||
" replace with \"${deprecationAnnotation.replaceWith.expression}\"",
|
val severity = if(deprecationAnnotation.level == DeprecationLevel.WARNING)
|
||||||
RulesetErrorSeverity.WarningOptionsOnly)
|
RulesetErrorSeverity.WarningOptionsOnly // Not user-visible
|
||||||
|
else RulesetErrorSeverity.Warning // User visible
|
||||||
|
|
||||||
|
lines.add(deprecationText, severity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,11 +52,11 @@ enum class UniqueType(val text:String, vararg target: UniqueTarget) {
|
|||||||
FreeUnits("[amount] units cost no maintenance", UniqueTarget.Global),
|
FreeUnits("[amount] units cost no maintenance", UniqueTarget.Global),
|
||||||
UnitMaintenanceDiscount("[amount]% maintenance costs for [mapUnitFilter] units", UniqueTarget.Global),
|
UnitMaintenanceDiscount("[amount]% maintenance costs for [mapUnitFilter] units", UniqueTarget.Global),
|
||||||
|
|
||||||
@Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"))
|
@Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.WARNING)
|
||||||
DecreasedUnitMaintenanceCostsByFilter("-[amount]% [mapUnitFilter] unit maintenance costs"), // No conditional support
|
DecreasedUnitMaintenanceCostsByFilter("-[amount]% [mapUnitFilter] unit maintenance costs"), // No conditional support
|
||||||
@Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"))
|
@Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.WARNING)
|
||||||
DecreasedUnitMaintenanceCostsGlobally("-[amount]% unit upkeep costs"), // No conditional support
|
DecreasedUnitMaintenanceCostsGlobally("-[amount]% unit upkeep costs"), // No conditional support
|
||||||
@Deprecated("As of 3.16.16", ReplaceWith("[stats] <if this city has at least [amount] specialists>"))
|
@Deprecated("As of 3.16.16", ReplaceWith("[stats] <if this city has at least [amount] specialists>"), DeprecationLevel.WARNING)
|
||||||
StatBonusForNumberOfSpecialists("[stats] if this city has at least [amount] specialists"), // No conditional support
|
StatBonusForNumberOfSpecialists("[stats] if this city has at least [amount] specialists"), // No conditional support
|
||||||
|
|
||||||
// TODO: Unify these (I'm in favor of "gain a free" above "provides" because it fits more cases)
|
// TODO: Unify these (I'm in favor of "gain a free" above "provides" because it fits more cases)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user