Expanded the buildingFilter to include options for national wonders (#5900)

* Expanded the buildingFilter to include options national wonders

* Also instruct the translation file writer on the changes

* Typo

* Non-national -> World
This commit is contained in:
Xander Lenstra
2022-01-07 12:41:53 +01:00
committed by GitHub
parent 9b431a9bf7
commit 7f38118dd9
3 changed files with 7 additions and 2 deletions

View File

@ -765,6 +765,8 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
name -> true
"Building", "Buildings" -> !isAnyWonder()
"Wonder", "Wonders" -> isAnyWonder()
"National Wonder" -> isNationalWonder
"World Wonder" -> isWonder
replaces -> true
else -> {
if (uniques.contains(filter)) return true

View File

@ -102,11 +102,12 @@ enum class UniqueParameterType(val parameterName:String) {
}
},
BuildingFilter("buildingFilter") {
private val knownValues = setOf("All","Building","Buildings","Wonder","Wonders","National Wonder","World Wonder")
override fun getErrorSeverity(
parameterText: String,
ruleset: Ruleset
): UniqueType.UniqueComplianceErrorSeverity? {
if (parameterText == "All") return null
if (parameterText in knownValues) return null
if (Stat.values().any { it.name == parameterText }) return null
if (BuildingName.getErrorSeverity(parameterText, ruleset) == null) return null
return UniqueType.UniqueComplianceErrorSeverity.WarningOnly

View File

@ -253,6 +253,8 @@ object TranslationFileWriter {
val buildingMap = ruleset.buildings.keys.toMutableSet().apply { addAll(sequenceOf(
"Wonders",
"Wonder",
"National Wonder",
"World Wonder",
"Buildings",
"Building"
)) }
@ -283,7 +285,7 @@ object TranslationFileWriter {
fun submitString(string: String) {
val unique = Unique(string)
if(unique.type?.flags?.contains(UniqueFlag.HiddenToUsers)==true)
if (unique.hasFlag(UniqueFlag.HiddenToUsers))
return // We don't need to translate this at all, not user-visible
var stringToTranslate = string.removeConditionals()