Fix UpgradeChromeMetrics.
This needs to handle the null value passed in for the parent parameter from it's only (non-recursive) callsite.
This commit is contained in:
@@ -3410,13 +3410,15 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
|
|
||||||
internal static void UpgradeChromeLayout(int engineVersion, ref List<MiniYamlNode> nodes, MiniYamlNode parent, int depth)
|
internal static void UpgradeChromeLayout(int engineVersion, ref List<MiniYamlNode> nodes, MiniYamlNode parent, int depth)
|
||||||
{
|
{
|
||||||
|
var parentKey = parent != null ? parent.Key.Split('@').First() : null;
|
||||||
|
|
||||||
foreach (var node in nodes)
|
foreach (var node in nodes)
|
||||||
{
|
{
|
||||||
if (engineVersion < 20151102)
|
if (engineVersion < 20151102)
|
||||||
{
|
{
|
||||||
if (node.Key == "Color" || node.Key == "ReadyTextAltColor" || node.Key == "TextColor" || node.Key == "TextColorDisabled")
|
if (node.Key == "Color" || node.Key == "ReadyTextAltColor" || node.Key == "TextColor" || node.Key == "TextColorDisabled")
|
||||||
{
|
{
|
||||||
if (parent.Key.StartsWith("MapPreview@"))
|
if (parentKey == "MapPreview")
|
||||||
TryUpdateHSLColor(ref node.Value.Value);
|
TryUpdateHSLColor(ref node.Value.Value);
|
||||||
else
|
else
|
||||||
TryUpdateColor(ref node.Value.Value);
|
TryUpdateColor(ref node.Value.Value);
|
||||||
|
|||||||
Reference in New Issue
Block a user