Merge pull request #8659 from penev92/bleed_playerReference
Rename PlayerReference.Race to Faction
This commit is contained in:
@@ -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.Race));
|
||||
td.Add(new RaceInit(owner.Faction));
|
||||
preview.SetPreview(actor, td);
|
||||
|
||||
var ios = actor.Traits.GetOrDefault<IOccupySpaceInfo>();
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace OpenRA.Mods.Common.Lint
|
||||
|
||||
var races = worldActor.Traits.WithInterface<CountryInfo>().Select(c => c.Race);
|
||||
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));
|
||||
if (!string.IsNullOrWhiteSpace(player.Faction) && !races.Contains(player.Faction))
|
||||
emitError("Invalid race {0} chosen for player {1}.".F(player.Faction, player.Name));
|
||||
|
||||
if (worldActor.Traits.Contains<MPStartLocationsInfo>())
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
public HSLColor Color { get { return Player.Color; } }
|
||||
|
||||
[Desc("The player's race.")]
|
||||
public string Race { get { return Player.PlayerReference.Race; } }
|
||||
public string Race { get { return Player.PlayerReference.Faction; } }
|
||||
|
||||
[Desc("The player's spawnpoint ID.")]
|
||||
public int Spawn { get { return Player.SpawnPoint; } }
|
||||
|
||||
@@ -900,7 +900,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
PlayerReference = pr.Name,
|
||||
Closed = false,
|
||||
AllowBots = pr.AllowBots,
|
||||
LockRace = pr.LockRace,
|
||||
LockRace = pr.LockFaction,
|
||||
LockColor = pr.LockColor,
|
||||
LockTeam = pr.LockTeam,
|
||||
LockSpawn = pr.LockSpawn,
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Name = "Everyone",
|
||||
NonCombatant = true,
|
||||
Spectating = true,
|
||||
Race = "Random",
|
||||
Faction = "Random",
|
||||
Allies = w.Players.Where(p => !p.NonCombatant && p.Playable).Select(p => p.InternalName).ToArray()
|
||||
}));
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var pr = new PlayerReference
|
||||
{
|
||||
Name = "Multi{0}".F(index),
|
||||
Race = "Random",
|
||||
Faction = "Random",
|
||||
Playable = true,
|
||||
Enemies = new[] { "Creeps" }
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
this.worldRenderer = worldRenderer;
|
||||
|
||||
if (!actor.InitDict.Contains<RaceInit>())
|
||||
actor.InitDict.Add(new RaceInit(owner.Race));
|
||||
actor.InitDict.Add(new RaceInit(owner.Faction));
|
||||
|
||||
if (!actor.InitDict.Contains<OwnerInit>())
|
||||
actor.InitDict.Add(new OwnerInit(owner.Name));
|
||||
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Func<object, bool> saveInit = init =>
|
||||
{
|
||||
var race = init as RaceInit;
|
||||
if (race != null && race.Race == Owner.Race)
|
||||
if (race != null && race.Race == Owner.Faction)
|
||||
return false;
|
||||
|
||||
// TODO: Other default values will need to be filtered
|
||||
|
||||
@@ -500,7 +500,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
Name = section,
|
||||
OwnsWorld = section == "Neutral",
|
||||
NonCombatant = section == "Neutral",
|
||||
Race = race,
|
||||
Faction = race,
|
||||
Color = namedColorMapping[c]
|
||||
};
|
||||
|
||||
|
||||
@@ -2013,7 +2013,21 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
internal static void UpgradePlayers(int engineVersion, ref List<MiniYamlNode> nodes, MiniYamlNode parent, int depth)
|
||||
{
|
||||
foreach (var node in nodes)
|
||||
{
|
||||
// Rename PlayerReference.Race and LockRace to Faction and LockFaction
|
||||
if (engineVersion < 20150706)
|
||||
{
|
||||
var race = node.Value.Nodes.FirstOrDefault(x => x.Key == "Race");
|
||||
if (race != null)
|
||||
race.Key = "Faction";
|
||||
|
||||
var lockRace = node.Value.Nodes.FirstOrDefault(x => x.Key == "LockRace");
|
||||
if (lockRace != null)
|
||||
lockRace.Key = "LockFaction";
|
||||
}
|
||||
|
||||
UpgradePlayers(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void UpgradeActors(int engineVersion, ref List<MiniYamlNode> nodes, MiniYamlNode parent, int depth)
|
||||
|
||||
@@ -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.Race));
|
||||
td.Add(new RaceInit(world.WorldActor.Owner.PlayerReference.Faction));
|
||||
|
||||
if (preview != null)
|
||||
preview.SetPreview(actor, td);
|
||||
|
||||
@@ -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.Race));
|
||||
td.Add(new RaceInit(selectedOwner.Faction));
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user