More cleanup of input Config

This commit is contained in:
kylethomson 2011-02-20 15:25:00 +00:00
parent 7d093138ca
commit 005138b453
5 changed files with 124 additions and 80 deletions

View File

@ -135,11 +135,13 @@
public string Right;
public string B1;
public string B2;
public bool Enabled;
public SMSControllerTemplate() { }
public SMSControllerTemplate(bool defaults)
{
if (defaults)
{
Enabled = true;
Up = "J1 Up, UpArrow";
Down = "J1 Down, DownArrow";
Left = "J1 Left, LeftArrow";
@ -149,6 +151,7 @@
}
else
{
Enabled = false;
Up = "";
Down = "";
Right = "";
@ -169,11 +172,13 @@
public string II;
public string Run;
public string Select;
public bool Enabled;
public PCEControllerTemplate() { }
public PCEControllerTemplate(bool defaults)
{
if (defaults)
{
Enabled = true;
Up = "J1 Up, UpArrow";
Down = "J1 Down, DownArrow";
Left = "J1 Left, LeftArrow";
@ -185,6 +190,7 @@
}
else
{
Enabled = false;
Up = "";
Down = "";
Right = "";
@ -207,11 +213,13 @@
public string B;
public string Start;
public string Select;
public bool Enabled;
public NESControllerTemplate() { }
public NESControllerTemplate(bool defaults)
{
if (defaults)
{
Enabled = true;
Up = "J1 Up, UpArrow";
Down = "J1 Down, DownArrow";
Left = "J1 Left, LeftArrow";
@ -223,6 +231,7 @@
}
else
{
Enabled = false;
Up = "";
Down = "";
Right = "";

View File

@ -34,12 +34,10 @@
this.ButtonsGroupBox = new System.Windows.Forms.GroupBox();
this.ControllerImage = new System.Windows.Forms.PictureBox();
this.ControllerSelectGroupBox = new System.Windows.Forms.GroupBox();
this.ControllerEnabledCheckbox = new System.Windows.Forms.CheckBox();
this.IDX_CONTROLLERENABLED = new System.Windows.Forms.CheckBox();
this.ControllComboBox = new System.Windows.Forms.ComboBox();
this.AllowLR = new System.Windows.Forms.CheckBox();
this.SystemGroupBox = new System.Windows.Forms.GroupBox();
this.SystemComboBox = new System.Windows.Forms.ComboBox();
this.testInputWidget = new BizHawk.MultiClient.InputWidget();
((System.ComponentModel.ISupportInitialize)(this.ControllerImage)).BeginInit();
this.ControllerSelectGroupBox.SuspendLayout();
this.SystemGroupBox.SuspendLayout();
@ -82,14 +80,14 @@
this.ControllerImage.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.ControllerImage.Location = new System.Drawing.Point(258, 73);
this.ControllerImage.Name = "ControllerImage";
this.ControllerImage.Size = new System.Drawing.Size(165, 156);
this.ControllerImage.Size = new System.Drawing.Size(169, 195);
this.ControllerImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.ControllerImage.TabIndex = 3;
this.ControllerImage.TabStop = false;
//
// ControllerSelectGroupBox
//
this.ControllerSelectGroupBox.Controls.Add(this.ControllerEnabledCheckbox);
this.ControllerSelectGroupBox.Controls.Add(this.IDX_CONTROLLERENABLED);
this.ControllerSelectGroupBox.Controls.Add(this.ControllComboBox);
this.ControllerSelectGroupBox.Location = new System.Drawing.Point(13, 12);
this.ControllerSelectGroupBox.Name = "ControllerSelectGroupBox";
@ -98,17 +96,17 @@
this.ControllerSelectGroupBox.TabStop = false;
this.ControllerSelectGroupBox.Text = "Controller";
//
// ControllerEnabledCheckbox
// IDX_CONTROLLERENABLED
//
this.ControllerEnabledCheckbox.AutoSize = true;
this.ControllerEnabledCheckbox.Checked = true;
this.ControllerEnabledCheckbox.CheckState = System.Windows.Forms.CheckState.Checked;
this.ControllerEnabledCheckbox.Location = new System.Drawing.Point(143, 23);
this.ControllerEnabledCheckbox.Name = "ControllerEnabledCheckbox";
this.ControllerEnabledCheckbox.Size = new System.Drawing.Size(65, 17);
this.ControllerEnabledCheckbox.TabIndex = 1;
this.ControllerEnabledCheckbox.Text = "Enabled";
this.ControllerEnabledCheckbox.UseVisualStyleBackColor = true;
this.IDX_CONTROLLERENABLED.AutoSize = true;
this.IDX_CONTROLLERENABLED.Checked = true;
this.IDX_CONTROLLERENABLED.CheckState = System.Windows.Forms.CheckState.Checked;
this.IDX_CONTROLLERENABLED.Location = new System.Drawing.Point(143, 23);
this.IDX_CONTROLLERENABLED.Name = "IDX_CONTROLLERENABLED";
this.IDX_CONTROLLERENABLED.Size = new System.Drawing.Size(65, 17);
this.IDX_CONTROLLERENABLED.TabIndex = 1;
this.IDX_CONTROLLERENABLED.Text = "Enabled";
this.IDX_CONTROLLERENABLED.UseVisualStyleBackColor = true;
//
// ControllComboBox
//
@ -120,16 +118,6 @@
this.ControllComboBox.TabIndex = 0;
this.ControllComboBox.SelectedIndexChanged += new System.EventHandler(this.ControllComboBox_SelectedIndexChanged);
//
// AllowLR
//
this.AllowLR.AutoSize = true;
this.AllowLR.Location = new System.Drawing.Point(260, 260);
this.AllowLR.Name = "AllowLR";
this.AllowLR.Size = new System.Drawing.Size(156, 17);
this.AllowLR.TabIndex = 5;
this.AllowLR.Text = "Allow Left+Right/Up+Down";
this.AllowLR.UseVisualStyleBackColor = true;
//
// SystemGroupBox
//
this.SystemGroupBox.Controls.Add(this.SystemComboBox);
@ -157,21 +145,12 @@
this.SystemComboBox.TabIndex = 2;
this.SystemComboBox.SelectedIndexChanged += new System.EventHandler(this.SystemComboBox_SelectedIndexChanged);
//
// testInputWidget
//
this.testInputWidget.Location = new System.Drawing.Point(286, 236);
this.testInputWidget.Name = "testInputWidget";
this.testInputWidget.Size = new System.Drawing.Size(100, 20);
this.testInputWidget.TabIndex = 7;
//
// InputConfig
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(439, 319);
this.Controls.Add(this.testInputWidget);
this.Controls.Add(this.SystemGroupBox);
this.Controls.Add(this.AllowLR);
this.Controls.Add(this.ControllerSelectGroupBox);
this.Controls.Add(this.ControllerImage);
this.Controls.Add(this.ButtonsGroupBox);
@ -189,7 +168,6 @@
this.ControllerSelectGroupBox.PerformLayout();
this.SystemGroupBox.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
@ -201,10 +179,8 @@
private System.Windows.Forms.PictureBox ControllerImage;
private System.Windows.Forms.GroupBox ControllerSelectGroupBox;
private System.Windows.Forms.ComboBox ControllComboBox;
private System.Windows.Forms.CheckBox ControllerEnabledCheckbox;
private System.Windows.Forms.CheckBox AllowLR;
private System.Windows.Forms.CheckBox IDX_CONTROLLERENABLED;
private System.Windows.Forms.GroupBox SystemGroupBox;
private System.Windows.Forms.ComboBox SystemComboBox;
private InputWidget testInputWidget;
}
}

View File

@ -65,6 +65,7 @@ namespace BizHawk.MultiClient
ButtonMappings[5] = TruncateButtonMapping(Global.Config.SMSController[jpad].B2);
ButtonMappings[6] = TruncateButtonMapping(Global.Config.SmsPause);
ButtonMappings[7] = TruncateButtonMapping(Global.Config.SmsReset);
IDX_CONTROLLERENABLED.Checked = Global.Config.SMSController[jpad].Enabled;
Changed = true;
Labels.Clear();
TextBoxes.Clear();
@ -111,6 +112,7 @@ namespace BizHawk.MultiClient
TempBox.Dispose();
TempBox = TextBoxes[7] as InputWidget;
Global.Config.SmsReset = AppendButtonMapping(TempBox.Text, Global.Config.SmsReset);
Global.Config.SMSController[prev].Enabled = IDX_CONTROLLERENABLED.Checked;
TempBox.Dispose();
for (int i = 0; i < SMSControlList.Length; i++)
{
@ -134,6 +136,7 @@ namespace BizHawk.MultiClient
ButtonMappings[5] = TruncateButtonMapping(Global.Config.PCEController[jpad].II);
ButtonMappings[6] = TruncateButtonMapping(Global.Config.PCEController[jpad].Run);
ButtonMappings[7] = TruncateButtonMapping(Global.Config.PCEController[jpad].Select);
IDX_CONTROLLERENABLED.Checked = Global.Config.PCEController[jpad].Enabled;
Labels.Clear();
TextBoxes.Clear();
for (int i = 0; i < PCEControlList.Length; i++)
@ -180,6 +183,7 @@ namespace BizHawk.MultiClient
TempBox = TextBoxes[7] as InputWidget;
Global.Config.PCEController[prev].Select = AppendButtonMapping(TempBox.Text, Global.Config.PCEController[prev].Select);
TempBox.Dispose();
Global.Config.PCEController[prev].Enabled = IDX_CONTROLLERENABLED.Checked;
for (int i = 0; i < PCEControlList.Length; i++)
{
TempLabel = Labels[i] as Label;
@ -197,41 +201,6 @@ namespace BizHawk.MultiClient
this.Text = ControllerStr + "TI-83";
}
private void DoNES()
{
Label TempLabel;
InputWidget TempTextBox;
this.Text = ControllerStr + "NES";
ControllerImage.Image = BizHawk.MultiClient.Properties.Resources.NESController;
int jpad = this.ControllComboBox.SelectedIndex;
string[] ButtonMappings = new string[NESControlList.Length];
ButtonMappings[0] = TruncateButtonMapping(Global.Config.NESController[jpad].Up);
ButtonMappings[1] = TruncateButtonMapping(Global.Config.NESController[jpad].Down);
ButtonMappings[2] = TruncateButtonMapping(Global.Config.NESController[jpad].Left);
ButtonMappings[3] = TruncateButtonMapping(Global.Config.NESController[jpad].Right);
ButtonMappings[4] = TruncateButtonMapping(Global.Config.NESController[jpad].A);
ButtonMappings[5] = TruncateButtonMapping(Global.Config.NESController[jpad].B);
ButtonMappings[6] = TruncateButtonMapping(Global.Config.NESController[jpad].Start);
ButtonMappings[7] = TruncateButtonMapping(Global.Config.NESController[jpad].Select);
Changed = true;
Labels.Clear();
TextBoxes.Clear();
for (int i = 0; i < NESControlList.Length; i++)
{
TempLabel = new Label();
TempLabel.Text = NESControlList[i];
TempLabel.Location = new Point(8, 20 + (i * 24));
Labels.Add(TempLabel);
TempTextBox = new InputWidget();
TempTextBox.Location = new Point(48, 20 + (i * 24));
TextBoxes.Add(TempTextBox);
TempTextBox.Text = ButtonMappings[i];
ButtonsGroupBox.Controls.Add(TempTextBox);
ButtonsGroupBox.Controls.Add(TempLabel);
}
Changed = true;
}
private void DoGameBoy()
{
Label TempLabel;
@ -247,6 +216,7 @@ namespace BizHawk.MultiClient
ButtonMappings[5] = TruncateButtonMapping(Global.Config.GameBoyController.B);
ButtonMappings[6] = TruncateButtonMapping(Global.Config.GameBoyController.Start);
ButtonMappings[7] = TruncateButtonMapping(Global.Config.GameBoyController.Select);
IDX_CONTROLLERENABLED.Enabled = false;
Changed = true;
Labels.Clear();
TextBoxes.Clear();
@ -299,6 +269,43 @@ namespace BizHawk.MultiClient
TempLabel = Labels[i] as Label;
TempLabel.Dispose();
}
IDX_CONTROLLERENABLED.Enabled = true;
}
private void DoNES()
{
Label TempLabel;
InputWidget TempTextBox;
this.Text = ControllerStr + "NES";
ControllerImage.Image = BizHawk.MultiClient.Properties.Resources.NESController;
int jpad = this.ControllComboBox.SelectedIndex;
string[] ButtonMappings = new string[NESControlList.Length];
ButtonMappings[0] = TruncateButtonMapping(Global.Config.NESController[jpad].Up);
ButtonMappings[1] = TruncateButtonMapping(Global.Config.NESController[jpad].Down);
ButtonMappings[2] = TruncateButtonMapping(Global.Config.NESController[jpad].Left);
ButtonMappings[3] = TruncateButtonMapping(Global.Config.NESController[jpad].Right);
ButtonMappings[4] = TruncateButtonMapping(Global.Config.NESController[jpad].A);
ButtonMappings[5] = TruncateButtonMapping(Global.Config.NESController[jpad].B);
ButtonMappings[6] = TruncateButtonMapping(Global.Config.NESController[jpad].Start);
ButtonMappings[7] = TruncateButtonMapping(Global.Config.NESController[jpad].Select);
IDX_CONTROLLERENABLED.Checked = Global.Config.NESController[jpad].Enabled;
Changed = true;
Labels.Clear();
TextBoxes.Clear();
for (int i = 0; i < NESControlList.Length; i++)
{
TempLabel = new Label();
TempLabel.Text = NESControlList[i];
TempLabel.Location = new Point(8, 20 + (i * 24));
Labels.Add(TempLabel);
TempTextBox = new InputWidget();
TempTextBox.Location = new Point(48, 20 + (i * 24));
TextBoxes.Add(TempTextBox);
TempTextBox.Text = ButtonMappings[i];
ButtonsGroupBox.Controls.Add(TempTextBox);
ButtonsGroupBox.Controls.Add(TempLabel);
}
Changed = true;
}
private void UpdateNES(int prev)
{
@ -328,6 +335,8 @@ namespace BizHawk.MultiClient
TempBox.Dispose();
TempBox = TextBoxes[7] as InputWidget;
Global.Config.NESController[prev].Select = AppendButtonMapping(TempBox.Text, Global.Config.NESController[prev].Select);
Global.Config.NESController[prev].Enabled = IDX_CONTROLLERENABLED.Checked;
TempBox.Dispose();
for (int i = 0; i < NESControlList.Length; i++)
{
@ -365,7 +374,6 @@ namespace BizHawk.MultiClient
}
}
}
private void OK_Click(object sender, EventArgs e)
{
if (Changed)

View File

@ -119,6 +119,10 @@
this.IDB_SAVE = new System.Windows.Forms.Button();
this.IDB_CANCEL = new System.Windows.Forms.Button();
this.label38 = new System.Windows.Forms.Label();
this.label44 = new System.Windows.Forms.Label();
this.IDW_SCREENSHOT = new BizHawk.MultiClient.InputWidget();
this.IDW_FULLSCREEN = new BizHawk.MultiClient.InputWidget();
this.label45 = new System.Windows.Forms.Label();
this.hotkeyTabs.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
@ -139,6 +143,10 @@
//
// tabPage1
//
this.tabPage1.Controls.Add(this.label45);
this.tabPage1.Controls.Add(this.IDW_FULLSCREEN);
this.tabPage1.Controls.Add(this.IDW_SCREENSHOT);
this.tabPage1.Controls.Add(this.label44);
this.tabPage1.Controls.Add(this.IDW_REWIND);
this.tabPage1.Controls.Add(this.label37);
this.tabPage1.Controls.Add(this.IDW_FASTFORWARD);
@ -165,7 +173,7 @@
//
this.IDW_REWIND.AcceptsTab = true;
this.IDW_REWIND.BackColor = System.Drawing.SystemColors.Window;
this.IDW_REWIND.Location = new System.Drawing.Point(92, 107);
this.IDW_REWIND.Location = new System.Drawing.Point(92, 104);
this.IDW_REWIND.Name = "IDW_REWIND";
this.IDW_REWIND.Size = new System.Drawing.Size(100, 20);
this.IDW_REWIND.TabIndex = 74;
@ -173,7 +181,7 @@
// label37
//
this.label37.AutoSize = true;
this.label37.Location = new System.Drawing.Point(6, 108);
this.label37.Location = new System.Drawing.Point(6, 107);
this.label37.Name = "label37";
this.label37.Size = new System.Drawing.Size(43, 13);
this.label37.TabIndex = 73;
@ -183,7 +191,7 @@
//
this.IDW_FASTFORWARD.AcceptsTab = true;
this.IDW_FASTFORWARD.BackColor = System.Drawing.SystemColors.Window;
this.IDW_FASTFORWARD.Location = new System.Drawing.Point(92, 81);
this.IDW_FASTFORWARD.Location = new System.Drawing.Point(92, 80);
this.IDW_FASTFORWARD.Name = "IDW_FASTFORWARD";
this.IDW_FASTFORWARD.Size = new System.Drawing.Size(100, 20);
this.IDW_FASTFORWARD.TabIndex = 72;
@ -191,7 +199,7 @@
// label36
//
this.label36.AutoSize = true;
this.label36.Location = new System.Drawing.Point(6, 80);
this.label36.Location = new System.Drawing.Point(6, 83);
this.label36.Name = "label36";
this.label36.Size = new System.Drawing.Size(68, 13);
this.label36.TabIndex = 71;
@ -209,7 +217,7 @@
// label35
//
this.label35.AutoSize = true;
this.label35.Location = new System.Drawing.Point(6, 55);
this.label35.Location = new System.Drawing.Point(6, 59);
this.label35.Name = "label35";
this.label35.Size = new System.Drawing.Size(61, 13);
this.label35.TabIndex = 69;
@ -977,6 +985,42 @@
this.label38.TabIndex = 3;
this.label38.Text = "* Escape clears a dialog window";
//
// label44
//
this.label44.AutoSize = true;
this.label44.Location = new System.Drawing.Point(207, 59);
this.label44.Name = "label44";
this.label44.Size = new System.Drawing.Size(61, 13);
this.label44.TabIndex = 75;
this.label44.Text = "Screenshot";
//
// IDW_SCREENSHOT
//
this.IDW_SCREENSHOT.AcceptsTab = true;
this.IDW_SCREENSHOT.BackColor = System.Drawing.SystemColors.Window;
this.IDW_SCREENSHOT.Location = new System.Drawing.Point(293, 56);
this.IDW_SCREENSHOT.Name = "IDW_SCREENSHOT";
this.IDW_SCREENSHOT.Size = new System.Drawing.Size(100, 20);
this.IDW_SCREENSHOT.TabIndex = 76;
//
// IDW_FULLSCREEN
//
this.IDW_FULLSCREEN.AcceptsTab = true;
this.IDW_FULLSCREEN.BackColor = System.Drawing.SystemColors.Window;
this.IDW_FULLSCREEN.Location = new System.Drawing.Point(293, 80);
this.IDW_FULLSCREEN.Name = "IDW_FULLSCREEN";
this.IDW_FULLSCREEN.Size = new System.Drawing.Size(100, 20);
this.IDW_FULLSCREEN.TabIndex = 78;
//
// label45
//
this.label45.AutoSize = true;
this.label45.Location = new System.Drawing.Point(207, 83);
this.label45.Name = "label45";
this.label45.Size = new System.Drawing.Size(60, 13);
this.label45.TabIndex = 79;
this.label45.Text = "Full Screen";
//
// HotkeyWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1097,5 +1141,9 @@
private System.Windows.Forms.Label label42;
private InputWidget IDW_MTDECPLAYER;
private InputWidget IDW_MTINCPLAYER;
private InputWidget IDW_FULLSCREEN;
private InputWidget IDW_SCREENSHOT;
private System.Windows.Forms.Label label44;
private System.Windows.Forms.Label label45;
}
}

View File

@ -19,6 +19,8 @@ namespace BizHawk.MultiClient.tools
IDW_HARDRESET.Text = Global.Config.HardResetBinding;
IDW_REWIND.Text = Global.Config.RewindBinding;
IDW_FASTFORWARD.Text = Global.Config.FastForwardBinding;
IDW_SCREENSHOT.Text = Global.Config.ScreenshotBinding;
IDW_FULLSCREEN.Text = Global.Config.ToggleFullscreenBinding;
IDW_QuickSave.Text = Global.Config.QuickSave;
IDW_QuickLoad.Text = Global.Config.QuickLoad;
@ -56,7 +58,6 @@ namespace BizHawk.MultiClient.tools
IDW_ST8.Text = Global.Config.SelectSlot8;
IDW_ST9.Text = Global.Config.SelectSlot9;
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
@ -70,6 +71,8 @@ namespace BizHawk.MultiClient.tools
Global.Config.HardResetBinding = IDW_HARDRESET.Text;
Global.Config.RewindBinding = IDW_REWIND.Text;
Global.Config.EmulatorPauseBinding = IDW_PAUSE.Text;
Global.Config.ToggleFullscreenBinding = IDW_FULLSCREEN.Text;
Global.Config.ScreenshotBinding = IDW_SCREENSHOT.Text;
Global.Config.QuickLoad = IDW_QuickLoad.Text;
Global.Config.QuickSave = IDW_QuickSave.Text;