Input Config - a bit of progress on making a dynamic config based on the System type

This commit is contained in:
andres.delikat 2011-01-29 01:25:57 +00:00
parent 386e632f30
commit 1f4e560fc2
2 changed files with 87 additions and 5 deletions

View File

@ -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
//

View File

@ -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;
}
}
}
}