From 1f4e560fc22571e33a0041e12be5d689caf05490 Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Sat, 29 Jan 2011 01:25:57 +0000 Subject: [PATCH] Input Config - a bit of progress on making a dynamic config based on the System type --- .../config/InputConfig.Designer.cs | 12 +-- BizHawk.MultiClient/config/InputConfig.cs | 80 +++++++++++++++++++ 2 files changed, 87 insertions(+), 5 deletions(-) diff --git a/BizHawk.MultiClient/config/InputConfig.Designer.cs b/BizHawk.MultiClient/config/InputConfig.Designer.cs index ba4435df0d..1ac76d990b 100644 --- a/BizHawk.MultiClient/config/InputConfig.Designer.cs +++ b/BizHawk.MultiClient/config/InputConfig.Designer.cs @@ -71,7 +71,7 @@ // this.ButtonsGroupBox.Location = new System.Drawing.Point(12, 68); this.ButtonsGroupBox.Name = "ButtonsGroupBox"; - this.ButtonsGroupBox.Size = new System.Drawing.Size(240, 216); + this.ButtonsGroupBox.Size = new System.Drawing.Size(240, 239); this.ButtonsGroupBox.TabIndex = 2; this.ButtonsGroupBox.TabStop = false; this.ButtonsGroupBox.Text = "Buttons"; @@ -146,14 +146,16 @@ // this.SystemComboBox.FormattingEnabled = true; this.SystemComboBox.Items.AddRange(new object[] { - "SMS / GG", - "SG-1000", - "PC Engine", - "Gameboy"}); + "SMS / GG / SG-1000", + "PC Engine / SGX", + "Gameboy", + "Sega Genesis", + "TI-83"}); this.SystemComboBox.Location = new System.Drawing.Point(6, 19); this.SystemComboBox.Name = "SystemComboBox"; this.SystemComboBox.Size = new System.Drawing.Size(146, 21); this.SystemComboBox.TabIndex = 2; + this.SystemComboBox.SelectedIndexChanged += new System.EventHandler(this.SystemComboBox_SelectedIndexChanged); // // InputConfig // diff --git a/BizHawk.MultiClient/config/InputConfig.cs b/BizHawk.MultiClient/config/InputConfig.cs index 2c83435784..2ffba20981 100644 --- a/BizHawk.MultiClient/config/InputConfig.cs +++ b/BizHawk.MultiClient/config/InputConfig.cs @@ -11,14 +11,72 @@ namespace BizHawk.MultiClient { public partial class InputConfig : Form { + const string ControllerStr = "Configure Controllers - "; public InputConfig() { InitializeComponent(); } + private void DoSMS() + { + this.Text = ControllerStr + "SMS / GG / SG-1000"; + + Button Up = new Button(); + Button Down = new Button(); + } + + private void DoPCE() + { + this.Text = ControllerStr + "PCEjin / SGX"; + } + + private void DoGen() + { + this.Text = ControllerStr + "Sega Genesis"; + } + + private void DoTI83() + { + this.Text = ControllerStr + "TI-83"; + } + + private void DoGameBoy() + { + this.Text = ControllerStr + "Gameboy"; + } + private void InputConfig_Load(object sender, EventArgs e) { //Determine the System currently loaded, and set that one up first, if null emulator set, what is the default? + if (!(Global.Emulator is NullEmulator)) + { + switch (Global.Game.System) + { + case "SMS": + case "SG": + case "GG": + DoSMS(); + break; + case "PCE": + case "SGX": + DoPCE(); + break; + case "GEN": + DoGen(); + break; + case "TI83": + DoTI83(); + break; + case "GB": + DoGameBoy(); + break; + default: + DoSMS(); + break; + } + } + else + DoSMS(); } private void OK_Click(object sender, EventArgs e) @@ -30,5 +88,27 @@ namespace BizHawk.MultiClient { this.Close(); } + + private void SystemComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + switch (SystemComboBox.SelectedItem.ToString()) + { + case "SMS / GG / SG-1000": + DoSMS(); + break; + case "PC Engine / SGX": + DoPCE(); + break; + case "Gameboy": + DoGameBoy(); + break; + case "Sega Genesis": + DoGen(); + break; + case "TI-83": + DoTI83(); + break; + } + } } }