示例#1
0
        void CustomizeControls()
        {
            ActionKeybindEditor editor = new ActionKeybindEditor(actionList.ActionKeyMappings.ToArray());

            editor.ShowDialog();

            // copy all our mappings back
            actionList.ActionKeyMappings.Clear();

            ActionKeyMapping[] newMappings = editor.GetActionkeyMappings();
            foreach (ActionKeyMapping mapping in newMappings)
            {
                actionList.ActionKeyMappings.Add(mapping);
            }

            actionInputCollector.SetActions(newMappings);

            // save our controls
            string saveControlsPath = Path.Combine(Application.StartupPath, "keybinds.ini");

            actionList.Save(saveControlsPath);

            this.BringToFront();
            optionsEditor.BringToFront();
            optionsEditor.Focus();
            //this.panel1.Focus();
        }
示例#2
0
        void optionsEditor_FormUpdatedKeys()
        {
            // Keybinds
            actionList.ActionKeyMappings.Clear();
            ActionKeyMapping[] newMappings = optionsEditor.GetActionkeyMappings();
            foreach (ActionKeyMapping mapping in newMappings)
            {
                actionList.ActionKeyMappings.Add(mapping);
            }
            actionInputCollector.SetActions(newMappings);
            string saveControlsPath = Path.Combine(Application.StartupPath, "keybinds", "SA2EventViewer.ini");

            actionList.Save(saveControlsPath);
            // Other settings
            optionsEditor_FormUpdated();
        }