Add hotkey settings panel with a hotkey remap dialog

* Add HotkeyDialogLogic.cs
* Add dialog-hotkey.yaml to all mods
* Add `GetFirstDuplicate` method to HotkeyManager to aid in validation
* Add "Player" and/or "Spectator" type to all hotkeys to allow for
validation based on overlapping types
* Change settings.yaml and SettingsLogic.cs to work with the new dialog
This commit is contained in:
Ivaylo Draganov
2019-05-10 13:51:23 +03:00
committed by abcdefg30
parent 9783fdaf78
commit c9ff54bfd5
23 changed files with 619 additions and 156 deletions

View File

@@ -67,6 +67,20 @@ namespace OpenRA
settings.Remove(name);
}
public HotkeyDefinition GetFirstDuplicate(string name, Hotkey value, HotkeyDefinition definition)
{
foreach (var kv in keys)
{
if (kv.Key == name)
continue;
if (kv.Value == value && definitions[kv.Key].Types.Overlaps(definition.Types))
return definitions[kv.Key];
}
return null;
}
public HotkeyReference this[string name]
{
get