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:
committed by
abcdefg30
parent
9783fdaf78
commit
c9ff54bfd5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user