Rename Stances to ValidStances.

This commit is contained in:
Matthias Mailänder
2016-07-03 16:00:31 +02:00
parent db146ae479
commit 6148e8d8a3
3 changed files with 14 additions and 4 deletions

View File

@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public readonly int ZOffset = 1;
[Desc("Player stances who can view the decoration.")]
public readonly Stance Stances = Stance.Ally;
public readonly Stance ValidStances = Stance.Ally;
[Desc("Should this be visible only when selected?")]
public readonly bool RequiresSelection = false;
@@ -91,7 +91,7 @@ namespace OpenRA.Mods.Common.Traits.Render
if (self.World.RenderPlayer != null)
{
var stance = self.Owner.Stances[self.World.RenderPlayer];
if (!Info.Stances.HasStance(stance))
if (!Info.ValidStances.HasStance(stance))
return Enumerable.Empty<IRenderable>();
}

View File

@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public readonly int ZOffset = 1;
[Desc("Player stances who can view the decoration.")]
public readonly Stance Stances = Stance.Ally;
public readonly Stance ValidStances = Stance.Ally;
[Desc("Should this be visible only when selected?")]
public readonly bool RequiresSelection = false;
@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Traits.Render
if (self.World.RenderPlayer != null)
{
var stance = self.Owner.Stances[self.World.RenderPlayer];
if (!Info.Stances.HasStance(stance))
if (!Info.ValidStances.HasStance(stance))
return Enumerable.Empty<IRenderable>();
}

View File

@@ -212,6 +212,16 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
}
if (engineVersion < 20160703)
{
if (node.Key.StartsWith("WithDecoration") || node.Key.StartsWith("WithRankDecoration") || node.Key.StartsWith("WithDecorationCarryable"))
{
var stancesNode = node.Value.Nodes.FirstOrDefault(n => n.Key == "Stances");
if (stancesNode != null)
stancesNode.Key = "ValidStances";
}
}
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
}