diff --git a/OpenRA.Game/Map/ActorInitializer.cs b/OpenRA.Game/Map/ActorInitializer.cs index 3e68491065..1cb9eb938b 100755 --- a/OpenRA.Game/Map/ActorInitializer.cs +++ b/OpenRA.Game/Map/ActorInitializer.cs @@ -103,13 +103,13 @@ namespace OpenRA } } - // Allows maps / transformations to specify the race variant of an actor. - public class RaceInit : IActorInit + // Allows maps / transformations to specify the faction variant of an actor. + public class FactionInit : IActorInit { - [FieldFromYamlKey] public readonly string Race; + [FieldFromYamlKey] public readonly string Faction; - public RaceInit() { } - public RaceInit(string race) { Race = race; } - public string Value(World world) { return Race; } + public FactionInit() { } + public FactionInit(string faction) { Faction = faction; } + public string Value(World world) { return Faction; } } } diff --git a/OpenRA.Game/Traits/BodyOrientation.cs b/OpenRA.Game/Traits/BodyOrientation.cs index 617e330322..4b5d4ad714 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.Faction.InternalName; + var race = init.Contains() ? init.Get() : self.Owner.Faction.InternalName; quantizedFacings = Exts.Lazy(() => { diff --git a/OpenRA.Mods.Common/Activities/Transform.cs b/OpenRA.Mods.Common/Activities/Transform.cs index 565c4eb77f..3542d6b47a 100644 --- a/OpenRA.Mods.Common/Activities/Transform.cs +++ b/OpenRA.Mods.Common/Activities/Transform.cs @@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Activities init.Add(new SkipMakeAnimsInit()); if (Race != null) - init.Add(new RaceInit(Race)); + init.Add(new FactionInit(Race)); var health = self.TraitOrDefault(); if (health != null) diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs index e8a1d720a7..af121d73e9 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorActorBrush.cs @@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Widgets td.Add(new FacingInit(facing)); td.Add(new TurretFacingInit(facing)); td.Add(new OwnerInit(owner.Name)); - td.Add(new RaceInit(owner.Faction)); + td.Add(new FactionInit(owner.Faction)); preview.SetPreview(actor, td); var ios = actor.Traits.GetOrDefault(); diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index a35bf7ce2c..1fa232d367 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -565,11 +565,11 @@ - + - + diff --git a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs index 60413907dd..be7d2a6ac7 100644 --- a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs @@ -170,7 +170,7 @@ namespace OpenRA.Mods.Common.Orders { var td = new TypeDictionary() { - new RaceInit(race), + new FactionInit(race), new OwnerInit(producer.Owner), new HideBibPreviewInit() }; diff --git a/OpenRA.Mods.Common/Scripting/Properties/PlayerProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/PlayerProperties.cs index 02066913a3..4e8bc10c99 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/PlayerProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/PlayerProperties.cs @@ -30,8 +30,18 @@ namespace OpenRA.Mods.Common.Scripting [Desc("The player's color.")] public HSLColor Color { get { return Player.Color; } } - [Desc("The player's race.")] - public string Race { get { return Player.PlayerReference.Faction; } } + [Desc("The player's race. (DEPRECATED! Use the `Faction` property.)")] + public string Race + { + get + { + Game.Debug("The property `PlayerProperties.Race` is deprecated! Use `PlayerProperties.Faction` instead!"); + return Player.PlayerReference.Faction; + } + } + + [Desc("The player's faction.")] + public string Faction { get { return Player.PlayerReference.Faction; } } [Desc("The player's spawnpoint ID.")] public int Spawn { get { return Player.SpawnPoint; } } diff --git a/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs b/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs index bb92fc5c6a..5bc22c9b97 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlaceBuilding.cs @@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Traits { new LocationInit(t), new OwnerInit(order.Player), - new RaceInit(race) + new FactionInit(race) }); if (playSounds) @@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits { new LocationInit(order.TargetLocation), new OwnerInit(order.Player), - new RaceInit(race), + new FactionInit(race), }); foreach (var s in buildingInfo.BuildSounds) diff --git a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs index 3654d7b632..b688cabee2 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.Faction.InternalName; + Race = init.Contains() ? init.Get() : self.Owner.Faction.InternalName; Enabled = !info.Race.Any() || info.Race.Contains(Race); CacheProduceables(playerActor); diff --git a/OpenRA.Mods.Common/Traits/Player/ProvidesPrerequisite.cs b/OpenRA.Mods.Common/Traits/Player/ProvidesPrerequisite.cs index 0b792ca835..3928c7f164 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.Faction.InternalName; + var race = init.Contains() ? init.Get() : init.Self.Owner.Faction.InternalName; Update(init.Self.Owner, race); } diff --git a/OpenRA.Mods.Common/Traits/Production.cs b/OpenRA.Mods.Common/Traits/Production.cs index 0d0abe1a72..09920c678e 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.Faction.InternalName; + Race = init.Contains() ? init.Get() : init.Self.Owner.Faction.InternalName; } public void DoProduction(Actor self, ActorInfo producee, ExitInfo exitinfo, string raceVariant) @@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Traits }; if (raceVariant != null) - td.Add(new RaceInit(raceVariant)); + td.Add(new FactionInit(raceVariant)); var newUnit = self.World.CreateActor(producee.Name, td); diff --git a/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs b/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs index f039c3d9db..7eceef2ecb 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs @@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits public IEnumerable RenderPreview(ActorPreviewInitializer init) { var sequenceProvider = init.World.Map.SequenceProvider; - var race = init.Get(); + var race = init.Get(); var ownerName = init.Get().PlayerName; var image = GetImage(init.Actor, sequenceProvider, race); var palette = init.WorldRenderer.Palette(Palette ?? PlayerPalette + ownerName); @@ -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.Faction.InternalName; + race = init.Contains() ? init.Get() : init.Self.Owner.Faction.InternalName; } public string GetImage(Actor self) diff --git a/OpenRA.Mods.Common/Traits/Render/RenderVoxels.cs b/OpenRA.Mods.Common/Traits/Render/RenderVoxels.cs index 9afa73a249..0895f1654f 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderVoxels.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderVoxels.cs @@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits public virtual IEnumerable RenderPreview(ActorPreviewInitializer init) { var body = init.Actor.Traits.Get(); - var race = init.Get(); + var race = init.Get(); var ownerName = init.Get().PlayerName; var sequenceProvider = init.World.Map.SequenceProvider; var image = Image ?? init.Actor.Name; diff --git a/OpenRA.Mods.Common/Traits/Transforms.cs b/OpenRA.Mods.Common/Traits/Transforms.cs index 5934e05034..13d2b9b2bc 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.Faction.InternalName; + race = init.Contains() ? init.Get() : self.Owner.Faction.InternalName; } public string VoicePhraseForOrder(Actor self, Order order) diff --git a/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs b/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs index b101940746..578ffa5298 100644 --- a/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs +++ b/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs @@ -43,8 +43,8 @@ namespace OpenRA.Mods.Common.Traits this.Owner = owner; this.worldRenderer = worldRenderer; - if (!actor.InitDict.Contains()) - actor.InitDict.Add(new RaceInit(owner.Faction)); + if (!actor.InitDict.Contains()) + actor.InitDict.Add(new FactionInit(owner.Faction)); if (!actor.InitDict.Contains()) actor.InitDict.Add(new OwnerInit(owner.Name)); @@ -118,8 +118,8 @@ namespace OpenRA.Mods.Common.Traits { Func saveInit = init => { - var race = init as RaceInit; - if (race != null && race.Race == Owner.Faction) + var factionInit = init as FactionInit; + if (factionInit != null && factionInit.Faction == Owner.Faction) return false; // TODO: Other default values will need to be filtered diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index e23f86f98e..4d87407d32 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -2172,6 +2172,12 @@ namespace OpenRA.Mods.Common.UtilityCommands ConvertFloatToIntPercentage(ref node.Value.Value); } + if (engineVersion < 20150715) + { + if (node.Key == "Race") + node.Key = "Faction"; + } + UpgradeActors(engineVersion, ref node.Value.Nodes, node, depth + 1); } } diff --git a/OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs index 0724e535d8..ca36d2b443 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var td = new TypeDictionary(); td.Add(new HideBibPreviewInit()); td.Add(new OwnerInit(world.WorldActor.Owner)); - td.Add(new RaceInit(world.WorldActor.Owner.PlayerReference.Faction)); + td.Add(new FactionInit(world.WorldActor.Owner.PlayerReference.Faction)); if (preview != null) preview.SetPreview(actor, td); diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs index 74772978ab..8b2330c5ef 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs @@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic td.Add(new TurretFacingInit(92)); td.Add(new HideBibPreviewInit()); td.Add(new OwnerInit(selectedOwner.Name)); - td.Add(new RaceInit(selectedOwner.Faction)); + td.Add(new FactionInit(selectedOwner.Faction)); try { diff --git a/OpenRA.Mods.Common/Widgets/Logic/CountryTooltipLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/FactionTooltipLogic.cs similarity index 94% rename from OpenRA.Mods.Common/Widgets/Logic/CountryTooltipLogic.cs rename to OpenRA.Mods.Common/Widgets/Logic/FactionTooltipLogic.cs index 55997828f8..3a02fb9681 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/CountryTooltipLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/FactionTooltipLogic.cs @@ -14,10 +14,10 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic { - public class CountryTooltipLogic + public class FactionTooltipLogic { [ObjectCreator.UseCtor] - public CountryTooltipLogic(Widget widget, ButtonWidget button) + public FactionTooltipLogic(Widget widget, ButtonWidget button) { var lines = button.GetTooltipText().Replace("\\n", "\n").Split('\n'); diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddFactionSuffixLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddFactionSuffixLogic.cs new file mode 100644 index 0000000000..b5fbaa16a2 --- /dev/null +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddFactionSuffixLogic.cs @@ -0,0 +1,39 @@ +#region Copyright & License Information +/* + * Copyright 2007-2015 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System; +using OpenRA.Widgets; + +namespace OpenRA.Mods.Common.Widgets.Logic +{ + public class AddFactionSuffixLogic + { + [ObjectCreator.UseCtor] + public AddFactionSuffixLogic(Widget widget, World world) + { + string faction; + if (!ChromeMetrics.TryGet("FactionSuffix-" + world.LocalPlayer.Faction.InternalName, out faction)) + faction = world.LocalPlayer.Faction.InternalName; + var suffix = "-" + faction; + + var buttonWidget = widget as ButtonWidget; + if (buttonWidget != null) + buttonWidget.Background += suffix; + else + { + var imageWidget = widget as ImageWidget; + if (imageWidget != null) + imageWidget.ImageCollection += suffix; + else + throw new InvalidOperationException("AddFactionSuffixLogic only supports ButtonWidget and ImageWidget"); + } + } + } +} diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddRaceSuffixLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddRaceSuffixLogic.cs deleted file mode 100644 index b44b3cb235..0000000000 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddRaceSuffixLogic.cs +++ /dev/null @@ -1,34 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2015 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -using System; -using OpenRA.Widgets; - -namespace OpenRA.Mods.Common.Widgets.Logic -{ - public class AddRaceSuffixLogic - { - [ObjectCreator.UseCtor] - public AddRaceSuffixLogic(Widget widget, World world) - { - string race; - if (!ChromeMetrics.TryGet("RaceSuffix-" + world.LocalPlayer.Faction.InternalName, out race)) - race = world.LocalPlayer.Faction.InternalName; - var suffix = "-" + race; - - if (widget is ButtonWidget) - ((ButtonWidget)widget).Background += suffix; - else if (widget is ImageWidget) - ((ImageWidget)widget).ImageCollection += suffix; - else - throw new InvalidOperationException("AddRaceSuffixLogic only supports ButtonWidget and ImageWidget"); - } - } -} diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index b4d03cc9fd..824f5e23c9 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly ScrollPanelWidget players; - readonly Dictionary countries = new Dictionary(); + readonly Dictionary factions = new Dictionary(); readonly ColorPreviewManagerWidget colorPreview; @@ -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.InternalName, new LobbyCountry { Selectable = f.Selectable, Name = f.Name, Side = f.Side, Description = f.Description }); + factions.Add(f.InternalName, new LobbyFaction { Selectable = f.Selectable, Name = f.Name, Side = f.Side, Description = f.Description }); var gameStarting = false; Func configurationDisabled = () => !Game.IsHost || gameStarting || @@ -714,7 +714,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic LobbyUtils.SetupEditableNameWidget(template, slot, client, orderManager); LobbyUtils.SetupEditableColorWidget(template, slot, client, orderManager, shellmapWorld, colorPreview); - LobbyUtils.SetupEditableFactionWidget(template, slot, client, orderManager, countries); + LobbyUtils.SetupEditableFactionWidget(template, slot, client, orderManager, factions); LobbyUtils.SetupEditableTeamWidget(template, slot, client, orderManager, Map); LobbyUtils.SetupEditableSpawnWidget(template, slot, client, orderManager, Map); LobbyUtils.SetupEditableReadyWidget(template, slot, client, orderManager, Map); @@ -730,7 +730,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic LobbyUtils.SetupKickWidget(template, slot, client, orderManager, lobby, () => panel = PanelType.Kick, () => panel = PanelType.Players); LobbyUtils.SetupColorWidget(template, slot, client); - LobbyUtils.SetupFactionWidget(template, slot, client, countries); + LobbyUtils.SetupFactionWidget(template, slot, client, factions); LobbyUtils.SetupTeamWidget(template, slot, client); LobbyUtils.SetupSpawnWidget(template, slot, client); LobbyUtils.SetupReadyWidget(template, slot, client); @@ -834,7 +834,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic } } - public class LobbyCountry + public class LobbyFaction { public bool Selectable; public string Name; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index dbe46ed3a4..29c090f4e5 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -105,24 +105,24 @@ namespace OpenRA.Mods.Common.Widgets.Logic } public static void ShowRaceDropDown(DropDownButtonWidget dropdown, Session.Client client, - OrderManager orderManager, Dictionary countries) + OrderManager orderManager, Dictionary factions) { Func setupItem = (race, itemTemplate) => { var item = ScrollItemWidget.Setup(itemTemplate, () => client.Race == race, () => orderManager.IssueOrder(Order.Command("race {0} {1}".F(client.Index, race)))); - var country = countries[race]; - item.Get("LABEL").GetText = () => country.Name; + var faction = factions[race]; + item.Get("LABEL").GetText = () => faction.Name; var flag = item.Get("FLAG"); flag.GetImageCollection = () => "flags"; flag.GetImageName = () => race; - item.GetTooltipText = () => country.Description; + item.GetTooltipText = () => faction.Description; return item; }; - var options = countries.Where(c => c.Value.Selectable).GroupBy(c => c.Value.Side) - .ToDictionary(g => g.Key ?? "", g => g.Select(c => c.Key)); + var options = factions.Where(f => f.Value.Selectable).GroupBy(f => f.Value.Side) + .ToDictionary(g => g.Key ?? "", g => g.Select(f => f.Key)); dropdown.ShowDropDown("RACE_DROPDOWN_TEMPLATE", 150, options, setupItem); } @@ -395,21 +395,21 @@ namespace OpenRA.Mods.Common.Widgets.Logic } public static void SetupEditableFactionWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, - Dictionary countries) + Dictionary factions) { var dropdown = parent.Get("FACTION"); dropdown.IsDisabled = () => s.LockRace || orderManager.LocalClient.IsReady; - dropdown.OnMouseDown = _ => ShowRaceDropDown(dropdown, c, orderManager, countries); - var factionDescription = countries[c.Race].Description; + dropdown.OnMouseDown = _ => ShowRaceDropDown(dropdown, c, orderManager, factions); + var factionDescription = factions[c.Race].Description; dropdown.GetTooltipText = () => factionDescription; - SetupFactionWidget(dropdown, s, c, countries); + SetupFactionWidget(dropdown, s, c, factions); } public static void SetupFactionWidget(Widget parent, Session.Slot s, Session.Client c, - Dictionary countries) + Dictionary factions) { var factionName = parent.Get("FACTIONNAME"); - factionName.GetText = () => countries[c.Race].Name; + factionName.GetText = () => factions[c.Race].Name; var factionFlag = parent.Get("FACTIONFLAG"); factionFlag.GetImageName = () => c.Race; factionFlag.GetImageCollection = () => "flags"; diff --git a/OpenRA.Mods.D2k/Traits/Buildings/ProductionFromMapEdge.cs b/OpenRA.Mods.D2k/Traits/Buildings/ProductionFromMapEdge.cs index 63b7b7d3c3..b2a9852571 100644 --- a/OpenRA.Mods.D2k/Traits/Buildings/ProductionFromMapEdge.cs +++ b/OpenRA.Mods.D2k/Traits/Buildings/ProductionFromMapEdge.cs @@ -50,7 +50,7 @@ namespace OpenRA.Mods.D2k.Traits }; if (raceVariant != null) - td.Add(new RaceInit(raceVariant)); + td.Add(new FactionInit(raceVariant)); var newUnit = self.World.CreateActor(producee.Name, td); diff --git a/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs b/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs index 434d145947..f507e97f10 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.Faction.InternalName; + race = init.Contains() ? init.Get() : init.Self.Owner.Faction.InternalName; } public void UnitProducedByOther(Actor self, Actor producer, Actor produced) diff --git a/OpenRA.Mods.RA/Traits/LeavesHusk.cs b/OpenRA.Mods.RA/Traits/LeavesHusk.cs index 736a81d2ba..50d0568b4c 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.Faction.InternalName; + race = init.Contains() ? init.Get() : init.Self.Owner.Faction.InternalName; } public void Killed(Actor self, AttackInfo e) @@ -49,7 +49,7 @@ namespace OpenRA.Mods.RA.Traits new LocationInit(self.Location), new CenterPositionInit(self.CenterPosition), new OwnerInit(self.Owner), - new RaceInit(race), + new FactionInit(race), new SkipMakeAnimsInit() }; diff --git a/mods/cnc/chrome/tooltips.yaml b/mods/cnc/chrome/tooltips.yaml index e14da3f3f6..ad988318ea 100644 --- a/mods/cnc/chrome/tooltips.yaml +++ b/mods/cnc/chrome/tooltips.yaml @@ -190,7 +190,7 @@ Background@CLIENT_TOOLTIP: Font: TinyBold Background@FACTION_DESCRIPTION_TOOLTIP: - Logic: CountryTooltipLogic + Logic: FactionTooltipLogic Background: panel-black Children: Label@HEADER: diff --git a/mods/d2k/chrome/ingame-player.yaml b/mods/d2k/chrome/ingame-player.yaml index 6f16d44610..8f0182df69 100644 --- a/mods/d2k/chrome/ingame-player.yaml +++ b/mods/d2k/chrome/ingame-player.yaml @@ -149,7 +149,7 @@ Container@PLAYER_WIDGETS: Children: LogicTicker@RADAR_TICKER: Image@INSIGNIA: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 60 Y: 75 ImageCollection: radar diff --git a/mods/d2k/chrome/tooltips.yaml b/mods/d2k/chrome/tooltips.yaml index 01c59883d3..2dba2e5846 100644 --- a/mods/d2k/chrome/tooltips.yaml +++ b/mods/d2k/chrome/tooltips.yaml @@ -198,7 +198,7 @@ Background@SUPPORT_POWER_TOOLTIP: VAlign: Top Background@FACTION_DESCRIPTION_TOOLTIP: - Logic: CountryTooltipLogic + Logic: FactionTooltipLogic Background: dialog3 Children: Label@HEADER: diff --git a/mods/ra/chrome/ingame-player.yaml b/mods/ra/chrome/ingame-player.yaml index 3823bc93d1..bf3e7b88b2 100644 --- a/mods/ra/chrome/ingame-player.yaml +++ b/mods/ra/chrome/ingame-player.yaml @@ -17,7 +17,7 @@ Container@PLAYER_WIDGETS: Container@PALETTE_FOREGROUND: Children: Image@ICON_TEMPLATE: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X:0-2 Y:0-2 Width: 62 @@ -30,7 +30,7 @@ Container@PLAYER_WIDGETS: Y: 10 Order: Descending Image@SIDEBAR_BACKGROUND_TOP: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: WINDOW_RIGHT - 250 Y: 10 Width: 238 @@ -45,7 +45,7 @@ Container@PLAYER_WIDGETS: Y: 7 Children: Button@BEACON_BUTTON: - Logic: BeaconOrderButtonLogic, AddRaceSuffixLogic + Logic: BeaconOrderButtonLogic, AddFactionSuffixLogic Width: 28 Height: 28 Background: sidebar-button @@ -58,7 +58,7 @@ Container@PLAYER_WIDGETS: Y: 6 ImageCollection: order-icons Button@SELL_BUTTON: - Logic: SellOrderButtonLogic, AddRaceSuffixLogic + Logic: SellOrderButtonLogic, AddFactionSuffixLogic X: 32 Width: 28 Height: 28 @@ -72,7 +72,7 @@ Container@PLAYER_WIDGETS: Y: 6 ImageCollection: order-icons Button@POWER_BUTTON: - Logic: PowerdownOrderButtonLogic, AddRaceSuffixLogic + Logic: PowerdownOrderButtonLogic, AddFactionSuffixLogic X: 64 Width: 28 Height: 28 @@ -86,7 +86,7 @@ Container@PLAYER_WIDGETS: Y: 6 ImageCollection: order-icons Button@REPAIR_BUTTON: - Logic: RepairOrderButtonLogic, AddRaceSuffixLogic + Logic: RepairOrderButtonLogic, AddFactionSuffixLogic X: 96 Width: 28 Height: 28 @@ -100,7 +100,7 @@ Container@PLAYER_WIDGETS: Y: 6 ImageCollection: order-icons MenuButton@DEBUG_BUTTON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Key: escape Shift X: 128 Width: 28 @@ -116,7 +116,7 @@ Container@PLAYER_WIDGETS: ImageCollection: order-icons ImageName: debug MenuButton@DIPLOMACY_BUTTON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic MenuContainer: INGAME_DIPLOMACY_BG HideIngameUI: false Pause: false @@ -135,7 +135,7 @@ Container@PLAYER_WIDGETS: ImageCollection: order-icons ImageName: diplomacy MenuButton@OPTIONS_BUTTON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Key: escape X: 192 Width: 28 @@ -217,14 +217,14 @@ Container@PLAYER_WIDGETS: Container@PALETTE_BACKGROUND: Children: Image@ROW_TEMPLATE: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Width: 238 Height: 47 ClickThrough: false ImageCollection: sidebar ImageName: background-iconrow Image@BOTTOM_CAP: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Width: 238 Height: 8 ClickThrough: false @@ -257,7 +257,7 @@ Container@PLAYER_WIDGETS: Height: 240 Children: ProductionTypeButton@BUILDING: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Width: 28 Height: 28 VisualHeight: 0 @@ -272,7 +272,7 @@ Container@PLAYER_WIDGETS: Y: 6 ImageCollection: production-icons ProductionTypeButton@DEFENSE: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Y: 31 Width: 28 Height: 28 @@ -288,7 +288,7 @@ Container@PLAYER_WIDGETS: Y: 6 ImageCollection: production-icons ProductionTypeButton@INFANTRY: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Y: 62 Width: 28 Height: 28 @@ -304,7 +304,7 @@ Container@PLAYER_WIDGETS: Y: 6 ImageCollection: production-icons ProductionTypeButton@VEHICLE: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Y: 93 Width: 28 Height: 28 @@ -320,7 +320,7 @@ Container@PLAYER_WIDGETS: Y: 6 ImageCollection: production-icons ProductionTypeButton@AIRCRAFT: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Y: 124 Width: 28 Height: 28 @@ -336,7 +336,7 @@ Container@PLAYER_WIDGETS: Y: 6 ImageCollection: production-icons ProductionTypeButton@NAVAL: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Y: 155 Width: 28 Height: 28 @@ -352,7 +352,7 @@ Container@PLAYER_WIDGETS: Y: 6 ImageCollection: production-icons Button@SCROLL_UP_BUTTON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Y: 186 Width: 28 Height: 22 @@ -367,7 +367,7 @@ Container@PLAYER_WIDGETS: ImageCollection: scrollbar ImageName: up_arrow Button@SCROLL_DOWN_BUTTON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Y: 211 Width: 28 Height: 22 diff --git a/mods/ra/chrome/tooltips.yaml b/mods/ra/chrome/tooltips.yaml index 89705556fd..99d483dc78 100644 --- a/mods/ra/chrome/tooltips.yaml +++ b/mods/ra/chrome/tooltips.yaml @@ -198,7 +198,7 @@ Background@SUPPORT_POWER_TOOLTIP: VAlign: Top Background@FACTION_DESCRIPTION_TOOLTIP: - Logic: CountryTooltipLogic + Logic: FactionTooltipLogic Background: dialog4 Children: Label@HEADER: diff --git a/mods/ra/metrics.yaml b/mods/ra/metrics.yaml index 68e942cfb7..cf1c961e82 100644 --- a/mods/ra/metrics.yaml +++ b/mods/ra/metrics.yaml @@ -25,13 +25,13 @@ Metrics: SpawnColor: 255,255,255 SpawnContrastColor: 0,0,0 SpawnLabelOffset: 0,1 - RaceSuffix-allies: allies - RaceSuffix-england: allies - RaceSuffix-france: allies - RaceSuffix-germany: allies - RaceSuffix-soviet: soviet - RaceSuffix-russia: soviet - RaceSuffix-ukraine: soviet + FactionSuffix-allies: allies + FactionSuffix-england: allies + FactionSuffix-france: allies + FactionSuffix-germany: allies + FactionSuffix-soviet: soviet + FactionSuffix-russia: soviet + FactionSuffix-ukraine: soviet IncompatibleGameColor: 169,169,169 CantJoinGameColor: 211,211,211 ProtectedGameColor: 255,0,0 @@ -39,4 +39,4 @@ Metrics: WaitingGameColor: 0,255,0 IncompatibleWaitingGameColor: 50,205,50 GameStartedColor: 255,165,0 - IncompatibleGameStartedColor: 210,105,30 \ No newline at end of file + IncompatibleGameStartedColor: 210,105,30 diff --git a/mods/ts/chrome.yaml b/mods/ts/chrome.yaml index 62e4b56765..b044bdb67b 100644 --- a/mods/ts/chrome.yaml +++ b/mods/ts/chrome.yaml @@ -108,7 +108,7 @@ order-icons-gdi: chrome.png diplomacy-disabled: 327,481,30,31 diplomacy-active: 296,481,30,31 -# make this paragraph AddRaceSuffixLogic compatible +# make this paragraph AddFactionSuffixLogic compatible sidebar-bits-gdi: chrome.png production-tooltip-time: 416,208,16,16 production-tooltip-power: 480,160,16,16 @@ -230,7 +230,7 @@ order-icons-nod: chrome.png diplomacy-disabled: 839,481,30,31 diplomacy-active: 808,481,30,31 -# make this paragraph AddRaceSuffixLogic compatible +# make this paragraph AddFactionSuffixLogic compatible sidebar-bits-nod: chrome.png production-tooltip-time: 928,208,16,16 production-tooltip-power: 992,160,16,16 @@ -249,7 +249,7 @@ cash-icons-nod: chrome.png # GENERIC # ---------------------------------------------------------------------- -# make this paragraph AddRaceSuffixLogic compatible +# make this paragraph AddFactionSuffixLogic compatible sidebar-bits: chrome.png production-tooltip-time: 416,208,16,16 production-tooltip-power: 480,160,16,16 diff --git a/mods/ts/chrome/ingame-player.yaml b/mods/ts/chrome/ingame-player.yaml index b9a9ec4dc6..688dfaeca2 100644 --- a/mods/ts/chrome/ingame-player.yaml +++ b/mods/ts/chrome/ingame-player.yaml @@ -17,7 +17,7 @@ Container@PLAYER_WIDGETS: Container@PALETTE_FOREGROUND: Children: Image@ICON_TEMPLATE: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X:0-2 Y:0-2 Width: 64 @@ -26,7 +26,7 @@ Container@PLAYER_WIDGETS: ImageCollection: sidebar ImageName: background-supportoverlay Image@SIDEBAR_BACKGROUND_TOP: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: WINDOW_RIGHT - 235 Y: 0 Width: 235 @@ -41,7 +41,7 @@ Container@PLAYER_WIDGETS: Y: 21 Children: MenuButton@DEBUG_BUTTON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Key: escape Shift X: 13 Width: 30 @@ -52,13 +52,13 @@ Container@PLAYER_WIDGETS: VisualHeight: 0 Children: Image@ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 0 Y: 0 ImageCollection: order-icons ImageName: debug Button@REPAIR_BUTTON: - Logic: RepairOrderButtonLogic, AddRaceSuffixLogic + Logic: RepairOrderButtonLogic, AddFactionSuffixLogic X: 43 Width: 30 Height: 31 @@ -68,12 +68,12 @@ Container@PLAYER_WIDGETS: VisualHeight: 0 Children: Image@ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 0 Y: 0 ImageCollection: order-icons Button@SELL_BUTTON: - Logic: SellOrderButtonLogic, AddRaceSuffixLogic + Logic: SellOrderButtonLogic, AddFactionSuffixLogic X: 73 Width: 30 Height: 31 @@ -83,12 +83,12 @@ Container@PLAYER_WIDGETS: VisualHeight: 0 Children: Image@ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 0 Y: 0 ImageCollection: order-icons Button@BEACON_BUTTON: - Logic: BeaconOrderButtonLogic, AddRaceSuffixLogic + Logic: BeaconOrderButtonLogic, AddFactionSuffixLogic X: 103 Width: 30 Height: 31 @@ -98,12 +98,12 @@ Container@PLAYER_WIDGETS: VisualHeight: 0 Children: Image@ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 0 Y: 0 ImageCollection: order-icons Button@POWER_BUTTON: - Logic: PowerdownOrderButtonLogic, AddRaceSuffixLogic + Logic: PowerdownOrderButtonLogic, AddFactionSuffixLogic X: 133 Width: 30 Height: 31 @@ -113,12 +113,12 @@ Container@PLAYER_WIDGETS: VisualHeight: 0 Children: Image@ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 0 Y: 0 ImageCollection: order-icons MenuButton@DIPLOMACY_BUTTON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic MenuContainer: INGAME_DIPLOMACY_BG HideIngameUI: false Pause: false @@ -132,13 +132,13 @@ Container@PLAYER_WIDGETS: VisualHeight: 0 Children: Image@ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 0 Y: 0 ImageCollection: order-icons ImageName: diplomacy MenuButton@OPTIONS_BUTTON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Key: escape X: 193 Width: 30 @@ -149,7 +149,7 @@ Container@PLAYER_WIDGETS: VisualHeight: 0 Children: Image@ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 0 Y: 0 ImageCollection: order-icons @@ -159,7 +159,7 @@ Container@PLAYER_WIDGETS: Children: LogicTicker@RADAR_TICKER: Image@INSIGNIA: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 37 Y: 85 ImageCollection: radar @@ -201,7 +201,7 @@ Container@PLAYER_WIDGETS: TooltipTemplate: SIMPLE_TOOLTIP Children: Image@CASH_ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 0-17 Y: 5 ImageCollection: cash-icons @@ -219,7 +219,7 @@ Container@PLAYER_WIDGETS: TooltipTemplate: SIMPLE_TOOLTIP Children: Image@POWER_ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: PARENT_RIGHT + 0 Y: 5 ImageCollection: power-icons @@ -234,14 +234,14 @@ Container@PLAYER_WIDGETS: Container@PALETTE_BACKGROUND: Children: Image@ROW_TEMPLATE: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Width: 235 Height: 52 ClickThrough: false ImageCollection: sidebar ImageName: background-iconrow Image@BOTTOM_CAP: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Width: 235 Height: 26 ClickThrough: false @@ -264,7 +264,7 @@ Container@PLAYER_WIDGETS: Y: 0 Children: Image@ROW_TEMPLATE: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic Width: 235 Height: 52 IgnoreMouseOver: true @@ -277,7 +277,7 @@ Container@PLAYER_WIDGETS: Height: 311 Children: ProductionTypeButton@BUILDING: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 41 Y: 1 Width: 30 @@ -290,12 +290,12 @@ Container@PLAYER_WIDGETS: HotkeyName: ProductionTypeBuildingKey Children: Image@ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 7 Y: 7 ImageCollection: production-icons ProductionTypeButton@DEFENSE: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 72 Y: 1 Width: 30 @@ -308,12 +308,12 @@ Container@PLAYER_WIDGETS: HotkeyName: ProductionTypeDefenseKey Children: Image@ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 7 Y: 7 ImageCollection: production-icons ProductionTypeButton@INFANTRY: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 103 Y: 1 Width: 30 @@ -326,12 +326,12 @@ Container@PLAYER_WIDGETS: HotkeyName: ProductionTypeInfantryKey Children: Image@ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 6 Y: 7 ImageCollection: production-icons ProductionTypeButton@VEHICLE: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 134 Y: 1 Width: 30 @@ -344,12 +344,12 @@ Container@PLAYER_WIDGETS: HotkeyName: ProductionTypeVehicleKey Children: Image@ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 7 Y: 7 ImageCollection: production-icons ProductionTypeButton@AIRCRAFT: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 165 Y: 1 Width: 30 @@ -362,12 +362,12 @@ Container@PLAYER_WIDGETS: HotkeyName: ProductionTypeAircraftKey Children: Image@ICON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 7 Y: 7 ImageCollection: production-icons Button@SCROLL_UP_BUTTON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 74 Y: PARENT_BOTTOM + 36 Width: 34 @@ -377,7 +377,7 @@ Container@PLAYER_WIDGETS: TooltipText: Scroll up TooltipContainer: TOOLTIP_CONTAINER Button@SCROLL_DOWN_BUTTON: - Logic: AddRaceSuffixLogic + Logic: AddFactionSuffixLogic X: 141 Y: PARENT_BOTTOM + 36 Width: 34