void SaveKeyBindings() { string[] names = KeyBind.GetNames(typeof(KeyBind)); for (int i = 0; i < names.Length; i++) { Options.Set("key-" + names[i], keys[i]); } }
void LoadKeyBindings() { string[] names = KeyBind.GetNames(typeof(KeyBind)); for (int i = 0; i < names.Length; i++) { string key = "key-" + names[i]; Key mapping = Options.GetEnum(key, keys[i]); if (mapping != Key.Escape) { keys[i] = mapping; } } }