mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 09:17:47 +07:00
Resolved #7982 - Misspelling replacement text contains conditionals
This commit is contained in:
parent
f779221f93
commit
e57c3018ef
@ -458,13 +458,12 @@ class Ruleset {
|
||||
val text =
|
||||
"$name's unique \"${unique.text}\" looks like it may be a misspelling of:\n" +
|
||||
similarUniques.joinToString("\n") { uniqueType ->
|
||||
val deprecationAnnotation =
|
||||
UniqueType::class.java.getField(uniqueType.name)
|
||||
.getAnnotation(Deprecated::class.java)
|
||||
if (deprecationAnnotation == null)
|
||||
"\"${uniqueType.text}\""
|
||||
else
|
||||
"\"${uniqueType.text}\" (Deprecated)"
|
||||
var text = "\"${uniqueType.text}"
|
||||
if (unique.conditionals.isNotEmpty())
|
||||
text += " " + unique.conditionals.joinToString(" ") { "<${it.text}>" }
|
||||
text += "\""
|
||||
if (uniqueType.getDeprecationAnnotation() != null) text += " (Deprecated)"
|
||||
return@joinToString text
|
||||
}.prependIndent("\t")
|
||||
listOf(RulesetError(text, RulesetErrorSeverity.OK))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user