From 2e04fb5ddde9e4da2bd497375f3dbfa02e915416 Mon Sep 17 00:00:00 2001 From: penev92 Date: Mon, 6 Jul 2015 02:28:48 +0300 Subject: [PATCH] Rename Faction trait members Rename Faction.Race to Faction.InternalName --- OpenRA.Game/GameInformation.cs | 4 ++-- OpenRA.Game/Map/MapPlayers.cs | 2 +- OpenRA.Game/Player.cs | 10 +++++----- OpenRA.Game/Traits/BodyOrientation.cs | 2 +- OpenRA.Game/Traits/Player/PlayerResources.cs | 6 +++--- OpenRA.Game/Traits/World/Faction.cs | 8 ++++---- OpenRA.Game/VoiceExts.cs | 6 +++--- OpenRA.Game/Widgets/WidgetUtils.cs | 2 +- OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs | 2 +- OpenRA.Mods.Common/Activities/Repair.cs | 4 ++-- OpenRA.Mods.Common/Activities/Transform.cs | 2 +- OpenRA.Mods.Common/Lint/CheckPlayers.cs | 2 +- OpenRA.Mods.Common/Lint/CheckSequences.cs | 2 +- .../Orders/PlaceBuildingOrderGenerator.cs | 6 +++--- OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs | 4 ++-- OpenRA.Mods.Common/Traits/Buildings/PrimaryBuilding.cs | 2 +- .../Traits/Buildings/RepairableBuilding.cs | 2 +- OpenRA.Mods.Common/Traits/CaptureNotification.cs | 2 +- .../Traits/Crates/DuplicateUnitCrateAction.cs | 2 +- .../Traits/Crates/GiveUnitCrateAction.cs | 2 +- OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs | 2 +- OpenRA.Mods.Common/Traits/GainsExperience.cs | 2 +- OpenRA.Mods.Common/Traits/Player/BaseAttackNotifier.cs | 2 +- .../Traits/Player/ConquestVictoryConditions.cs | 4 ++-- .../Traits/Player/HarvesterAttackNotifier.cs | 2 +- OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs | 2 +- OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs | 4 ++-- OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs | 10 +++++----- .../Traits/Player/ProvidesPrerequisite.cs | 4 ++-- .../Traits/Player/StrategicVictoryConditions.cs | 4 ++-- OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs | 4 ++-- OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs | 2 +- OpenRA.Mods.Common/Traits/Production.cs | 2 +- OpenRA.Mods.Common/Traits/Render/RenderSprites.cs | 2 +- .../Traits/Sound/ActorLostNotification.cs | 2 +- OpenRA.Mods.Common/Traits/Sound/AnnounceOnSeen.cs | 2 +- OpenRA.Mods.Common/Traits/Transforms.cs | 4 ++-- OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs | 4 ++-- .../Traits/World/StartGameNotification.cs | 2 +- .../Widgets/Logic/Ingame/AddRaceSuffixLogic.cs | 4 ++-- .../Widgets/Logic/Ingame/GameInfoStatsLogic.cs | 4 ++-- .../Widgets/Logic/Ingame/IngameMenuLogic.cs | 2 +- .../Widgets/Logic/Ingame/LeaveMapLogic.cs | 2 +- .../Logic/Ingame/ObserverShroudSelectorLogic.cs | 2 +- .../Widgets/Logic/Ingame/WorldTooltipLogic.cs | 2 +- OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs | 2 +- OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs | 4 ++-- .../Widgets/ObserverProductionIconsWidget.cs | 2 +- OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs | 6 +++--- OpenRA.Mods.D2k/Activities/SwallowActor.cs | 2 +- OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs | 2 +- OpenRA.Mods.RA/Traits/Disguise.cs | 2 +- OpenRA.Mods.RA/Traits/LeavesHusk.cs | 2 +- 53 files changed, 85 insertions(+), 85 deletions(-) diff --git a/OpenRA.Game/GameInformation.cs b/OpenRA.Game/GameInformation.cs index a2b88360a4..9fea09f8ec 100644 --- a/OpenRA.Game/GameInformation.cs +++ b/OpenRA.Game/GameInformation.cs @@ -114,11 +114,11 @@ namespace OpenRA IsHuman = !runtimePlayer.IsBot, IsBot = runtimePlayer.IsBot, FactionName = runtimePlayer.Country.Name, - FactionId = runtimePlayer.Country.Race, + FactionId = runtimePlayer.Country.InternalName, Color = runtimePlayer.Color, Team = client.Team, SpawnPoint = runtimePlayer.SpawnPoint, - IsRandomFaction = runtimePlayer.Country.Race != client.Race, + IsRandomFaction = runtimePlayer.Country.InternalName != client.Race, IsRandomSpawnPoint = runtimePlayer.SpawnPoint != client.SpawnPoint }; diff --git a/OpenRA.Game/Map/MapPlayers.cs b/OpenRA.Game/Map/MapPlayers.cs index e6884278b6..dd61bca6de 100644 --- a/OpenRA.Game/Map/MapPlayers.cs +++ b/OpenRA.Game/Map/MapPlayers.cs @@ -29,7 +29,7 @@ namespace OpenRA public MapPlayers(Ruleset rules, int playerCount) { var firstRace = rules.Actors["world"].Traits - .WithInterface().First(f => f.Selectable).Race; + .WithInterface().First(f => f.Selectable).InternalName; Players = new Dictionary { diff --git a/OpenRA.Game/Player.cs b/OpenRA.Game/Player.cs index e844164396..4c7997e412 100644 --- a/OpenRA.Game/Player.cs +++ b/OpenRA.Game/Player.cs @@ -57,14 +57,14 @@ namespace OpenRA .WithInterface().Where(f => !requireSelectable || f.Selectable) .ToList(); - var selected = selectableCountries.FirstOrDefault(f => f.Race == name) + var selected = selectableCountries.FirstOrDefault(f => f.InternalName == name) ?? selectableCountries.Random(world.SharedRandom); // Don't loop infinite - for (var i = 0; i <= 10 && selected.RandomRaceMembers.Any(); i++) + for (var i = 0; i <= 10 && selected.RandomFactionMembers.Any(); i++) { - var race = selected.RandomRaceMembers.Random(world.SharedRandom); - selected = selectableCountries.FirstOrDefault(f => f.Race == race); + var race = selected.RandomFactionMembers.Random(world.SharedRandom); + selected = selectableCountries.FirstOrDefault(f => f.InternalName == race); if (selected == null) throw new YamlException("Unknown race: {0}".F(race)); @@ -78,7 +78,7 @@ namespace OpenRA var countries = world.Map.Rules.Actors["world"].Traits .WithInterface().ToArray(); - return countries.FirstOrDefault(f => f.Race == race) ?? countries.First(); + return countries.FirstOrDefault(f => f.InternalName == race) ?? countries.First(); } public Player(World world, Session.Client client, Session.Slot slot, PlayerReference pr) diff --git a/OpenRA.Game/Traits/BodyOrientation.cs b/OpenRA.Game/Traits/BodyOrientation.cs index 98a33e87fb..63015980af 100644 --- a/OpenRA.Game/Traits/BodyOrientation.cs +++ b/OpenRA.Game/Traits/BodyOrientation.cs @@ -54,7 +54,7 @@ namespace OpenRA.Traits { this.info = info; var self = init.Self; - var race = init.Contains() ? init.Get() : self.Owner.Country.Race; + var race = init.Contains() ? init.Get() : self.Owner.Country.InternalName; quantizedFacings = Exts.Lazy(() => { diff --git a/OpenRA.Game/Traits/Player/PlayerResources.cs b/OpenRA.Game/Traits/Player/PlayerResources.cs index 8a3b2f4c8f..fecbb1849a 100644 --- a/OpenRA.Game/Traits/Player/PlayerResources.cs +++ b/OpenRA.Game/Traits/Player/PlayerResources.cs @@ -145,7 +145,7 @@ namespace OpenRA.Traits { if (Resources > 0.8 * ResourceCapacity) { - Sound.PlayNotification(self.World.Map.Rules, owner, "Speech", "SilosNeeded", owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, owner, "Speech", "SilosNeeded", owner.Country.InternalName); AlertSilo = true; } else @@ -187,14 +187,14 @@ namespace OpenRA.Traits public void PlayCashTickUp(Actor self) { if (Game.Settings.Sound.CashTicks) - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "CashTickUp", self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "CashTickUp", self.Owner.Country.InternalName); } public void PlayCashTickDown(Actor self) { if (Game.Settings.Sound.CashTicks && nextCashTickTime == 0) { - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "CashTickDown", self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "CashTickDown", self.Owner.Country.InternalName); nextCashTickTime = 2; } } diff --git a/OpenRA.Game/Traits/World/Faction.cs b/OpenRA.Game/Traits/World/Faction.cs index e1c8fbcbac..efa7935925 100644 --- a/OpenRA.Game/Traits/World/Faction.cs +++ b/OpenRA.Game/Traits/World/Faction.cs @@ -17,12 +17,12 @@ namespace OpenRA.Traits public readonly string Name = null; [Desc("This is the internal name for owner checks.")] - public readonly string Race = null; + public readonly string InternalName = null; - [Desc("Pick a random race as the player's race out of this list.")] - public readonly string[] RandomRaceMembers = { }; + [Desc("Pick a random faction as the player's facton out of this list.")] + public readonly string[] RandomFactionMembers = { }; - [Desc("The side that the country belongs to. For example, England belongs to the 'Allies' side.")] + [Desc("The side that the faction belongs to. For example, England belongs to the 'Allies' side.")] public readonly string Side = null; [Translate] diff --git a/OpenRA.Game/VoiceExts.cs b/OpenRA.Game/VoiceExts.cs index e0bbe3c69d..42e99007ad 100644 --- a/OpenRA.Game/VoiceExts.cs +++ b/OpenRA.Game/VoiceExts.cs @@ -27,7 +27,7 @@ namespace OpenRA if (string.IsNullOrEmpty(voiced.VoiceSet)) return; - voiced.PlayVoice(self, phrase, self.Owner.Country.Race); + voiced.PlayVoice(self, phrase, self.Owner.Country.InternalName); } } @@ -41,7 +41,7 @@ namespace OpenRA if (string.IsNullOrEmpty(voiced.VoiceSet)) return; - voiced.PlayVoiceLocal(self, phrase, self.Owner.Country.Race, volume); + voiced.PlayVoiceLocal(self, phrase, self.Owner.Country.InternalName, volume); } } @@ -66,7 +66,7 @@ namespace OpenRA foreach (var v in orderSubject.TraitsImplementing()) { if (voice.PlayVoice(orderSubject, v.VoicePhraseForOrder(orderSubject, o), - orderSubject.Owner.Country.Race)) + orderSubject.Owner.Country.InternalName)) return; } } diff --git a/OpenRA.Game/Widgets/WidgetUtils.cs b/OpenRA.Game/Widgets/WidgetUtils.cs index 334c2255e6..719ba74dee 100644 --- a/OpenRA.Game/Widgets/WidgetUtils.cs +++ b/OpenRA.Game/Widgets/WidgetUtils.cs @@ -19,7 +19,7 @@ namespace OpenRA.Widgets { public static Sprite GetChromeImage(World world, string name) { - return ChromeProvider.GetImage("chrome-" + world.LocalPlayer.Country.Race, name); + return ChromeProvider.GetImage("chrome-" + world.LocalPlayer.Country.InternalName, name); } public static void DrawRGBA(Sprite s, float2 pos) diff --git a/OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs b/OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs index 94d6ed8d96..9f73909867 100644 --- a/OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs +++ b/OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs @@ -74,7 +74,7 @@ namespace OpenRA.Mods.Cnc.Traits cargo.Delivered(self); self.World.AddFrameEndTask(ww => DoProduction(self, producee, exit, raceVariant)); - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.ReadyAudio, self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.ReadyAudio, self.Owner.Country.InternalName); })); actor.QueueActivity(new Fly(actor, Target.FromCell(w, endPos))); diff --git a/OpenRA.Mods.Common/Activities/Repair.cs b/OpenRA.Mods.Common/Activities/Repair.cs index 7676a81852..f0124ea001 100644 --- a/OpenRA.Mods.Common/Activities/Repair.cs +++ b/OpenRA.Mods.Common/Activities/Repair.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Activities if (health.DamageState == DamageState.Undamaged) { - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.FinishRepairingNotification, self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.FinishRepairingNotification, self.Owner.Country.InternalName); return NextActivity; } @@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Activities if (!played) { played = true; - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.StartRepairingNotification, self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.StartRepairingNotification, self.Owner.Country.InternalName); } if (!self.Owner.PlayerActor.Trait().TakeCash(cost)) diff --git a/OpenRA.Mods.Common/Activities/Transform.cs b/OpenRA.Mods.Common/Activities/Transform.cs index 2a673d98ab..2694d2f8c6 100644 --- a/OpenRA.Mods.Common/Activities/Transform.cs +++ b/OpenRA.Mods.Common/Activities/Transform.cs @@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Activities foreach (var s in Sounds) Sound.PlayToPlayer(self.Owner, s, self.CenterPosition); - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Notification, self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Notification, self.Owner.Country.InternalName); var init = new TypeDictionary { diff --git a/OpenRA.Mods.Common/Lint/CheckPlayers.cs b/OpenRA.Mods.Common/Lint/CheckPlayers.cs index dd5689dc8a..ecb8e120f9 100644 --- a/OpenRA.Mods.Common/Lint/CheckPlayers.cs +++ b/OpenRA.Mods.Common/Lint/CheckPlayers.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Lint var worldActor = map.Rules.Actors["world"]; - var races = worldActor.Traits.WithInterface().Select(c => c.Race); + var races = worldActor.Traits.WithInterface().Select(f => f.InternalName); foreach (var player in players.Values) if (!string.IsNullOrWhiteSpace(player.Race) && !races.Contains(player.Race)) emitError("Invalid race {0} chosen for player {1}.".F(player.Race, player.Name)); diff --git a/OpenRA.Mods.Common/Lint/CheckSequences.cs b/OpenRA.Mods.Common/Lint/CheckSequences.cs index f0d4ced841..619cc5bcf0 100644 --- a/OpenRA.Mods.Common/Lint/CheckSequences.cs +++ b/OpenRA.Mods.Common/Lint/CheckSequences.cs @@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Lint sequenceDefinitions = MiniYaml.MergeLiberal(map.SequenceDefinitions, Game.ModData.Manifest.Sequences.Select(s => MiniYaml.FromFile(s)).Aggregate(MiniYaml.MergeLiberal)); - var races = map.Rules.Actors["world"].Traits.WithInterface().Select(c => c.Race); + var races = map.Rules.Actors["world"].Traits.WithInterface().Select(c => c.InternalName); foreach (var actorInfo in map.Rules.Actors) { diff --git a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs index f107a7e41c..64de9de3d1 100644 --- a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs @@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Orders var buildableInfo = info.Traits.Get(); var mostLikelyProducer = queue.MostLikelyProducer(); - race = buildableInfo.ForceRace ?? (mostLikelyProducer.Trait != null ? mostLikelyProducer.Trait.Race : producer.Owner.Country.Race); + race = buildableInfo.ForceRace ?? (mostLikelyProducer.Trait != null ? mostLikelyProducer.Trait.Race : producer.Owner.Country.InternalName); buildOk = map.SequenceProvider.GetSequence("overlay", "build-valid-{0}".F(tileset)).GetSprite(0); buildBlocked = map.SequenceProvider.GetSequence("overlay", "build-invalid").GetSprite(0); @@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Orders orderType = "PlacePlug"; if (!AcceptsPlug(topLeft, plugInfo)) { - Sound.PlayNotification(world.Map.Rules, producer.Owner, "Speech", "BuildingCannotPlaceAudio", producer.Owner.Country.Race); + Sound.PlayNotification(world.Map.Rules, producer.Owner, "Speech", "BuildingCannotPlaceAudio", producer.Owner.Country.InternalName); yield break; } } @@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Orders if (!world.CanPlaceBuilding(building, buildingInfo, topLeft, null) || !buildingInfo.IsCloseEnoughToBase(world, producer.Owner, building, topLeft)) { - Sound.PlayNotification(world.Map.Rules, producer.Owner, "Speech", "BuildingCannotPlaceAudio", producer.Owner.Country.Race); + Sound.PlayNotification(world.Map.Rules, producer.Owner, "Speech", "BuildingCannotPlaceAudio", producer.Owner.Country.InternalName); yield break; } diff --git a/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs index 31df50c6d8..bb829a9084 100644 --- a/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs @@ -38,13 +38,13 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Play an announcer voice listed in notifications.yaml")] public void PlaySpeechNotification(Player player, string notification) { - Sound.PlayNotification(world.Map.Rules, player, "Speech", notification, player != null ? player.Country.Race : null); + Sound.PlayNotification(world.Map.Rules, player, "Speech", notification, player != null ? player.Country.InternalName : null); } [Desc("Play a sound listed in notifications.yaml")] public void PlaySoundNotification(Player player, string notification) { - Sound.PlayNotification(world.Map.Rules, player, "Sounds", notification, player != null ? player.Country.Race : null); + Sound.PlayNotification(world.Map.Rules, player, "Sounds", notification, player != null ? player.Country.InternalName : null); } [Desc("Play a sound file")] diff --git a/OpenRA.Mods.Common/Traits/Buildings/PrimaryBuilding.cs b/OpenRA.Mods.Common/Traits/Buildings/PrimaryBuilding.cs index dfed3647df..5a6cbab660 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/PrimaryBuilding.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/PrimaryBuilding.cs @@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Traits isPrimary = true; - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", "PrimaryBuildingSelected", self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", "PrimaryBuildingSelected", self.Owner.Country.InternalName); } } } diff --git a/OpenRA.Mods.Common/Traits/Buildings/RepairableBuilding.cs b/OpenRA.Mods.Common/Traits/Buildings/RepairableBuilding.cs index 8c9f222f11..c3ce0e5207 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/RepairableBuilding.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/RepairableBuilding.cs @@ -63,7 +63,7 @@ namespace OpenRA.Mods.Common.Traits if (!Repairers.Remove(player) && Repairers.Count < Info.RepairBonuses.Length) { Repairers.Add(player); - Sound.PlayNotification(self.World.Map.Rules, player, "Speech", "Repairing", player.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, player, "Speech", "Repairing", player.Country.InternalName); self.World.AddFrameEndTask(w => { diff --git a/OpenRA.Mods.Common/Traits/CaptureNotification.cs b/OpenRA.Mods.Common/Traits/CaptureNotification.cs index b3f22d4d89..6490b07174 100644 --- a/OpenRA.Mods.Common/Traits/CaptureNotification.cs +++ b/OpenRA.Mods.Common/Traits/CaptureNotification.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits if (captor.World.LocalPlayer != captor.Owner) return; - var race = info.NewOwnerVoice ? newOwner.Country.Race : oldOwner.Country.Race; + var race = info.NewOwnerVoice ? newOwner.Country.InternalName : oldOwner.Country.InternalName; Sound.PlayNotification(self.World.Map.Rules, captor.World.LocalPlayer, "Speech", info.Notification, race); } } diff --git a/OpenRA.Mods.Common/Traits/Crates/DuplicateUnitCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/DuplicateUnitCrateAction.cs index d5fd6f2595..97cefb3ed8 100644 --- a/OpenRA.Mods.Common/Traits/Crates/DuplicateUnitCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/DuplicateUnitCrateAction.cs @@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Traits public bool CanGiveTo(Actor collector) { - if (info.ValidRaces.Any() && !info.ValidRaces.Contains(collector.Owner.Country.Race)) + if (info.ValidRaces.Any() && !info.ValidRaces.Contains(collector.Owner.Country.InternalName)) return false; var targetable = collector.Info.Traits.GetOrDefault(); diff --git a/OpenRA.Mods.Common/Traits/Crates/GiveUnitCrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/GiveUnitCrateAction.cs index a4df257b13..215df9d0a6 100644 --- a/OpenRA.Mods.Common/Traits/Crates/GiveUnitCrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/GiveUnitCrateAction.cs @@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits public bool CanGiveTo(Actor collector) { - if (info.ValidRaces.Any() && !info.ValidRaces.Contains(collector.Owner.Country.Race)) + if (info.ValidRaces.Any() && !info.ValidRaces.Contains(collector.Owner.Country.InternalName)) return false; foreach (string unit in info.Units) diff --git a/OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs b/OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs index 30ed4eb270..0b831cf787 100644 --- a/OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs +++ b/OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs @@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits { this.info = info; var raceList = info.Races; - correctRace = raceList.Length == 0 || raceList.Contains(self.Owner.Country.Race); + correctRace = raceList.Length == 0 || raceList.Contains(self.Owner.Country.InternalName); } public void Selling(Actor self) { } diff --git a/OpenRA.Mods.Common/Traits/GainsExperience.cs b/OpenRA.Mods.Common/Traits/GainsExperience.cs index c76e5ad808..96fd69cd31 100644 --- a/OpenRA.Mods.Common/Traits/GainsExperience.cs +++ b/OpenRA.Mods.Common/Traits/GainsExperience.cs @@ -99,7 +99,7 @@ namespace OpenRA.Mods.Common.Traits if (!silent) { - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "LevelUp", self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "LevelUp", self.Owner.Country.InternalName); self.World.AddFrameEndTask(w => w.Add(new CrateEffect(self, "levelup", info.LevelUpPalette))); } } diff --git a/OpenRA.Mods.Common/Traits/Player/BaseAttackNotifier.cs b/OpenRA.Mods.Common/Traits/Player/BaseAttackNotifier.cs index 0e32248c9e..a607bd7a99 100644 --- a/OpenRA.Mods.Common/Traits/Player/BaseAttackNotifier.cs +++ b/OpenRA.Mods.Common/Traits/Player/BaseAttackNotifier.cs @@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits if (self.World.WorldTick - lastAttackTime > info.NotifyInterval * 25) { - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Country.InternalName); if (radarPings != null) radarPings.Add(() => self.Owner == self.World.LocalPlayer, self.CenterPosition, info.RadarPingColor, info.RadarPingDuration); diff --git a/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs b/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs index 85e8fe2237..211387c707 100644 --- a/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs +++ b/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs @@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Traits Game.RunAfterDelay(info.NotificationDelay, () => { if (Game.IsCurrentWorld(player.World)) - Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Country.Race); + Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Country.InternalName); }); } } @@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Traits Game.Debug("{0} is victorious.", player.PlayerName); if (player == player.World.LocalPlayer) - Game.RunAfterDelay(info.NotificationDelay, () => Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Country.Race)); + Game.RunAfterDelay(info.NotificationDelay, () => Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Country.InternalName)); } public void OnObjectiveAdded(Player player, int id) { } diff --git a/OpenRA.Mods.Common/Traits/Player/HarvesterAttackNotifier.cs b/OpenRA.Mods.Common/Traits/Player/HarvesterAttackNotifier.cs index b7e4dc2426..f6cd2e88b9 100644 --- a/OpenRA.Mods.Common/Traits/Player/HarvesterAttackNotifier.cs +++ b/OpenRA.Mods.Common/Traits/Player/HarvesterAttackNotifier.cs @@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits if (self.World.WorldTick - lastAttackTime > info.NotifyInterval * 25) { - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Country.InternalName); if (radarPings != null) radarPings.Add(() => self.Owner == self.World.LocalPlayer, self.CenterPosition, info.RadarPingColor, info.RadarPingDuration); diff --git a/OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs b/OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs index 71c62b6430..8427ee2402 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs @@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Traits if (self.Owner.IsAlliedWith(self.World.RenderPlayer)) Sound.PlayNotification(self.World.Map.Rules, null, info.NotificationType, info.Notification, - self.World.RenderPlayer != null ? self.World.RenderPlayer.Country.Race : null); + self.World.RenderPlayer != null ? self.World.RenderPlayer.Country.InternalName : null); if (radarPings != null) { diff --git a/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs b/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs index b9b531224f..a4bff962b4 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs @@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Traits return; var producer = queue.MostLikelyProducer(); - var race = producer.Trait != null ? producer.Trait.Race : self.Owner.Country.Race; + var race = producer.Trait != null ? producer.Trait.Race : self.Owner.Country.InternalName; var buildingInfo = unit.Traits.Get(); var buildableInfo = unit.Traits.GetOrDefault(); @@ -143,7 +143,7 @@ namespace OpenRA.Mods.Common.Traits if (GetNumBuildables(self.Owner) > prevItems) w.Add(new DelayedAction(info.NewOptionsNotificationDelay, - () => Sound.PlayNotification(self.World.Map.Rules, order.Player, "Speech", info.NewOptionsNotification, order.Player.Country.Race))); + () => Sound.PlayNotification(self.World.Map.Rules, order.Player, "Speech", info.NewOptionsNotification, order.Player.Country.InternalName))); }); } diff --git a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs index 7932a8c385..f11a860e4e 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs @@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Traits playerPower = playerActor.Trait(); developerMode = playerActor.Trait(); - Race = init.Contains() ? init.Get() : self.Owner.Country.Race; + Race = init.Contains() ? init.Get() : self.Owner.Country.InternalName; Enabled = !info.Race.Any() || info.Race.Contains(Race); CacheProduceables(playerActor); @@ -123,7 +123,7 @@ namespace OpenRA.Mods.Common.Traits if (!Info.Sticky) { - Race = self.Owner.Country.Race; + Race = self.Owner.Country.InternalName; Enabled = !Info.Race.Any() || Info.Race.Contains(Race); } @@ -277,13 +277,13 @@ namespace OpenRA.Mods.Common.Traits var isBuilding = unit.Traits.Contains(); if (isBuilding && !hasPlayedSound) - hasPlayedSound = Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Country.Race); + hasPlayedSound = Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Country.InternalName); else if (!isBuilding) { if (BuildUnit(order.TargetString)) - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Country.InternalName); else if (!hasPlayedSound && time > 0) - hasPlayedSound = Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.BlockedAudio, self.Owner.Country.Race); + hasPlayedSound = Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.BlockedAudio, self.Owner.Country.InternalName); } }))); } diff --git a/OpenRA.Mods.Common/Traits/Player/ProvidesPrerequisite.cs b/OpenRA.Mods.Common/Traits/Player/ProvidesPrerequisite.cs index e9c9a3c6c0..fc21134318 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProvidesPrerequisite.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProvidesPrerequisite.cs @@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits if (string.IsNullOrEmpty(prerequisite)) prerequisite = init.Self.Info.Name; - var race = init.Contains() ? init.Get() : init.Self.Owner.Country.Race; + var race = init.Contains() ? init.Get() : init.Self.Owner.Country.InternalName; Update(init.Self.Owner, race); } @@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits public void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner) { if (info.ResetOnOwnerChange) - Update(newOwner, newOwner.Country.Race); + Update(newOwner, newOwner.Country.InternalName); } void Update(Player owner, string race) diff --git a/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs b/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs index 6648962820..2f11914aac 100644 --- a/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs +++ b/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs @@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Traits Game.RunAfterDelay(info.NotificationDelay, () => { if (Game.IsCurrentWorld(player.World)) - Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Country.Race); + Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Country.InternalName); }); } } @@ -122,7 +122,7 @@ namespace OpenRA.Mods.Common.Traits Game.Debug("{0} is victorious.", player.PlayerName); if (player == player.World.LocalPlayer) - Game.RunAfterDelay(info.NotificationDelay, () => Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Country.Race)); + Game.RunAfterDelay(info.NotificationDelay, () => Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Country.InternalName)); } public void OnObjectiveAdded(Player player, int id) { } diff --git a/OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs b/OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs index bb8c7777bd..418010ae63 100644 --- a/OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs +++ b/OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs @@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits if (!IsTraitDisabled && order.OrderString == "PowerDown") { disabled = !disabled; - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", disabled ? "EnablePower" : "DisablePower", self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", disabled ? "EnablePower" : "DisablePower", self.Owner.Country.InternalName); power.UpdateActor(self); if (disabled) @@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Traits if (!disabled || !Info.CancelWhenDisabled) return; disabled = false; - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "EnablePower", self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "EnablePower", self.Owner.Country.InternalName); power.UpdateActor(self); } } diff --git a/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs b/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs index 4f7928f50d..f3bb2feabb 100644 --- a/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs +++ b/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs @@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Traits if (--nextPowerAdviceTime <= 0) { if (lowPower) - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SpeechNotification, self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SpeechNotification, self.Owner.Country.InternalName); nextPowerAdviceTime = info.AdviceInterval; } diff --git a/OpenRA.Mods.Common/Traits/Production.cs b/OpenRA.Mods.Common/Traits/Production.cs index 46dc6ed45b..dabf8ec511 100644 --- a/OpenRA.Mods.Common/Traits/Production.cs +++ b/OpenRA.Mods.Common/Traits/Production.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits { Info = info; rp = Exts.Lazy(() => init.Self.IsDead ? null : init.Self.TraitOrDefault()); - Race = init.Contains() ? init.Get() : init.Self.Owner.Country.Race; + Race = init.Contains() ? init.Get() : init.Self.Owner.Country.InternalName; } public void DoProduction(Actor self, ActorInfo producee, ExitInfo exitinfo, string raceVariant) diff --git a/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs b/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs index e2e409a107..7253c205ca 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs @@ -145,7 +145,7 @@ namespace OpenRA.Mods.Common.Traits public RenderSprites(ActorInitializer init, RenderSpritesInfo info) { this.info = info; - race = init.Contains() ? init.Get() : init.Self.Owner.Country.Race; + race = init.Contains() ? init.Get() : init.Self.Owner.Country.InternalName; } public string GetImage(Actor self) diff --git a/OpenRA.Mods.Common/Traits/Sound/ActorLostNotification.cs b/OpenRA.Mods.Common/Traits/Sound/ActorLostNotification.cs index e507625d51..ff3a6583a5 100644 --- a/OpenRA.Mods.Common/Traits/Sound/ActorLostNotification.cs +++ b/OpenRA.Mods.Common/Traits/Sound/ActorLostNotification.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits public void Killed(Actor self, AttackInfo e) { var player = info.NotifyAll ? self.World.LocalPlayer : self.Owner; - Sound.PlayNotification(self.World.Map.Rules, player, "Speech", info.Notification, self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, player, "Speech", info.Notification, self.Owner.Country.InternalName); } } } diff --git a/OpenRA.Mods.Common/Traits/Sound/AnnounceOnSeen.cs b/OpenRA.Mods.Common/Traits/Sound/AnnounceOnSeen.cs index 0f7372354d..b4b53097e5 100644 --- a/OpenRA.Mods.Common/Traits/Sound/AnnounceOnSeen.cs +++ b/OpenRA.Mods.Common/Traits/Sound/AnnounceOnSeen.cs @@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits // Audio notification if (discoverer != null && !string.IsNullOrEmpty(Info.Notification)) - Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Country.InternalName); // Radar notificaion if (Info.PingRadar && radarPings.Value != null) diff --git a/OpenRA.Mods.Common/Traits/Transforms.cs b/OpenRA.Mods.Common/Traits/Transforms.cs index 47fe16ba06..da2e921a85 100644 --- a/OpenRA.Mods.Common/Traits/Transforms.cs +++ b/OpenRA.Mods.Common/Traits/Transforms.cs @@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Traits self = init.Self; this.info = info; buildingInfo = self.World.Map.Rules.Actors[info.IntoActor].Traits.GetOrDefault(); - race = init.Contains() ? init.Get() : self.Owner.Country.Race; + race = init.Contains() ? init.Get() : self.Owner.Country.InternalName; } public string VoicePhraseForOrder(Actor self, Order order) @@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.Traits foreach (var s in info.NoTransformSounds) Sound.PlayToPlayer(self.Owner, s); - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.NoTransformNotification, self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.NoTransformNotification, self.Owner.Country.InternalName); return; } diff --git a/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs b/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs index 4cf91a8f1f..8bb3e8dee3 100644 --- a/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs +++ b/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs @@ -31,11 +31,11 @@ namespace OpenRA.Mods.Common.Traits { var spawnClass = p.PlayerReference.StartingUnitsClass ?? w.LobbyInfo.GlobalSettings.StartingUnitsClass; var unitGroup = w.Map.Rules.Actors["world"].Traits.WithInterface() - .Where(g => g.Class == spawnClass && g.Races != null && g.Races.Contains(p.Country.Race)) + .Where(g => g.Class == spawnClass && g.Races != null && g.Races.Contains(p.Country.InternalName)) .RandomOrDefault(w.SharedRandom); if (unitGroup == null) - throw new InvalidOperationException("No starting units defined for country {0} with class {1}".F(p.Country.Race, spawnClass)); + throw new InvalidOperationException("No starting units defined for country {0} with class {1}".F(p.Country.InternalName, spawnClass)); if (unitGroup.BaseActor != null) { diff --git a/OpenRA.Mods.Common/Traits/World/StartGameNotification.cs b/OpenRA.Mods.Common/Traits/World/StartGameNotification.cs index f85bf94f7c..18292b8bda 100644 --- a/OpenRA.Mods.Common/Traits/World/StartGameNotification.cs +++ b/OpenRA.Mods.Common/Traits/World/StartGameNotification.cs @@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits public void WorldLoaded(World world, WorldRenderer wr) { - Sound.PlayNotification(world.Map.Rules, null, "Speech", info.Notification, world.RenderPlayer == null ? null : world.RenderPlayer.Country.Race); + Sound.PlayNotification(world.Map.Rules, null, "Speech", info.Notification, world.RenderPlayer == null ? null : world.RenderPlayer.Country.InternalName); } } } diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddRaceSuffixLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddRaceSuffixLogic.cs index 76a2ba3cab..8b98871f74 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddRaceSuffixLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddRaceSuffixLogic.cs @@ -19,8 +19,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic public AddRaceSuffixLogic(Widget widget, World world) { string race; - if (!ChromeMetrics.TryGet("RaceSuffix-" + world.LocalPlayer.Country.Race, out race)) - race = world.LocalPlayer.Country.Race; + if (!ChromeMetrics.TryGet("RaceSuffix-" + world.LocalPlayer.Country.InternalName, out race)) + race = world.LocalPlayer.Country.InternalName; var suffix = "-" + race; if (widget is ButtonWidget) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs index 485e8dbcac..9303528bf8 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs @@ -62,12 +62,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic flag.GetImageCollection = () => "flags"; if (lp.Stances[pp] == Stance.Ally || lp.WinState != WinState.Undefined) { - flag.GetImageName = () => pp.Country.Race; + flag.GetImageName = () => pp.Country.InternalName; item.Get("FACTION").GetText = () => pp.Country.Name; } else { - flag.GetImageName = () => pp.DisplayCountry.Race; + flag.GetImageName = () => pp.DisplayCountry.InternalName; item.Get("FACTION").GetText = () => pp.DisplayCountry.Name; } diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs index 2d7d1e8ece..3f3877c816 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic Action onQuit = () => { if (world.Type == WorldType.Regular) - Sound.PlayNotification(world.Map.Rules, null, "Speech", "Leave", world.LocalPlayer == null ? null : world.LocalPlayer.Country.Race); + Sound.PlayNotification(world.Map.Rules, null, "Speech", "Leave", world.LocalPlayer == null ? null : world.LocalPlayer.Country.InternalName); resumeDisabled = true; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/LeaveMapLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/LeaveMapLogic.cs index 446fadfe43..722018ffd8 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/LeaveMapLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/LeaveMapLogic.cs @@ -104,7 +104,7 @@ namespace OpenRA.Mods.Common.Widgets if (world.Type == WorldType.Regular) Sound.PlayNotification(world.Map.Rules, null, "Speech", "Leave", - world.LocalPlayer == null ? null : world.LocalPlayer.Country.Race); + world.LocalPlayer == null ? null : world.LocalPlayer.Country.InternalName); var exitDelay = iop != null ? iop.ExitDelay : 0; if (mpe != null) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs index 8459981b2f..f48d4a7ae2 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs @@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic Player = p; Label = p.PlayerName; Color = p.Color.RGB; - Race = p.Country.Race; + Race = p.Country.InternalName; IsSelected = () => p.World.RenderPlayer == p; OnClick = () => { p.World.RenderPlayer = p; logic.selected = this; p.World.Selection.Clear(); }; } diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/WorldTooltipLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/WorldTooltipLogic.cs index 85775ebc13..a6e3e56d39 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/WorldTooltipLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/WorldTooltipLogic.cs @@ -102,7 +102,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (showOwner) { - flagRace = o.Country.Race; + flagRace = o.Country.InternalName; ownerName = o.PlayerName; ownerColor = o.Color.RGB; widget.Bounds.Height = doubleHeight; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index aeedd1b27b..f9b886e897 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -145,7 +145,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic colorPreview.Color = Game.Settings.Player.Color; foreach (var f in modRules.Actors["world"].Traits.WithInterface()) - countries.Add(f.Race, new LobbyCountry { Selectable = f.Selectable, Name = f.Name, Side = f.Side, Description = f.Description }); + countries.Add(f.InternalName, new LobbyCountry { Selectable = f.Selectable, Name = f.Name, Side = f.Side, Description = f.Description }); var gameStarting = false; Func configurationDisabled = () => !Game.IsHost || gameStarting || diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index f40cc67c53..d3ba98ec47 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -456,9 +456,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic var flag = template.Get("FLAG"); flag.GetImageCollection = () => "flags"; if (player.World.RenderPlayer != null && player.World.RenderPlayer.Stances[player] != Stance.Ally) - flag.GetImageName = () => player.DisplayCountry.Race; + flag.GetImageName = () => player.DisplayCountry.InternalName; else - flag.GetImageName = () => player.Country.Race; + flag.GetImageName = () => player.Country.InternalName; var playerName = template.Get("PLAYER"); var client = player.World.LobbyInfo.ClientWithIndex(player.ClientIndex); diff --git a/OpenRA.Mods.Common/Widgets/ObserverProductionIconsWidget.cs b/OpenRA.Mods.Common/Widgets/ObserverProductionIconsWidget.cs index a9fb0a2b6c..33147e7e40 100644 --- a/OpenRA.Mods.Common/Widgets/ObserverProductionIconsWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ObserverProductionIconsWidget.cs @@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Widgets if (current == null) continue; - var race = queue.Trait.Actor.Owner.Country.Race; + var race = queue.Trait.Actor.Owner.Country.InternalName; var actor = queue.Trait.AllItems().FirstOrDefault(a => a.Name == current.Item); if (actor == null) continue; diff --git a/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs b/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs index 73fe20090c..c4cad02262 100644 --- a/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs @@ -226,7 +226,7 @@ namespace OpenRA.Mods.Common.Widgets { // Queue a new item Sound.Play(TabClick); - Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.QueuedAudio, World.LocalPlayer.Country.Race); + Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.QueuedAudio, World.LocalPlayer.Country.InternalName); World.IssueOrder(Order.StartProduction(CurrentQueue.Actor, icon.Name, handleMultiple ? 5 : 1)); return true; @@ -245,14 +245,14 @@ namespace OpenRA.Mods.Common.Widgets if (item.Paused || item.Done || item.TotalCost == item.RemainingCost) { // Instant cancel of things we have not started yet and things that are finished - Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.CancelledAudio, World.LocalPlayer.Country.Race); + Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.CancelledAudio, World.LocalPlayer.Country.InternalName); World.IssueOrder(Order.CancelProduction(CurrentQueue.Actor, icon.Name, handleMultiple ? 5 : 1)); } else { // Pause an existing item - Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.OnHoldAudio, World.LocalPlayer.Country.Race); + Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.OnHoldAudio, World.LocalPlayer.Country.InternalName); World.IssueOrder(Order.PauseProduction(CurrentQueue.Actor, icon.Name, true)); } diff --git a/OpenRA.Mods.D2k/Activities/SwallowActor.cs b/OpenRA.Mods.D2k/Activities/SwallowActor.cs index c92cb98503..caeda888bc 100644 --- a/OpenRA.Mods.D2k/Activities/SwallowActor.cs +++ b/OpenRA.Mods.D2k/Activities/SwallowActor.cs @@ -116,7 +116,7 @@ namespace OpenRA.Mods.D2k.Activities void NotifyPlayer(Player player, WPos location) { - Sound.PlayNotification(player.World.Map.Rules, player, "Speech", swallow.Info.WormAttackNotification, player.Country.Race); + Sound.PlayNotification(player.World.Map.Rules, player, "Speech", swallow.Info.WormAttackNotification, player.Country.InternalName); if (player == player.World.RenderPlayer) radarPings.Add(() => true, location, Color.Red, 50); diff --git a/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs b/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs index c32c9bdb50..d8d2a4033c 100644 --- a/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs +++ b/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Traits { this.info = info; production = init.Self.Trait(); - race = init.Contains() ? init.Get() : init.Self.Owner.Country.Race; + race = init.Contains() ? init.Get() : init.Self.Owner.Country.InternalName; } public void UnitProducedByOther(Actor self, Actor producer, Actor produced) diff --git a/OpenRA.Mods.RA/Traits/Disguise.cs b/OpenRA.Mods.RA/Traits/Disguise.cs index 05290108b1..91c3c3fc18 100644 --- a/OpenRA.Mods.RA/Traits/Disguise.cs +++ b/OpenRA.Mods.RA/Traits/Disguise.cs @@ -168,7 +168,7 @@ namespace OpenRA.Mods.RA.Traits var oldEffectiveOwner = AsPlayer; var renderSprites = actorInfo.Traits.GetOrDefault(); - AsSprite = renderSprites == null ? null : renderSprites.GetImage(actorInfo, self.World.Map.SequenceProvider, newOwner.Country.Race); + AsSprite = renderSprites == null ? null : renderSprites.GetImage(actorInfo, self.World.Map.SequenceProvider, newOwner.Country.InternalName); AsPlayer = newOwner; AsTooltipInfo = actorInfo.Traits.WithInterface().FirstOrDefault(); diff --git a/OpenRA.Mods.RA/Traits/LeavesHusk.cs b/OpenRA.Mods.RA/Traits/LeavesHusk.cs index 95c5d784d6..66778b05b2 100644 --- a/OpenRA.Mods.RA/Traits/LeavesHusk.cs +++ b/OpenRA.Mods.RA/Traits/LeavesHusk.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Traits { this.info = info; - race = init.Contains() ? init.Get() : init.Self.Owner.Country.Race; + race = init.Contains() ? init.Get() : init.Self.Owner.Country.InternalName; } public void Killed(Actor self, AttackInfo e)