Remove 'yes' and 'no' in favor of 'true' and 'false'

This commit is contained in:
abcdefg30
2019-10-07 15:16:04 +02:00
committed by reaperrr
parent c4f48ad521
commit 55c3f313b1
21 changed files with 53 additions and 61 deletions

View File

@@ -415,7 +415,13 @@ namespace OpenRA
} }
} }
else if (fieldType == typeof(bool)) 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[])) else if (fieldType == typeof(int2[]))
{ {
if (value != null) if (value != null)
@@ -592,20 +598,6 @@ namespace OpenRA
return null; 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 sealed class FieldLoadInfo
{ {
public readonly FieldInfo Field; public readonly FieldInfo Field;

View File

@@ -26,7 +26,7 @@ Container@SKIRMISH_STATS:
Height: 20 Height: 20
Font: Bold Font: Bold
Text: Destroy all opposition! Text: Destroy all opposition!
Disabled: yes Disabled: true
TextColorDisabled: FFFFFF TextColorDisabled: FFFFFF
Container@STATS_HEADERS: Container@STATS_HEADERS:
X: 17 X: 17

View File

@@ -167,7 +167,7 @@ MoneyCrate:
Inherits: ^Crate Inherits: ^Crate
GiveCashCrateAction: GiveCashCrateAction:
Amount: 500 Amount: 500
UseCashTick: yes UseCashTick: true
airstrike.proxy: airstrike.proxy:
AirstrikePower: AirstrikePower:

View File

@@ -160,7 +160,7 @@ MoneyCrate:
Inherits: ^Crate Inherits: ^Crate
GiveCashCrateAction: GiveCashCrateAction:
Amount: 2000 Amount: 2000
UseCashTick: yes UseCashTick: true
NUKEOUT.IN: NUKEOUT.IN:
Inherits: NUKE Inherits: NUKE

View File

@@ -193,7 +193,7 @@ MoneyCrate:
Inherits: ^Crate Inherits: ^Crate
GiveCashCrateAction: GiveCashCrateAction:
Amount: 2000 Amount: 2000
UseCashTick: yes UseCashTick: true
NUKEOUT.IN: NUKEOUT.IN:
Inherits: NUKE Inherits: NUKE

View File

@@ -308,7 +308,7 @@
OwnerLostAction: OwnerLostAction:
Action: Kill Action: Kill
AppearsOnRadar: AppearsOnRadar:
UseLocation: yes UseLocation: true
Targetable@GROUND: Targetable@GROUND:
TargetTypes: Ground, Vehicle TargetTypes: Ground, Vehicle
RequiresCondition: !airborne RequiresCondition: !airborne
@@ -648,7 +648,7 @@
OwnerLostAction: OwnerLostAction:
Action: Kill Action: Kill
AppearsOnRadar: AppearsOnRadar:
UseLocation: yes UseLocation: true
HiddenUnderFog: HiddenUnderFog:
Type: GroundPosition Type: GroundPosition
AlwaysVisibleStances: None AlwaysVisibleStances: None
@@ -727,7 +727,7 @@
EmptyWeapon: BuildingExplode EmptyWeapon: BuildingExplode
CaptureNotification: CaptureNotification:
Notification: BuildingCaptured Notification: BuildingCaptured
NewOwnerVoice: no NewOwnerVoice: false
ActorLostNotification: ActorLostNotification:
Notification: BuildingLost Notification: BuildingLost
ShakeOnDeath: ShakeOnDeath:
@@ -1062,7 +1062,7 @@
Damage: 100 Damage: 100
Interval: 6 Interval: 6
Targetable: Targetable:
RequiresForceFire: yes RequiresForceFire: true
TargetTypes: Ground, Husk TargetTypes: Ground, Husk
CaptureManager: CaptureManager:
Capturable: Capturable:
@@ -1112,7 +1112,7 @@
Name: Bridge Name: Bridge
ShowOwnerRow: false ShowOwnerRow: false
Targetable: Targetable:
RequiresForceFire: yes RequiresForceFire: true
TargetTypes: Ground, Water TargetTypes: Ground, Water
Health: Health:
HP: 60000 HP: 60000

View File

@@ -9,7 +9,7 @@ CRATE:
GiveCashCrateAction: GiveCashCrateAction:
Amount: 1000 Amount: 1000
SelectionShares: 20 SelectionShares: 20
UseCashTick: yes UseCashTick: true
RevealMapCrateAction: RevealMapCrateAction:
SelectionShares: 1 SelectionShares: 1
Sequence: reveal-map Sequence: reveal-map

View File

@@ -272,7 +272,7 @@ SILO:
RevealsShroud: RevealsShroud:
Range: 4c0 Range: 4c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
-WithSpriteBody: -WithSpriteBody:
WithResourceLevelSpriteBody: WithResourceLevelSpriteBody:
Sequence: stages Sequence: stages
@@ -688,7 +688,7 @@ FIX:
RevealsShroud: RevealsShroud:
Range: 5c0 Range: 5c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
WithResupplyAnimation: WithResupplyAnimation:
RequiresCondition: !build-incomplete RequiresCondition: !build-incomplete
Reservable: Reservable:
@@ -857,7 +857,7 @@ GUN:
RevealsShroud: RevealsShroud:
Range: 6c0 Range: 6c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
Turreted: Turreted:
TurnSpeed: 12 TurnSpeed: 12
InitialFacing: 56 InitialFacing: 56
@@ -958,7 +958,7 @@ OBLI:
RevealsShroud: RevealsShroud:
Range: 8c0 Range: 8c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
-WithSpriteBody: -WithSpriteBody:
WithChargeSpriteBody: WithChargeSpriteBody:
Sequence: active Sequence: active
@@ -1003,7 +1003,7 @@ GTWR:
RevealsShroud: RevealsShroud:
Range: 7c0 Range: 7c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
Armament: Armament:
Weapon: HighV Weapon: HighV
LocalOffset: 256,0,256 LocalOffset: 256,0,256
@@ -1046,7 +1046,7 @@ ATWR:
RevealsShroud: RevealsShroud:
Range: 8c0 Range: 8c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
Turreted: Turreted:
TurnSpeed: 255 TurnSpeed: 255
Offset: 128,128,384 Offset: 128,128,384

View File

@@ -56,7 +56,7 @@ HOSP:
SpawnActorOnDeath: SpawnActorOnDeath:
Actor: HOSP.Husk Actor: HOSP.Husk
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
ProvidesPrerequisite@buildingname: ProvidesPrerequisite@buildingname:
HOSP.Husk: HOSP.Husk:
@@ -69,7 +69,7 @@ HOSP.Husk:
Tooltip: Tooltip:
Name: Hospital (Destroyed) Name: Hospital (Destroyed)
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
BIO: BIO:
Inherits: ^TechBuilding Inherits: ^TechBuilding
@@ -139,6 +139,6 @@ MISS:
Valued: Valued:
Cost: 2000 Cost: 2000
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
WithMakeAnimation: WithMakeAnimation:
ProvidesPrerequisite@buildingname: ProvidesPrerequisite@buildingname:

View File

@@ -145,7 +145,7 @@ Background@ASSETBROWSER_PANEL:
ImageCollection: music ImageCollection: music
ImageName: play ImageName: play
Button@BUTTON_PAUSE: Button@BUTTON_PAUSE:
Visible: no Visible: false
X: 35 X: 35
Y: 0 Y: 0
Width: 25 Width: 25

View File

@@ -26,7 +26,7 @@ Container@SKIRMISH_STATS:
Height: 20 Height: 20
Font: Bold Font: Bold
Text: Destroy all opposition! Text: Destroy all opposition!
Disabled: yes Disabled: true
TextColorDisabled: FFFFFF TextColorDisabled: FFFFFF
Container@STATS_HEADERS: Container@STATS_HEADERS:
X: 22 X: 22

View File

@@ -26,7 +26,7 @@ Container@SKIRMISH_STATS:
Height: 20 Height: 20
Font: Bold Font: Bold
Text: Destroy all opposition! Text: Destroy all opposition!
Disabled: yes Disabled: true
TextColorDisabled: FFFFFF TextColorDisabled: FFFFFF
Container@STATS_HEADERS: Container@STATS_HEADERS:
X: 22 X: 22

View File

@@ -87,7 +87,7 @@ DevBullet:
Projectile: Bullet Projectile: Bullet
Speed: 192 Speed: 192
Blockable: false Blockable: false
Shadow: yes Shadow: true
LaunchAngle: 62 LaunchAngle: 62
Inaccuracy: 768 Inaccuracy: 768
ContrailLength: 20 ContrailLength: 20

View File

@@ -85,7 +85,7 @@ Player:
SelectTargetSound: slcttgt1.aud SelectTargetSound: slcttgt1.aud
BeginChargeSound: chrochr1.aud BeginChargeSound: chrochr1.aud
EndChargeSound: chrordy1.aud EndChargeSound: chrordy1.aud
KillCargo: yes KillCargo: true
Range: 3 Range: 3
GrantExternalConditionPower@IRONCURTAIN: GrantExternalConditionPower@IRONCURTAIN:
Icon: invuln Icon: invuln

View File

@@ -69,4 +69,4 @@ Player:
Locked: True Locked: True
Visible: False Visible: False
LobbyPrerequisiteCheckbox@GLOBALFACTUNDEPLOY: LobbyPrerequisiteCheckbox@GLOBALFACTUNDEPLOY:
Visible: False Visible: False

View File

@@ -28,7 +28,7 @@ SovietPlatoonUnits:
MINV: MINV:
Mine: Mine:
AvoidFriendly: yes AvoidFriendly: true
CAMERA: CAMERA:
RevealsShroud: RevealsShroud:

View File

@@ -138,7 +138,7 @@ HOSP:
RevealsShroud: RevealsShroud:
Range: 4c0 Range: 4c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
WithDeathAnimation: WithDeathAnimation:
DeathSequence: dead DeathSequence: dead
UseDeathTypeSuffix: false UseDeathTypeSuffix: false
@@ -531,7 +531,7 @@ BR2:
BR3: BR3:
Inherits: ^Bridge Inherits: ^Bridge
Bridge: Bridge:
Long: yes Long: true
ShorePieces: br1,br2 ShorePieces: br1,br2
Template: 241 Template: 241
DamagedTemplate: 242 DamagedTemplate: 242

View File

@@ -252,7 +252,7 @@ FIXF:
Armor: Armor:
Type: Wood Type: Wood
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
RenderSprites: RenderSprites:
Image: FIX Image: FIX
Valued: Valued:
@@ -352,7 +352,7 @@ PDOF:
RenderSprites: RenderSprites:
Image: PDOX Image: PDOX
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
Valued: Valued:
Cost: 150 Cost: 150
Health: Health:

View File

@@ -415,7 +415,7 @@ CTFLAG:
Tooltip: Tooltip:
Name: Flag Name: Flag
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
-HitShape: -HitShape:
-Health: -Health:
-Explodes: -Explodes:

View File

@@ -92,7 +92,7 @@ GAP:
RevealsShroud@GAPGEN: RevealsShroud@GAPGEN:
Range: 5c0 Range: 5c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
CreatesShroud: CreatesShroud:
Range: 6c0 Range: 6c0
RequiresCondition: !disabled RequiresCondition: !disabled
@@ -422,7 +422,7 @@ IRON:
Range: 5c0 Range: 5c0
RequiresCondition: !disabled RequiresCondition: !disabled
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
GrantExternalConditionPower@IRONCURTAIN: GrantExternalConditionPower@IRONCURTAIN:
PauseOnCondition: disabled PauseOnCondition: disabled
Icon: invuln Icon: invuln
@@ -478,7 +478,7 @@ PDOX:
Range: 5c0 Range: 5c0
RequiresCondition: !disabled RequiresCondition: !disabled
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
ProvidesPrerequisite@germany: ProvidesPrerequisite@germany:
Factions: germany Factions: germany
Prerequisite: pdox.germany Prerequisite: pdox.germany
@@ -498,7 +498,7 @@ PDOX:
BeginChargeSpeechNotification: ChronosphereCharging BeginChargeSpeechNotification: ChronosphereCharging
EndChargeSpeechNotification: ChronosphereReady EndChargeSpeechNotification: ChronosphereReady
Duration: 400 Duration: 400
KillCargo: yes KillCargo: true
DisplayRadarPing: True DisplayRadarPing: True
SupportPowerPaletteOrder: 20 SupportPowerPaletteOrder: 20
ChronoshiftPower@advancedchronoshift: ChronoshiftPower@advancedchronoshift:
@@ -514,7 +514,7 @@ PDOX:
BeginChargeSpeechNotification: ChronosphereCharging BeginChargeSpeechNotification: ChronosphereCharging
EndChargeSpeechNotification: ChronosphereReady EndChargeSpeechNotification: ChronosphereReady
Duration: 400 Duration: 400
KillCargo: yes KillCargo: true
DisplayRadarPing: True DisplayRadarPing: True
Range: 2 Range: 2
SupportPowerPaletteOrder: 30 SupportPowerPaletteOrder: 30
@@ -552,7 +552,7 @@ TSLA:
RevealsShroud@GAPGEN: RevealsShroud@GAPGEN:
Range: 6c0 Range: 6c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
WithTeslaChargeAnimation: WithTeslaChargeAnimation:
Armament: Armament:
Weapon: TeslaZap Weapon: TeslaZap
@@ -597,7 +597,7 @@ AGUN:
RevealsShroud@GAPGEN: RevealsShroud@GAPGEN:
Range: 5c0 Range: 5c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
Turreted: Turreted:
TurnSpeed: 15 TurnSpeed: 15
InitialFacing: 224 InitialFacing: 224
@@ -692,7 +692,7 @@ PBOX:
RevealsShroud@GAPGEN: RevealsShroud@GAPGEN:
Range: 5c0 Range: 5c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
Turreted: Turreted:
TurnSpeed: 255 TurnSpeed: 255
-QuantizeFacingsFromSequence: -QuantizeFacingsFromSequence:
@@ -797,7 +797,7 @@ GUN:
RevealsShroud@GAPGEN: RevealsShroud@GAPGEN:
Range: 5c0 Range: 5c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
Turreted: Turreted:
TurnSpeed: 12 TurnSpeed: 12
InitialFacing: 56 InitialFacing: 56
@@ -840,7 +840,7 @@ FTUR:
RevealsShroud@GAPGEN: RevealsShroud@GAPGEN:
Range: 5c0 Range: 5c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
Turreted: Turreted:
TurnSpeed: 255 TurnSpeed: 255
Offset: 0,0,112 Offset: 0,0,112
@@ -894,7 +894,7 @@ SAM:
RevealsShroud@GAPGEN: RevealsShroud@GAPGEN:
Range: 5c0 Range: 5c0
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
Turreted: Turreted:
TurnSpeed: 30 TurnSpeed: 30
InitialFacing: 0 InitialFacing: 0
@@ -949,7 +949,7 @@ ATEK:
GpsPower: GpsPower:
PauseOnCondition: disabled PauseOnCondition: disabled
Icon: gps Icon: gps
OneShot: yes OneShot: true
ChargeInterval: 12000 ChargeInterval: 12000
Description: GPS Satellite Description: GPS Satellite
LongDesc: Reveals map terrain and provides tactical\ninformation. Requires power and active radar. LongDesc: Reveals map terrain and provides tactical\ninformation. Requires power and active radar.
@@ -1293,7 +1293,7 @@ SILO:
Types: ThiefInfiltrate Types: ThiefInfiltrate
Notification: CreditsStolen Notification: CreditsStolen
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
-WithSpriteBody: -WithSpriteBody:
WithResourceLevelSpriteBody: WithResourceLevelSpriteBody:
Sequence: stages Sequence: stages
@@ -1957,7 +1957,7 @@ FIX:
FinishRepairingNotification: UnitRepaired FinishRepairingNotification: UnitRepaired
PlayerExperience: 15 PlayerExperience: 15
WithBuildingBib: WithBuildingBib:
HasMinibib: Yes HasMinibib: true
WithResupplyAnimation: WithResupplyAnimation:
RequiresCondition: !build-incomplete RequiresCondition: !build-incomplete
Power: Power:

View File

@@ -733,7 +733,7 @@ DTRK:
KillsSelf: KillsSelf:
RequiresCondition: invulnerability || triggered RequiresCondition: invulnerability || triggered
Chronoshiftable: Chronoshiftable:
ExplodeInstead: yes ExplodeInstead: true
CTNK: CTNK:
Inherits: ^Vehicle Inherits: ^Vehicle