contrller config: reimplement save defaults button in a more useful way (only modifies defaults for the config currently being edited). as before, it's INTERIM only

This commit is contained in:
goyuken 2013-07-31 20:34:20 +00:00
parent bfcc1a6684
commit 8a2b008a11
3 changed files with 269 additions and 228 deletions

View File

@ -28,184 +28,197 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewControllerConfig)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewControllerConfig));
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage(); this.tabPage3 = new System.Windows.Forms.TabPage();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.checkBoxAutoTab = new System.Windows.Forms.CheckBox(); this.checkBoxAutoTab = new System.Windows.Forms.CheckBox();
this.checkBoxUDLR = new System.Windows.Forms.CheckBox(); this.checkBoxUDLR = new System.Windows.Forms.CheckBox();
this.buttonOK = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.buttonLoadDefaults = new System.Windows.Forms.Button(); this.buttonLoadDefaults = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout(); this.buttonSaveDefaults = new System.Windows.Forms.Button();
this.tableLayoutPanel1.SuspendLayout(); this.tabControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
// this.SuspendLayout();
// tabControl1 //
// // tabControl1
this.tabControl1.Controls.Add(this.tabPage1); //
this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Location = new System.Drawing.Point(3, 3); this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Name = "tabControl1"; this.tabControl1.Location = new System.Drawing.Point(3, 3);
this.tabControl1.SelectedIndex = 0; this.tabControl1.Name = "tabControl1";
this.tabControl1.Size = new System.Drawing.Size(562, 493); this.tabControl1.SelectedIndex = 0;
this.tabControl1.TabIndex = 1; this.tabControl1.Size = new System.Drawing.Size(562, 493);
// this.tabControl1.TabIndex = 1;
// tabPage1 //
// // tabPage1
this.tabPage1.Location = new System.Drawing.Point(4, 22); //
this.tabPage1.Name = "tabPage1"; this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Padding = new System.Windows.Forms.Padding(3); this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(554, 467); this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.TabIndex = 0; this.tabPage1.Size = new System.Drawing.Size(554, 467);
this.tabPage1.Text = "Normal Controls"; this.tabPage1.TabIndex = 0;
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.Text = "Normal Controls";
// this.tabPage1.UseVisualStyleBackColor = true;
// tabPage2 //
// // tabPage2
this.tabPage2.Location = new System.Drawing.Point(4, 22); //
this.tabPage2.Name = "tabPage2"; this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Padding = new System.Windows.Forms.Padding(3); this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(554, 467); this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.TabIndex = 1; this.tabPage2.Size = new System.Drawing.Size(554, 467);
this.tabPage2.Text = "Autofire Controls"; this.tabPage2.TabIndex = 1;
this.tabPage2.UseVisualStyleBackColor = true; this.tabPage2.Text = "Autofire Controls";
// this.tabPage2.UseVisualStyleBackColor = true;
// tabPage3 //
// // tabPage3
this.tabPage3.Location = new System.Drawing.Point(4, 22); //
this.tabPage3.Name = "tabPage3"; this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Size = new System.Drawing.Size(554, 467); this.tabPage3.Name = "tabPage3";
this.tabPage3.TabIndex = 2; this.tabPage3.Size = new System.Drawing.Size(554, 467);
this.tabPage3.Text = "Analog Controls"; this.tabPage3.TabIndex = 2;
this.tabPage3.UseVisualStyleBackColor = true; this.tabPage3.Text = "Analog Controls";
// this.tabPage3.UseVisualStyleBackColor = true;
// label2 //
// // label2
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); //
this.label2.AutoSize = true; this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label2.Location = new System.Drawing.Point(12, 519); this.label2.AutoSize = true;
this.label2.Name = "label2"; this.label2.Location = new System.Drawing.Point(12, 519);
this.label2.Size = new System.Drawing.Size(140, 13); this.label2.Name = "label2";
this.label2.TabIndex = 2; this.label2.Size = new System.Drawing.Size(140, 13);
this.label2.Text = "Escape clears a keybinding."; this.label2.TabIndex = 2;
// this.label2.Text = "Escape clears a keybinding.";
// checkBoxAutoTab //
// // checkBoxAutoTab
this.checkBoxAutoTab.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); //
this.checkBoxAutoTab.AutoSize = true; this.checkBoxAutoTab.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBoxAutoTab.Location = new System.Drawing.Point(187, 517); this.checkBoxAutoTab.AutoSize = true;
this.checkBoxAutoTab.Name = "checkBoxAutoTab"; this.checkBoxAutoTab.Location = new System.Drawing.Point(187, 517);
this.checkBoxAutoTab.Size = new System.Drawing.Size(70, 17); this.checkBoxAutoTab.Name = "checkBoxAutoTab";
this.checkBoxAutoTab.TabIndex = 3; this.checkBoxAutoTab.Size = new System.Drawing.Size(70, 17);
this.checkBoxAutoTab.Text = "Auto Tab"; this.checkBoxAutoTab.TabIndex = 3;
this.checkBoxAutoTab.UseVisualStyleBackColor = true; this.checkBoxAutoTab.Text = "Auto Tab";
this.checkBoxAutoTab.CheckedChanged += new System.EventHandler(this.checkBoxAutoTab_CheckedChanged); this.checkBoxAutoTab.UseVisualStyleBackColor = true;
// this.checkBoxAutoTab.CheckedChanged += new System.EventHandler(this.checkBoxAutoTab_CheckedChanged);
// checkBoxUDLR //
// // checkBoxUDLR
this.checkBoxUDLR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); //
this.checkBoxUDLR.AutoSize = true; this.checkBoxUDLR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBoxUDLR.Location = new System.Drawing.Point(263, 517); this.checkBoxUDLR.AutoSize = true;
this.checkBoxUDLR.Name = "checkBoxUDLR"; this.checkBoxUDLR.Location = new System.Drawing.Point(263, 517);
this.checkBoxUDLR.Size = new System.Drawing.Size(84, 17); this.checkBoxUDLR.Name = "checkBoxUDLR";
this.checkBoxUDLR.TabIndex = 4; this.checkBoxUDLR.Size = new System.Drawing.Size(84, 17);
this.checkBoxUDLR.Text = "Allow UDLR"; this.checkBoxUDLR.TabIndex = 4;
this.checkBoxUDLR.UseVisualStyleBackColor = true; this.checkBoxUDLR.Text = "Allow UDLR";
this.checkBoxUDLR.CheckedChanged += new System.EventHandler(this.checkBoxUDLR_CheckedChanged); this.checkBoxUDLR.UseVisualStyleBackColor = true;
// this.checkBoxUDLR.CheckedChanged += new System.EventHandler(this.checkBoxUDLR_CheckedChanged);
// buttonOK //
// // buttonOK
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); //
this.buttonOK.Location = new System.Drawing.Point(764, 514); this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.Name = "buttonOK"; this.buttonOK.Location = new System.Drawing.Point(764, 514);
this.buttonOK.Size = new System.Drawing.Size(75, 23); this.buttonOK.Name = "buttonOK";
this.buttonOK.TabIndex = 5; this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.Text = "OK"; this.buttonOK.TabIndex = 5;
this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Text = "OK";
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); this.buttonOK.UseVisualStyleBackColor = true;
// this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
// buttonCancel //
// // buttonCancel
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); //
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.Location = new System.Drawing.Point(845, 514); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Location = new System.Drawing.Point(845, 514);
this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.TabIndex = 6; this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.Text = "Cancel"; this.buttonCancel.TabIndex = 6;
this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Text = "Cancel";
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); this.buttonCancel.UseVisualStyleBackColor = true;
// this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
// tableLayoutPanel1 //
// // tableLayoutPanel1
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) //
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.ColumnCount = 2; this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 340F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 340F));
this.tableLayoutPanel1.Controls.Add(this.tabControl1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.tabControl1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.pictureBox1, 1, 0); this.tableLayoutPanel1.Controls.Add(this.pictureBox1, 1, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 12); this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 12);
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(908, 499); this.tableLayoutPanel1.Size = new System.Drawing.Size(908, 499);
this.tableLayoutPanel1.TabIndex = 7; this.tableLayoutPanel1.TabIndex = 7;
// //
// pictureBox1 // pictureBox1
// //
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox1.Location = new System.Drawing.Point(571, 23); this.pictureBox1.Location = new System.Drawing.Point(571, 23);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 23, 3, 3); this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 23, 3, 3);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(334, 473); this.pictureBox1.Size = new System.Drawing.Size(334, 473);
this.pictureBox1.TabIndex = 2; this.pictureBox1.TabIndex = 2;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
// //
// buttonLoadDefaults // buttonLoadDefaults
// //
this.buttonLoadDefaults.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonLoadDefaults.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonLoadDefaults.Location = new System.Drawing.Point(683, 514); this.buttonLoadDefaults.Location = new System.Drawing.Point(683, 514);
this.buttonLoadDefaults.Name = "buttonLoadDefaults"; this.buttonLoadDefaults.Name = "buttonLoadDefaults";
this.buttonLoadDefaults.Size = new System.Drawing.Size(75, 23); this.buttonLoadDefaults.Size = new System.Drawing.Size(75, 23);
this.buttonLoadDefaults.TabIndex = 8; this.buttonLoadDefaults.TabIndex = 8;
this.buttonLoadDefaults.Text = "Defaults"; this.buttonLoadDefaults.Text = "Defaults";
this.buttonLoadDefaults.UseVisualStyleBackColor = true; this.buttonLoadDefaults.UseVisualStyleBackColor = true;
this.buttonLoadDefaults.Click += new System.EventHandler(this.buttonLoadDefaults_Click); this.buttonLoadDefaults.Click += new System.EventHandler(this.buttonLoadDefaults_Click);
// //
// NewControllerConfig // buttonSaveDefaults
// //
this.AcceptButton = this.buttonOK; this.buttonSaveDefaults.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.buttonSaveDefaults.Location = new System.Drawing.Point(602, 514);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.buttonSaveDefaults.Name = "buttonSaveDefaults";
this.CancelButton = this.buttonCancel; this.buttonSaveDefaults.Size = new System.Drawing.Size(75, 23);
this.ClientSize = new System.Drawing.Size(932, 544); this.buttonSaveDefaults.TabIndex = 9;
this.Controls.Add(this.buttonLoadDefaults); this.buttonSaveDefaults.Text = "Save Defs";
this.Controls.Add(this.checkBoxUDLR); this.buttonSaveDefaults.UseVisualStyleBackColor = true;
this.Controls.Add(this.tableLayoutPanel1); this.buttonSaveDefaults.Click += new System.EventHandler(this.buttonSaveDefaults_Click);
this.Controls.Add(this.buttonCancel); //
this.Controls.Add(this.buttonOK); // NewControllerConfig
this.Controls.Add(this.checkBoxAutoTab); //
this.Controls.Add(this.label2); this.AcceptButton = this.buttonOK;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.Name = "NewControllerConfig"; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Text = "Controller Config"; this.CancelButton = this.buttonCancel;
this.Load += new System.EventHandler(this.NewControllerConfig_Load); this.ClientSize = new System.Drawing.Size(932, 544);
this.tabControl1.ResumeLayout(false); this.Controls.Add(this.buttonSaveDefaults);
this.tableLayoutPanel1.ResumeLayout(false); this.Controls.Add(this.buttonLoadDefaults);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.Controls.Add(this.checkBoxUDLR);
this.ResumeLayout(false); this.Controls.Add(this.tableLayoutPanel1);
this.PerformLayout(); this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.checkBoxAutoTab);
this.Controls.Add(this.label2);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "NewControllerConfig";
this.Text = "Controller Config";
this.Load += new System.EventHandler(this.NewControllerConfig_Load);
this.tabControl1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
} }
@ -223,5 +236,6 @@
private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button buttonLoadDefaults; private System.Windows.Forms.Button buttonLoadDefaults;
private System.Windows.Forms.TabPage tabPage3; private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.Button buttonSaveDefaults;
} }
} }

View File

@ -145,6 +145,10 @@ namespace BizHawk.MultiClient.config
checkBoxAutoTab.Checked = Global.Config.InputConfigAutoTab; checkBoxAutoTab.Checked = Global.Config.InputConfigAutoTab;
SetControllerPicture(def.Name); SetControllerPicture(def.Name);
if (!MainForm.INTERIM)
buttonSaveDefaults.Hide();
ResumeLayout(); ResumeLayout();
} }
@ -219,6 +223,12 @@ namespace BizHawk.MultiClient.config
ActOnControlCollection<ControllerConfigPanel>(tabPage2, (c) => c.Save(Global.Config.AllTrollersAutoFire[the_definition.Name])); ActOnControlCollection<ControllerConfigPanel>(tabPage2, (c) => c.Save(Global.Config.AllTrollersAutoFire[the_definition.Name]));
ActOnControlCollection<AnalogBindPanel>(tabPage3, (c) => c.Save(Global.Config.AllTrollersAnalog[the_definition.Name])); ActOnControlCollection<AnalogBindPanel>(tabPage3, (c) => c.Save(Global.Config.AllTrollersAnalog[the_definition.Name]));
} }
void SaveToDefaults(ControlDefaults cd)
{
ActOnControlCollection<ControllerConfigPanel>(tabPage1, (c) => c.Save(cd.AllTrollers[the_definition.Name]));
ActOnControlCollection<ControllerConfigPanel>(tabPage2, (c) => c.Save(cd.AllTrollersAutoFire[the_definition.Name]));
ActOnControlCollection<AnalogBindPanel>(tabPage3, (c) => c.Save(cd.AllTrollersAnalog[the_definition.Name]));
}
static void ActOnControlCollection<T>(Control c, Action<T> proc) static void ActOnControlCollection<T>(Control c, Action<T> proc)
where T : Control where T : Control
@ -359,5 +369,22 @@ namespace BizHawk.MultiClient.config
c.AllTrollersAnalog = cd.AllTrollersAnalog; c.AllTrollersAnalog = cd.AllTrollersAnalog;
} }
} }
private void buttonSaveDefaults_Click(object sender, EventArgs e)
{
var result = MessageBox.Show(this, "OK to overwrite defaults for current control scheme?", "Save Defaults", MessageBoxButtons.YesNo);
if (result == DialogResult.Yes)
{
ControlDefaults cd = new ControlDefaults();
cd = ConfigService.Load(ControlDefaultPath, cd);
cd.AllTrollers[the_definition.Name] = new Dictionary<string, string>();
cd.AllTrollersAutoFire[the_definition.Name] = new Dictionary<string, string>();
cd.AllTrollersAnalog[the_definition.Name] = new Dictionary<string, Config.AnalogBind>();
SaveToDefaults(cd);
ConfigService.Save(ControlDefaultPath, cd);
}
}
} }
} }

View File

@ -1,24 +1,24 @@
{ {
"AllTrollers": { "AllTrollers": {
"NES Controller": { "NES Controller": {
"P1 Up": "UpArrow,J1 POV1U, X1 DpadUp, X1 LStickUp", "P1 Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp",
"P1 Down": "DownArrow,J1 POV1D, X1 DpadDown, X1 LStickDown", "P1 Down": "DownArrow, J1 POV1D, X1 DpadDown, X1 LStickDown",
"P1 Left": "LeftArrow,J1 POV1L, X1 DpadLeft, X1 LStickLeft", "P1 Left": "LeftArrow, J1 POV1L, X1 DpadLeft, X1 LStickLeft",
"P1 Right": "RightArrow,J1 POV1R, X1 DpadRight, X1 LStickRight", "P1 Right": "RightArrow, J1 POV1R, X1 DpadRight, X1 LStickRight",
"P1 Start": "Return, J1 B10, X1 Start",
"P1 Select": "Space, J1 B9, X1 Back", "P1 Select": "Space, J1 B9, X1 Back",
"P1 Start": "Return, J1 B10, X1 Start",
"P1 B": "X, X1 B", "P1 B": "X, X1 B",
"P1 A": "Z, X1 A", "P1 A": "Z, X1 A",
"Reset": "",
"Power": "",
"P2 Up": "", "P2 Up": "",
"P2 Down": "", "P2 Down": "",
"P2 Left": "", "P2 Left": "",
"P2 Right": "", "P2 Right": "",
"P2 Start": "",
"P2 Select": "", "P2 Select": "",
"P2 Start": "",
"P2 B": "", "P2 B": "",
"P2 A": "" "P2 A": "",
"Reset": "",
"Power": ""
}, },
"SNES Controller": { "SNES Controller": {
"Reset": "", "Reset": "",
@ -70,7 +70,7 @@
"P4 B": "", "P4 B": "",
"P4 A": "", "P4 A": "",
"P4 L": "", "P4 L": "",
"P4 R": "", "P4 R": ""
}, },
"Nintento 64 Controller": { "Nintento 64 Controller": {
"P1 A Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp", "P1 A Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp",
@ -80,7 +80,7 @@
"P1 DPad U": "", "P1 DPad U": "",
"P1 DPad D": "", "P1 DPad D": "",
"P1 DPad L": "", "P1 DPad L": "",
"P1 DPad R": "", "P1 DPad R": "",
"P1 Start": "Return, J1 B10, X1 Start", "P1 Start": "Return, J1 B10, X1 Start",
"P1 Z": "D, J1 B3", "P1 Z": "D, J1 B3",
"P1 B": "S, J1 B1, X1 B", "P1 B": "S, J1 B1, X1 B",
@ -88,7 +88,7 @@
"P1 C Up": "NumberPad8, J1 RotationZ-", "P1 C Up": "NumberPad8, J1 RotationZ-",
"P1 C Down": "NumberPad2, J1 RotationZ+", "P1 C Down": "NumberPad2, J1 RotationZ+",
"P1 C Left": "NumberPad4, J1 Z-", "P1 C Left": "NumberPad4, J1 Z-",
"P1 C Right": "NumberPad6, J1 Z+", "P1 C Right": "NumberPad6, J1 Z+",
"P1 L": "Q, J1 B5", "P1 L": "Q, J1 B5",
"P1 R": "W, J1 B6", "P1 R": "W, J1 B6",
"P2 X Axis": "", "P2 X Axis": "",
@ -100,7 +100,7 @@
"P2 DPad U": "", "P2 DPad U": "",
"P2 DPad D": "", "P2 DPad D": "",
"P2 DPad L": "", "P2 DPad L": "",
"P2 DPad R": "", "P2 DPad R": "",
"P2 Start": "", "P2 Start": "",
"P2 Z": "", "P2 Z": "",
"P2 B": "", "P2 B": "",
@ -108,7 +108,7 @@
"P2 C Up": "", "P2 C Up": "",
"P2 C Down": "", "P2 C Down": "",
"P2 C Left": "", "P2 C Left": "",
"P2 C Right": "", "P2 C Right": "",
"P2 L": "", "P2 L": "",
"P2 R": "", "P2 R": "",
"P3 X Axis": "", "P3 X Axis": "",
@ -120,7 +120,7 @@
"P3 DPad U": "", "P3 DPad U": "",
"P3 DPad D": "", "P3 DPad D": "",
"P3 DPad L": "", "P3 DPad L": "",
"P3 DPad R": "", "P3 DPad R": "",
"P3 Start": "", "P3 Start": "",
"P3 Z": "", "P3 Z": "",
"P3 B": "", "P3 B": "",
@ -128,7 +128,7 @@
"P3 C Up": "", "P3 C Up": "",
"P3 C Down": "", "P3 C Down": "",
"P3 C Left": "", "P3 C Left": "",
"P3 C Right": "", "P3 C Right": "",
"P3 L": "", "P3 L": "",
"P3 R": "", "P3 R": "",
"P4 X Axis": "", "P4 X Axis": "",
@ -140,7 +140,7 @@
"P4 DPad U": "", "P4 DPad U": "",
"P4 DPad D": "", "P4 DPad D": "",
"P4 DPad L": "", "P4 DPad L": "",
"P4 DPad R": "", "P4 DPad R": "",
"P4 Start": "", "P4 Start": "",
"P4 Z": "", "P4 Z": "",
"P4 B": "", "P4 B": "",
@ -148,7 +148,7 @@
"P4 C Up": "", "P4 C Up": "",
"P4 C Down": "", "P4 C Down": "",
"P4 C Left": "", "P4 C Left": "",
"P4 C Right": "", "P4 C Right": "",
"P4 L": "", "P4 L": "",
"P4 R": "", "P4 R": "",
"Reset": "", "Reset": "",
@ -163,7 +163,7 @@
"Select": "Space, J1 B9, X1 Back", "Select": "Space, J1 B9, X1 Back",
"B": "Z, J1 B1, X1 B", "B": "Z, J1 B1, X1 B",
"A": "X, J1 B2, X1 A", "A": "X, J1 B2, X1 A",
"Power": "", "Power": ""
}, },
"GBAController": { "GBAController": {
"Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp", "Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp",
@ -176,7 +176,7 @@
"A": "X, X1 A", "A": "X, X1 A",
"L": "W, J1 B5, X1 LeftTrigger", "L": "W, J1 B5, X1 LeftTrigger",
"R": "E, J1 B6, X1 RightTrigger", "R": "E, J1 B6, X1 RightTrigger",
"Power": "", "Power": ""
}, },
"Atari 2600 Basic Controller": { "Atari 2600 Basic Controller": {
"Reset": "", "Reset": "",
@ -185,12 +185,12 @@
"P1 Down": "DownArrow, J1 POV1D, X1 DpadDown, X1 LStickDown", "P1 Down": "DownArrow, J1 POV1D, X1 DpadDown, X1 LStickDown",
"P1 Left": "LeftArrow,J1 POV1L, X1 DpadLeft, X1 LStickLeft", "P1 Left": "LeftArrow,J1 POV1L, X1 DpadLeft, X1 LStickLeft",
"P1 Right": "RightArrow,J1 POV1R, X1 DpadRight, X1 LStickRight", "P1 Right": "RightArrow,J1 POV1R, X1 DpadRight, X1 LStickRight",
"P1 Button": "Z, J1 B1, X1 A", "P1 Button": "Z, J1 B1, X1 A",
"P2 Up": "NumberPad8, J1 RotationZ-", "P2 Up": "NumberPad8, J1 RotationZ-",
"P2 Down": "NumberPad2, J1 RotationZ+", "P2 Down": "NumberPad2, J1 RotationZ+",
"P2 Left": "NumberPad4, J1 Z-", "P2 Left": "NumberPad4, J1 Z-",
"P2 Right": "NumberPad6, J1 Z+", "P2 Right": "NumberPad6, J1 Z+",
"P2 Button": "NumberPad1, J1 B4", "P2 Button": "NumberPad1, J1 B4"
}, },
"Atari 7800 ProLine Joystick Controller": { "Atari 7800 ProLine Joystick Controller": {
"Power": "", "Power": "",
@ -208,7 +208,7 @@
"P2 Left": "NumberPad4, J1 Z-", "P2 Left": "NumberPad4, J1 Z-",
"P2 Right": "NumberPad6, J1 Z+", "P2 Right": "NumberPad6, J1 Z+",
"P2 Trigger 1": "NumberPad1, J1 B4", "P2 Trigger 1": "NumberPad1, J1 B4",
"P2 Trigger 2": "NumberPad3, B1 B3", "P2 Trigger 2": "NumberPad3, B1 B3"
}, },
"Commodore 64 Controller": { "Commodore 64 Controller": {
"P1 Up": "NumberPad8, J1 POV1U, X1 DpadUp, X1 LStickUp", "P1 Up": "NumberPad8, J1 POV1U, X1 DpadUp, X1 LStickUp",
@ -255,7 +255,6 @@
"Key At": "LeftBracket", "Key At": "LeftBracket",
"Key Asterisk": "RightBracket", "Key Asterisk": "RightBracket",
"Key Up Arrow": "Backslash", "Key Up Arrow": "Backslash",
"Key Left Arrow": "",
"Key Restore": "", "Key Restore": "",
"Key Run/Stop": "CapsLock", "Key Run/Stop": "CapsLock",
"Key Lck": "", "Key Lck": "",
@ -287,7 +286,7 @@
"Key Right Shift": "RightShift", "Key Right Shift": "RightShift",
"Key Cursor Up/Down": "DownArrow", "Key Cursor Up/Down": "DownArrow",
"Key Cursor Left/Right": "RightArrow", "Key Cursor Left/Right": "RightArrow",
"Key Space": "Space", "Key Space": "Space"
}, },
"Intellivision Controller": { "Intellivision Controller": {
"P1 Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp", "P1 Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp",
@ -325,7 +324,7 @@
"P2 Key8": "", "P2 Key8": "",
"P2 Key9": "", "P2 Key9": "",
"P2 Enter": "", "P2 Enter": "",
"P2 Clear": "", "P2 Clear": ""
}, },
"Saturn Controller": { "Saturn Controller": {
"Power": "", "Power": "",
@ -337,7 +336,7 @@
"P1 Start": "Return, X1 Start", "P1 Start": "Return, X1 Start",
"P1 X": "D, J1 B4", "P1 X": "D, J1 B4",
"P1 Y": "S, J1 B5", "P1 Y": "S, J1 B5",
"P1 Z": "A, J1 B6", "P1 Z": "A, J1 B6",
"P1 A": "C, J1 B1", "P1 A": "C, J1 B1",
"P1 B": "X, J1 B2", "P1 B": "X, J1 B2",
"P1 C": "Z, J1 B5", "P1 C": "Z, J1 B5",
@ -357,7 +356,7 @@
"P2 L": "", "P2 L": "",
"P2 R": "" "P2 R": ""
}, },
"PC Engine Controller": { "PC Engine Controller": {
"Reset": "", "Reset": "",
"Power": "", "Power": "",
"P1 Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp", "P1 Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp",
@ -399,9 +398,9 @@
"P5 B1": "", "P5 B1": "",
"P5 B2": "", "P5 B2": "",
"P5 Select": "", "P5 Select": "",
"P5 Run": "", "P5 Run": ""
}, },
"ColecoVision Basic Controller": { "ColecoVision Basic Controller": {
"P1 Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp", "P1 Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp",
"P1 Down": "DownArrow, J1 POV1D, X1 DpadDown, X1 LStickDown", "P1 Down": "DownArrow, J1 POV1D, X1 DpadDown, X1 LStickDown",
"P1 Left": "LeftArrow, J1 POV1L, X1 DpadLeft, X1 LStickLeft", "P1 Left": "LeftArrow, J1 POV1L, X1 DpadLeft, X1 LStickLeft",
@ -437,9 +436,9 @@
"P2 Key9": "", "P2 Key9": "",
"P2 Star": "", "P2 Star": "",
"P2 Key0": "", "P2 Key0": "",
"P2 Pound": "", "P2 Pound": ""
}, },
"SMS Controller": { "SMS Controller": {
"P1 Up": "UpArrow, X1 DpadUp, X1 LStickUp", "P1 Up": "UpArrow, X1 DpadUp, X1 LStickUp",
"P1 Down": "DownArrow, X1 DpadDown, X1 LStickDown", "P1 Down": "DownArrow, X1 DpadDown, X1 LStickDown",
"P1 Left": "LeftArrow, X1 DpadLeft, X1 LStickLeft", "P1 Left": "LeftArrow, X1 DpadLeft, X1 LStickLeft",
@ -453,7 +452,7 @@
"P2 Left": "", "P2 Left": "",
"P2 Right": "", "P2 Right": "",
"P2 B1": "", "P2 B1": "",
"P2 B2": "", "P2 B2": ""
}, },
"Genesis 3-Button Controller": { "Genesis 3-Button Controller": {
"Reset": "", "Reset": "",
@ -464,7 +463,7 @@
"P1 A": "Z, J1 B1, X1 A", "P1 A": "Z, J1 B1, X1 A",
"P1 B": "X, J1 B1, X1 B", "P1 B": "X, J1 B1, X1 B",
"P1 C": "C, J1 B4, X1 X", "P1 C": "C, J1 B4, X1 X",
"P1 Start": "Return, X1 J1 B10, X1 Start", "P1 Start": "Return, X1 J1 B10, X1 Start"
}, },
"Dual Gameboy Controller": { "Dual Gameboy Controller": {
"P1 Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp", "P1 Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp",
@ -537,8 +536,8 @@
"SECOND": "Slash", "SECOND": "Slash",
"MODE": "BackSlash", "MODE": "BackSlash",
"DEL": "Delete", "DEL": "Delete",
"COMMA": "Comma", "COMMA": "Comma"
}, }
}, },
"AllTrollersAutoFire": { "AllTrollersAutoFire": {
"NES Controller": { "NES Controller": {
@ -546,20 +545,20 @@
"P1 Down": "", "P1 Down": "",
"P1 Left": "", "P1 Left": "",
"P1 Right": "", "P1 Right": "",
"P1 Start": "",
"P1 Select": "", "P1 Select": "",
"P1 Start": "",
"P1 B": "A, J1 B4", "P1 B": "A, J1 B4",
"P1 A": "S, J1 B3", "P1 A": "S, J1 B3",
"Reset": "",
"Power": "",
"P2 Up": "", "P2 Up": "",
"P2 Down": "", "P2 Down": "",
"P2 Left": "", "P2 Left": "",
"P2 Right": "", "P2 Right": "",
"P2 Start": "",
"P2 Select": "", "P2 Select": "",
"P2 Start": "",
"P2 B": "", "P2 B": "",
"P2 A": "" "P2 A": "",
"Reset": "",
"Power": ""
}, },
"Gameboy Controller": { "Gameboy Controller": {
"Up": "", "Up": "",
@ -570,7 +569,7 @@
"Select": "", "Select": "",
"B": "A, J1 B4", "B": "A, J1 B4",
"A": "S, J1 B3", "A": "S, J1 B3",
"Power": "", "Power": ""
}, },
"GBAController": { "GBAController": {
"Up": "", "Up": "",
@ -583,7 +582,7 @@
"A": "S, J1 B3", "A": "S, J1 B3",
"L": "", "L": "",
"R": "", "R": "",
"Power": "", "Power": ""
}, },
"Atari 2600 Basic Controller": { "Atari 2600 Basic Controller": {
"Reset": "", "Reset": "",
@ -592,15 +591,15 @@
"P1 Down": "", "P1 Down": "",
"P1 Left": "", "P1 Left": "",
"P1 Right": "", "P1 Right": "",
"P1 Button": "A, J1 B4", "P1 Button": "A, J1 B4",
"P2 Up": "", "P2 Up": "",
"P2 Down": "", "P2 Down": "",
"P2 Left": "", "P2 Left": "",
"P2 Right": "", "P2 Right": "",
"P2 Button": "S, J1 B3", "P2 Button": "S, J1 B3"
}, },
"Null Controller": {}, "Null Controller": {},
"PC Engine Controller": { "PC Engine Controller": {
"Reset": "", "Reset": "",
"Power": "", "Power": "",
"P1 Up": "", "P1 Up": "",
@ -642,7 +641,7 @@
"P5 B2": "", "P5 B2": "",
"P5 B1": "", "P5 B1": "",
"P5 Select": "", "P5 Select": "",
"P5 Run": "", "P5 Run": ""
}, },
"SMS Controller": { "SMS Controller": {
"P1 Up": "", "P1 Up": "",
@ -658,7 +657,7 @@
"P2 Left": "", "P2 Left": "",
"P2 Right": "", "P2 Right": "",
"P2 B1": "", "P2 B1": "",
"P2 B2": "", "P2 B2": ""
} }
}, },
"AllTrollersAnalog": { "AllTrollersAnalog": {
@ -703,6 +702,7 @@
"Mult": 1, "Mult": 1,
"Deadzone": 0 "Deadzone": 0
} }
} },
}, "NES Controller": {}
}
} }