Add platform override support for hotkeys and unhardcode editor hotkeys

This commit is contained in:
Ivaylo Draganov
2022-05-05 22:51:27 +03:00
committed by Paul Chote
parent 1cf4838b08
commit 6a1a6b6397
12 changed files with 45 additions and 14 deletions

View File

@@ -41,6 +41,14 @@ namespace OpenRA
var contextsNode = node.Nodes.FirstOrDefault(n => n.Key == "Contexts");
if (contextsNode != null)
Contexts = FieldLoader.GetValue<HashSet<string>>("Contexts", contextsNode.Value.Value);
var platformNode = node.Nodes.FirstOrDefault(n => n.Key == "Platform");
if (platformNode != null)
{
var platformOverride = platformNode.Value.Nodes.FirstOrDefault(n => n.Key == Platform.CurrentPlatform.ToString());
if (platformOverride != null)
Default = FieldLoader.GetValue<Hotkey>("value", platformOverride.Value.Value);
}
}
}
}