Пример #1
0
        private void btnAxisMappingEditor_Click(object sender, EventArgs e)
        {
            int selectedvJoyIndexAxis = cmbSelectedAxis.SelectedIndex;

            if (Program.Manager.vJoy == null)
            {
                return;
            }

            var axis = Program.Manager.vJoy.SafeGetUsedAxis(selectedvJoyIndexAxis);

            if (axis == null)
            {
                return;
            }

            AxisMappingEditor editor = new AxisMappingEditor();

            editor.SelectedAxis = selectedvJoyIndexAxis;
            editor.InputRawDB   = (RawAxisDB)axis.RawAxisDB.Clone();
            var res = editor.ShowDialog(this);

            if (res == DialogResult.OK)
            {
                axis.RawAxisDB = editor.ResultRawDB;
                Program.Manager.SaveControlSetFiles();
            }
        }
Пример #2
0
        private void btnAxisMappingEditor_Click(object sender, EventArgs e)
        {
            int selectedvJoyIndexAxis = cmbSelectedAxis.SelectedIndex;

            if (selectedvJoyIndexAxis < 0)
            {
                return;
            }

            // Make sure vJoy is enabled
            if (vJoy == null)
            {
                return;
            }
            var cs = CurrentControlSet;
            // Ensure we have a valid axis
            var axis = cs.RawAxisDBs[selectedvJoyIndexAxis];

            if (axis == null)
            {
                return;
            }

            AxisMappingEditor editor = new AxisMappingEditor(cs);

            editor.SelectedAxis = selectedvJoyIndexAxis;
            // Clone configuration before modifying it
            editor.InputRawDB = (RawAxisDB)cs.RawAxisDBs[selectedvJoyIndexAxis].Clone();
            var res = editor.ShowDialog(this);

            if (res == DialogResult.OK)
            {
                // Save new object
                cs.RawAxisDBs[selectedvJoyIndexAxis] = editor.ResultRawDB;
                SharedData.Manager.SaveControlSetFiles();
            }
            editor.Dispose();
        }