Migrate hotkey consumers to HotkeyManager.

This commit is contained in:
Paul Chote
2017-10-28 09:12:54 +01:00
committed by abcdefg30
parent 35a3df3736
commit 2f79173044
21 changed files with 51 additions and 64 deletions

View File

@@ -17,14 +17,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
public abstract class SingleHotkeyBaseLogic : ChromeLogic
{
protected SingleHotkeyBaseLogic(Widget widget, string argName, string parentName, Dictionary<string, MiniYaml> logicArgs)
protected SingleHotkeyBaseLogic(Widget widget, ModData modData, string argName, string parentName, Dictionary<string, MiniYaml> logicArgs)
{
var ks = Game.Settings.Keys;
MiniYaml yaml;
var namedKey = new HotkeyReference();
if (logicArgs.TryGetValue(argName, out yaml))
namedKey = new HotkeyReference(yaml.Value, ks);
namedKey = modData.Hotkeys[yaml.Value];
var keyhandler = widget.Get<LogicKeyListenerWidget>(parentName);
keyhandler.AddHandler(e =>