Introduce NamedHotkey type.

This commit is contained in:
Paul Chote
2017-08-13 10:44:45 +00:00
committed by reaperrr
parent 13a06c6e8d
commit 42bf232b37
4 changed files with 63 additions and 0 deletions

View File

@@ -307,6 +307,15 @@ namespace OpenRA
Expression.Field(keySettings, "{0}{1:D2}Key".F(prefix, i + 1)), keySettings).Compile());
}
internal Func<Hotkey> GetHotkeyReference(string name)
{
var field = typeof(KeySettings).GetField(name + "Key");
if (field == null)
return null;
return () => (Hotkey)field.GetValue(this);
}
public Hotkey GetProductionHotkey(int index)
{
return GetKey(ProductionKeys, index);