Rename Faction trait members
Rename Faction.Race to Faction.InternalName
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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<LabelWidget>("FACTION").GetText = () => pp.Country.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag.GetImageName = () => pp.DisplayCountry.Race;
|
||||
flag.GetImageName = () => pp.DisplayCountry.InternalName;
|
||||
item.Get<LabelWidget>("FACTION").GetText = () => pp.DisplayCountry.Name;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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(); };
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<FactionInfo>())
|
||||
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<bool> configurationDisabled = () => !Game.IsHost || gameStarting ||
|
||||
|
||||
@@ -456,9 +456,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var flag = template.Get<ImageWidget>("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<LabelWidget>("PLAYER");
|
||||
var client = player.World.LobbyInfo.ClientWithIndex(player.ClientIndex);
|
||||
|
||||
Reference in New Issue
Block a user