Shift CustomBuildTimeValue to Buildable.

This commit is contained in:
Zimmermann Gyula
2016-08-21 12:05:32 +02:00
parent e93d7dd172
commit de10cb22e8
7 changed files with 61 additions and 50 deletions

View File

@@ -292,7 +292,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
// DisplayTimer was replaced by DisplayTimerStances
if (engineVersion < 20160710)
if (engineVersion < 20160820)
{
if (node.Key == "DisplayTimer")
{
@@ -305,6 +305,30 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
}
if (engineVersion < 20160821)
{
// Shifted custom build time properties to Buildable
if (depth == 0)
{
var cbtv = node.Value.Nodes.FirstOrDefault(n => n.Key == "CustomBuildTimeValue");
if (cbtv != null)
{
var bi = node.Value.Nodes.FirstOrDefault(n => n.Key == "Buildable");
if (bi == null)
node.Value.Nodes.Add(bi = new MiniYamlNode("Buildable", ""));
var value = cbtv.Value.Nodes.First(n => n.Key == "Value");
value.Key = "BuildDuration";
bi.Value.Nodes.Add(value);
bi.Value.Nodes.Add(new MiniYamlNode("BuildDurationModifier", "100"));
}
node.Value.Nodes.RemoveAll(n => n.Key == "CustomBuildTimeValue");
node.Value.Nodes.RemoveAll(n => n.Key == "-CustomBuildTimeValue");
}
}
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
}