private void LoadConfig(string fileToLoad) { keyBindings = new KeyboardBindings(); videoSettings = new VideoSettings(); otherSettings = new OtherSettings(); string[] lines = File.ReadAllLines(fileToLoad); foreach (var line in lines) { if (line.StartsWithExt("bind")) { keyBindings.TranslateFromBind(line); } else if (line.StartsWith("seta")) { var strippedLine = line.StripChunk(); if (!videoSettings.ParseSetting(line)) { otherSettings.ParseSetting(line); } } else { otherSettings.otherSettings.Add(line); } } SetupDataBindings(); }
private void B_KeybindsEditManually_Click(object sender, EventArgs e) { Forms.Keybinds_EditManually manualEditor = new Forms.Keybinds_EditManually(keyBindings.TranslateToBind()); var result = manualEditor.ShowDialog(); if (result == DialogResult.OK) { var newBinds = new KeyboardBindings(); foreach (var line in manualEditor.bindContentTXT) { newBinds.TranslateFromBind(line); } keyBindings = newBinds; } }