Virtualpads - hook up NES Power button

This commit is contained in:
adelikat 2012-11-06 12:56:01 +00:00
parent c9c6cc4e9c
commit 7682422c9b
1 changed files with 21 additions and 4 deletions

View File

@ -36,7 +36,6 @@ namespace BizHawk.MultiClient
this.B1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.B1.UseVisualStyleBackColor = true;
this.B1.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged);
this.B1.Enabled = false; //Until a hard reset is emulated by NESHawk
this.B1.ForeColor = Color.Red;
this.B2 = new CheckBox();
@ -95,8 +94,15 @@ namespace BizHawk.MultiClient
public override void SetButtons(string buttons)
{
if (buttons.Length < 1) return;
if (buttons[0] == '.' || buttons[0] == 'l' || buttons[0] == '0')
if (buttons.Length < 1)
{
return;
}
else if (buttons[0] == 'P')
{
B1.Checked = true;
}
else if (buttons[0] == '.' || buttons[0] == 'l' || buttons[0] == '0')
{
B2.Checked = false;
}
@ -108,7 +114,18 @@ namespace BizHawk.MultiClient
private void Buttons_CheckedChanged(object sender, EventArgs e)
{
if (Global.Emulator.SystemId != "NES") return;
if (Global.Emulator.SystemId != "NES")
{
return;
}
else if (sender == B1)
{
Global.StickyXORAdapter.SetSticky("Power", B1.Checked);
if (B1.Checked == true)
B1.BackColor = Color.Pink;
else
B1.BackColor = SystemColors.Control;
}
else if (sender == B2)
{
Global.StickyXORAdapter.SetSticky("Reset", B2.Checked);