|
@@ -11,7 +11,10 @@ public abstract class KeysParser
|
|
|
|
|
|
public Dictionary<string, KeyDefinition> Map => _cachedMap ??= LoadKeysMap();
|
|
public Dictionary<string, KeyDefinition> Map => _cachedMap ??= LoadKeysMap();
|
|
private Dictionary<string, KeyDefinition> _cachedMap;
|
|
private Dictionary<string, KeyDefinition> _cachedMap;
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ public List<Shortcut> Defaults => _cachedDefaults ??= ParseDefaults();
|
|
|
|
+ private List<Shortcut> _cachedDefaults;
|
|
|
|
+
|
|
public KeysParser(string mapFileName)
|
|
public KeysParser(string mapFileName)
|
|
{
|
|
{
|
|
_fullMapFilePath = Path.Combine("Data", "ShortcutActionMaps", mapFileName);
|
|
_fullMapFilePath = Path.Combine("Data", "ShortcutActionMaps", mapFileName);
|
|
@@ -33,4 +36,18 @@ public abstract class KeysParser
|
|
if(dict.ContainsKey("")) dict.Remove("");
|
|
if(dict.ContainsKey("")) dict.Remove("");
|
|
return dict;
|
|
return dict;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private List<Shortcut> ParseDefaults()
|
|
|
|
+ {
|
|
|
|
+ var defaults = new List<Shortcut>();
|
|
|
|
+ foreach (var (key, value) in Map)
|
|
|
|
+ {
|
|
|
|
+ if (value.DefaultShortcut != null)
|
|
|
|
+ {
|
|
|
|
+ defaults.Add(new Shortcut(value.DefaultShortcut.ToKeyCombination(), Map[key].Command));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return defaults;
|
|
|
|
+ }
|
|
}
|
|
}
|