mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-11 18:39:43 +07: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)
|
||||
.getAnnotation(Deprecated::class.java)
|
||||
if (deprecationAnnotation != null) {
|
||||
// Not user-visible
|
||||
lines.add("$name's unique \"${unique.text}\" is deprecated ${deprecationAnnotation.message}," +
|
||||
" replace with \"${deprecationAnnotation.replaceWith.expression}\"",
|
||||
RulesetErrorSeverity.WarningOptionsOnly)
|
||||
val deprecationText = "$name's unique \"${unique.text}\" is deprecated ${deprecationAnnotation.message}," +
|
||||
" replace with \"${deprecationAnnotation.replaceWith.expression}\""
|
||||
val severity = if(deprecationAnnotation.level == DeprecationLevel.WARNING)
|
||||
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),
|
||||
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
|
||||
@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
|
||||
@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
|
||||
|
||||
// TODO: Unify these (I'm in favor of "gain a free" above "provides" because it fits more cases)
|
||||
|
Loading…
Reference in New Issue
Block a user