diff --git a/OpenRA.Game/FieldLoader.cs b/OpenRA.Game/FieldLoader.cs index 229fd6e34e..52be836b74 100644 --- a/OpenRA.Game/FieldLoader.cs +++ b/OpenRA.Game/FieldLoader.cs @@ -415,7 +415,13 @@ namespace OpenRA } } else if (fieldType == typeof(bool)) - return ParseYesNo(value, fieldType, fieldName); + { + bool result; + if (bool.TryParse(value.ToLowerInvariant(), out result)) + return result; + + return InvalidValueAction(value, fieldType, fieldName); + } else if (fieldType == typeof(int2[])) { if (value != null) @@ -592,20 +598,6 @@ namespace OpenRA return null; } - static object ParseYesNo(string p, Type fieldType, string field) - { - if (string.IsNullOrEmpty(p)) - return InvalidValueAction(p, fieldType, field); - - p = p.ToLowerInvariant(); - if (p == "yes") return true; - if (p == "true") return true; - if (p == "no") return false; - if (p == "false") return false; - - return InvalidValueAction(p, fieldType, field); - } - public sealed class FieldLoadInfo { public readonly FieldInfo Field; diff --git a/mods/cnc/chrome/ingame-infostats.yaml b/mods/cnc/chrome/ingame-infostats.yaml index 71bee12f9d..0abeb731d3 100644 --- a/mods/cnc/chrome/ingame-infostats.yaml +++ b/mods/cnc/chrome/ingame-infostats.yaml @@ -26,7 +26,7 @@ Container@SKIRMISH_STATS: Height: 20 Font: Bold Text: Destroy all opposition! - Disabled: yes + Disabled: true TextColorDisabled: FFFFFF Container@STATS_HEADERS: X: 17 diff --git a/mods/cnc/maps/gdi05a/rules.yaml b/mods/cnc/maps/gdi05a/rules.yaml index 6acf422e62..81753efc4c 100644 --- a/mods/cnc/maps/gdi05a/rules.yaml +++ b/mods/cnc/maps/gdi05a/rules.yaml @@ -167,7 +167,7 @@ MoneyCrate: Inherits: ^Crate GiveCashCrateAction: Amount: 500 - UseCashTick: yes + UseCashTick: true airstrike.proxy: AirstrikePower: diff --git a/mods/cnc/maps/nod08a/rules.yaml b/mods/cnc/maps/nod08a/rules.yaml index 897c97e1d8..827b44df0e 100644 --- a/mods/cnc/maps/nod08a/rules.yaml +++ b/mods/cnc/maps/nod08a/rules.yaml @@ -160,7 +160,7 @@ MoneyCrate: Inherits: ^Crate GiveCashCrateAction: Amount: 2000 - UseCashTick: yes + UseCashTick: true NUKEOUT.IN: Inherits: NUKE diff --git a/mods/cnc/maps/nod08b/rules.yaml b/mods/cnc/maps/nod08b/rules.yaml index a3ff7efa5d..dfd42249d3 100644 --- a/mods/cnc/maps/nod08b/rules.yaml +++ b/mods/cnc/maps/nod08b/rules.yaml @@ -193,7 +193,7 @@ MoneyCrate: Inherits: ^Crate GiveCashCrateAction: Amount: 2000 - UseCashTick: yes + UseCashTick: true NUKEOUT.IN: Inherits: NUKE diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index 722c696f37..05dba22aca 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -308,7 +308,7 @@ OwnerLostAction: Action: Kill AppearsOnRadar: - UseLocation: yes + UseLocation: true Targetable@GROUND: TargetTypes: Ground, Vehicle RequiresCondition: !airborne @@ -648,7 +648,7 @@ OwnerLostAction: Action: Kill AppearsOnRadar: - UseLocation: yes + UseLocation: true HiddenUnderFog: Type: GroundPosition AlwaysVisibleStances: None @@ -727,7 +727,7 @@ EmptyWeapon: BuildingExplode CaptureNotification: Notification: BuildingCaptured - NewOwnerVoice: no + NewOwnerVoice: false ActorLostNotification: Notification: BuildingLost ShakeOnDeath: @@ -1062,7 +1062,7 @@ Damage: 100 Interval: 6 Targetable: - RequiresForceFire: yes + RequiresForceFire: true TargetTypes: Ground, Husk CaptureManager: Capturable: @@ -1112,7 +1112,7 @@ Name: Bridge ShowOwnerRow: false Targetable: - RequiresForceFire: yes + RequiresForceFire: true TargetTypes: Ground, Water Health: HP: 60000 diff --git a/mods/cnc/rules/misc.yaml b/mods/cnc/rules/misc.yaml index f679692106..548633fa5e 100644 --- a/mods/cnc/rules/misc.yaml +++ b/mods/cnc/rules/misc.yaml @@ -9,7 +9,7 @@ CRATE: GiveCashCrateAction: Amount: 1000 SelectionShares: 20 - UseCashTick: yes + UseCashTick: true RevealMapCrateAction: SelectionShares: 1 Sequence: reveal-map diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index d472aec0e4..165c5bc9f0 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -272,7 +272,7 @@ SILO: RevealsShroud: Range: 4c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true -WithSpriteBody: WithResourceLevelSpriteBody: Sequence: stages @@ -688,7 +688,7 @@ FIX: RevealsShroud: Range: 5c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true WithResupplyAnimation: RequiresCondition: !build-incomplete Reservable: @@ -857,7 +857,7 @@ GUN: RevealsShroud: Range: 6c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true Turreted: TurnSpeed: 12 InitialFacing: 56 @@ -958,7 +958,7 @@ OBLI: RevealsShroud: Range: 8c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true -WithSpriteBody: WithChargeSpriteBody: Sequence: active @@ -1003,7 +1003,7 @@ GTWR: RevealsShroud: Range: 7c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true Armament: Weapon: HighV LocalOffset: 256,0,256 @@ -1046,7 +1046,7 @@ ATWR: RevealsShroud: Range: 8c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true Turreted: TurnSpeed: 255 Offset: 128,128,384 diff --git a/mods/cnc/rules/tech.yaml b/mods/cnc/rules/tech.yaml index 32d23da819..cfad0b0c2a 100644 --- a/mods/cnc/rules/tech.yaml +++ b/mods/cnc/rules/tech.yaml @@ -56,7 +56,7 @@ HOSP: SpawnActorOnDeath: Actor: HOSP.Husk WithBuildingBib: - HasMinibib: Yes + HasMinibib: true ProvidesPrerequisite@buildingname: HOSP.Husk: @@ -69,7 +69,7 @@ HOSP.Husk: Tooltip: Name: Hospital (Destroyed) WithBuildingBib: - HasMinibib: Yes + HasMinibib: true BIO: Inherits: ^TechBuilding @@ -139,6 +139,6 @@ MISS: Valued: Cost: 2000 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true WithMakeAnimation: ProvidesPrerequisite@buildingname: diff --git a/mods/common/chrome/assetbrowser.yaml b/mods/common/chrome/assetbrowser.yaml index 79f8fd0df6..b42fbef9f7 100644 --- a/mods/common/chrome/assetbrowser.yaml +++ b/mods/common/chrome/assetbrowser.yaml @@ -145,7 +145,7 @@ Background@ASSETBROWSER_PANEL: ImageCollection: music ImageName: play Button@BUTTON_PAUSE: - Visible: no + Visible: false X: 35 Y: 0 Width: 25 diff --git a/mods/common/chrome/ingame-infostats.yaml b/mods/common/chrome/ingame-infostats.yaml index abe5c18afd..cd5f7f8beb 100644 --- a/mods/common/chrome/ingame-infostats.yaml +++ b/mods/common/chrome/ingame-infostats.yaml @@ -26,7 +26,7 @@ Container@SKIRMISH_STATS: Height: 20 Font: Bold Text: Destroy all opposition! - Disabled: yes + Disabled: true TextColorDisabled: FFFFFF Container@STATS_HEADERS: X: 22 diff --git a/mods/d2k/chrome/ingame-infostats.yaml b/mods/d2k/chrome/ingame-infostats.yaml index d56273442d..80c9d7bed4 100644 --- a/mods/d2k/chrome/ingame-infostats.yaml +++ b/mods/d2k/chrome/ingame-infostats.yaml @@ -26,7 +26,7 @@ Container@SKIRMISH_STATS: Height: 20 Font: Bold Text: Destroy all opposition! - Disabled: yes + Disabled: true TextColorDisabled: FFFFFF Container@STATS_HEADERS: X: 22 diff --git a/mods/d2k/weapons/largeguns.yaml b/mods/d2k/weapons/largeguns.yaml index 642be44ce9..8ae2d6026a 100644 --- a/mods/d2k/weapons/largeguns.yaml +++ b/mods/d2k/weapons/largeguns.yaml @@ -87,7 +87,7 @@ DevBullet: Projectile: Bullet Speed: 192 Blockable: false - Shadow: yes + Shadow: true LaunchAngle: 62 Inaccuracy: 768 ContrailLength: 20 diff --git a/mods/ra/maps/bomber-john/rules.yaml b/mods/ra/maps/bomber-john/rules.yaml index 7cb4426c31..eca1a75a87 100644 --- a/mods/ra/maps/bomber-john/rules.yaml +++ b/mods/ra/maps/bomber-john/rules.yaml @@ -85,7 +85,7 @@ Player: SelectTargetSound: slcttgt1.aud BeginChargeSound: chrochr1.aud EndChargeSound: chrordy1.aud - KillCargo: yes + KillCargo: true Range: 3 GrantExternalConditionPower@IRONCURTAIN: Icon: invuln diff --git a/mods/ra/maps/drop-zone-w/rules.yaml b/mods/ra/maps/drop-zone-w/rules.yaml index 6db9b3224f..a6fb78bc46 100644 --- a/mods/ra/maps/drop-zone-w/rules.yaml +++ b/mods/ra/maps/drop-zone-w/rules.yaml @@ -69,4 +69,4 @@ Player: Locked: True Visible: False LobbyPrerequisiteCheckbox@GLOBALFACTUNDEPLOY: - Visible: False \ No newline at end of file + Visible: False diff --git a/mods/ra/maps/survival02/rules.yaml b/mods/ra/maps/survival02/rules.yaml index 848d339f37..35cecbb7a0 100644 --- a/mods/ra/maps/survival02/rules.yaml +++ b/mods/ra/maps/survival02/rules.yaml @@ -28,7 +28,7 @@ SovietPlatoonUnits: MINV: Mine: - AvoidFriendly: yes + AvoidFriendly: true CAMERA: RevealsShroud: diff --git a/mods/ra/rules/civilian.yaml b/mods/ra/rules/civilian.yaml index b875fd890e..52b5a16662 100644 --- a/mods/ra/rules/civilian.yaml +++ b/mods/ra/rules/civilian.yaml @@ -138,7 +138,7 @@ HOSP: RevealsShroud: Range: 4c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true WithDeathAnimation: DeathSequence: dead UseDeathTypeSuffix: false @@ -531,7 +531,7 @@ BR2: BR3: Inherits: ^Bridge Bridge: - Long: yes + Long: true ShorePieces: br1,br2 Template: 241 DamagedTemplate: 242 diff --git a/mods/ra/rules/fakes.yaml b/mods/ra/rules/fakes.yaml index 2c76e7080c..3d7edbe897 100644 --- a/mods/ra/rules/fakes.yaml +++ b/mods/ra/rules/fakes.yaml @@ -252,7 +252,7 @@ FIXF: Armor: Type: Wood WithBuildingBib: - HasMinibib: Yes + HasMinibib: true RenderSprites: Image: FIX Valued: @@ -352,7 +352,7 @@ PDOF: RenderSprites: Image: PDOX WithBuildingBib: - HasMinibib: Yes + HasMinibib: true Valued: Cost: 150 Health: diff --git a/mods/ra/rules/misc.yaml b/mods/ra/rules/misc.yaml index 01a53f2dec..4cbf1f3f2d 100644 --- a/mods/ra/rules/misc.yaml +++ b/mods/ra/rules/misc.yaml @@ -415,7 +415,7 @@ CTFLAG: Tooltip: Name: Flag WithBuildingBib: - HasMinibib: Yes + HasMinibib: true -HitShape: -Health: -Explodes: diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index dbddf14a35..6fc765005c 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -92,7 +92,7 @@ GAP: RevealsShroud@GAPGEN: Range: 5c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true CreatesShroud: Range: 6c0 RequiresCondition: !disabled @@ -422,7 +422,7 @@ IRON: Range: 5c0 RequiresCondition: !disabled WithBuildingBib: - HasMinibib: Yes + HasMinibib: true GrantExternalConditionPower@IRONCURTAIN: PauseOnCondition: disabled Icon: invuln @@ -478,7 +478,7 @@ PDOX: Range: 5c0 RequiresCondition: !disabled WithBuildingBib: - HasMinibib: Yes + HasMinibib: true ProvidesPrerequisite@germany: Factions: germany Prerequisite: pdox.germany @@ -498,7 +498,7 @@ PDOX: BeginChargeSpeechNotification: ChronosphereCharging EndChargeSpeechNotification: ChronosphereReady Duration: 400 - KillCargo: yes + KillCargo: true DisplayRadarPing: True SupportPowerPaletteOrder: 20 ChronoshiftPower@advancedchronoshift: @@ -514,7 +514,7 @@ PDOX: BeginChargeSpeechNotification: ChronosphereCharging EndChargeSpeechNotification: ChronosphereReady Duration: 400 - KillCargo: yes + KillCargo: true DisplayRadarPing: True Range: 2 SupportPowerPaletteOrder: 30 @@ -552,7 +552,7 @@ TSLA: RevealsShroud@GAPGEN: Range: 6c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true WithTeslaChargeAnimation: Armament: Weapon: TeslaZap @@ -597,7 +597,7 @@ AGUN: RevealsShroud@GAPGEN: Range: 5c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true Turreted: TurnSpeed: 15 InitialFacing: 224 @@ -692,7 +692,7 @@ PBOX: RevealsShroud@GAPGEN: Range: 5c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true Turreted: TurnSpeed: 255 -QuantizeFacingsFromSequence: @@ -797,7 +797,7 @@ GUN: RevealsShroud@GAPGEN: Range: 5c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true Turreted: TurnSpeed: 12 InitialFacing: 56 @@ -840,7 +840,7 @@ FTUR: RevealsShroud@GAPGEN: Range: 5c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true Turreted: TurnSpeed: 255 Offset: 0,0,112 @@ -894,7 +894,7 @@ SAM: RevealsShroud@GAPGEN: Range: 5c0 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true Turreted: TurnSpeed: 30 InitialFacing: 0 @@ -949,7 +949,7 @@ ATEK: GpsPower: PauseOnCondition: disabled Icon: gps - OneShot: yes + OneShot: true ChargeInterval: 12000 Description: GPS Satellite LongDesc: Reveals map terrain and provides tactical\ninformation. Requires power and active radar. @@ -1293,7 +1293,7 @@ SILO: Types: ThiefInfiltrate Notification: CreditsStolen WithBuildingBib: - HasMinibib: Yes + HasMinibib: true -WithSpriteBody: WithResourceLevelSpriteBody: Sequence: stages @@ -1957,7 +1957,7 @@ FIX: FinishRepairingNotification: UnitRepaired PlayerExperience: 15 WithBuildingBib: - HasMinibib: Yes + HasMinibib: true WithResupplyAnimation: RequiresCondition: !build-incomplete Power: diff --git a/mods/ra/rules/vehicles.yaml b/mods/ra/rules/vehicles.yaml index 70ce05fce7..64ca613e5d 100644 --- a/mods/ra/rules/vehicles.yaml +++ b/mods/ra/rules/vehicles.yaml @@ -733,7 +733,7 @@ DTRK: KillsSelf: RequiresCondition: invulnerability || triggered Chronoshiftable: - ExplodeInstead: yes + ExplodeInstead: true CTNK: Inherits: ^Vehicle