From b4c534634628bf24e3a56ea663109c232c801315 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 11 Nov 2017 21:56:10 +0000 Subject: [PATCH] Migrate hotkey linter to HotkeyManager. --- OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs b/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs index 4e18d8484f..a4c9fb0606 100644 --- a/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs +++ b/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs @@ -35,12 +35,8 @@ namespace OpenRA.Mods.Common.Lint { public void Run(Action emitError, Action emitWarning, ModData modData) { - // Build the list of valid key names - // For now they are hardcoded, but this will change. - var namedKeys = typeof(KeySettings).GetFields() - .Where(x => x.Name.EndsWith("Key", StringComparison.Ordinal)) - .Select(x => x.Name.Substring(0, x.Name.Length - 3)) - .ToArray(); + // Build the list of valid hotkey names + var namedKeys = modData.Hotkeys.Definitions.Select(d => d.Name).ToArray(); // Build the list of widget keys to validate var checkWidgetFields = modData.ObjectCreator.GetTypesImplementing()