Set duplicates flag for hotkeys in HotkeyManager

This commit is contained in:
Ivaylo Draganov
2019-09-30 02:34:37 +03:00
committed by abcdefg30
parent 38f5d2c100
commit ad02adff3e
3 changed files with 18 additions and 7 deletions

View File

@@ -490,9 +490,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (selectedHotkeyDefinition == null)
selectedHotkeyDefinition = hd;
if (modData.Hotkeys.GetFirstDuplicate(hd.Name, modData.Hotkeys[hd.Name].GetValue(), hd) != null)
hd.HasDuplicates = true;
BindHotkeyPref(hd, template, hotkeyList);
}
}
@@ -801,9 +798,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
WidgetUtils.TruncateButtonToTooltip(selectedHotkeyButton, hotkeyEntryWidget.Key.DisplayString());
modData.Hotkeys.Set(selectedHotkeyDefinition.Name, hotkeyEntryWidget.Key);
Game.Settings.Save();
foreach (var hd in modData.Hotkeys.Definitions)
hd.HasDuplicates = modData.Hotkeys.GetFirstDuplicate(hd.Name, modData.Hotkeys[hd.Name].GetValue(), hd) != null;
}
void ResetHotkey()