Controller Config - implement Gameboy power button

This commit is contained in:
adelikat 2012-11-08 04:43:07 +00:00
parent 68cba7d792
commit db2b4584f5
3 changed files with 14 additions and 2 deletions

View File

@ -913,8 +913,9 @@ namespace BizHawk.MultiClient
public string Right; public string Right;
public string A; public string A;
public string B; public string B;
public string Start;
public string Select; public string Select;
public string Start;
public string Power = "";
public bool Enabled; public bool Enabled;
public GBControllerTemplate() { } public GBControllerTemplate() { }
public GBControllerTemplate(bool defaults) public GBControllerTemplate(bool defaults)
@ -930,6 +931,7 @@ namespace BizHawk.MultiClient
B = "Z, X1 A"; B = "Z, X1 A";
Start = "Return, X1 Start"; Start = "Return, X1 Start";
Select = "Space, X1 Back"; Select = "Space, X1 Back";
Power = "";
} }
else else
{ {
@ -942,6 +944,7 @@ namespace BizHawk.MultiClient
B = ""; B = "";
Start = ""; Start = "";
Select = ""; Select = "";
Power = "";
} }
} }
} }

View File

@ -877,6 +877,7 @@ namespace BizHawk.MultiClient
gbControls.BindMulti("B", Global.Config.GBController[0].B); gbControls.BindMulti("B", Global.Config.GBController[0].B);
gbControls.BindMulti("Select", Global.Config.GBController[0].Select); gbControls.BindMulti("Select", Global.Config.GBController[0].Select);
gbControls.BindMulti("Start", Global.Config.GBController[0].Start); gbControls.BindMulti("Start", Global.Config.GBController[0].Start);
gbControls.BindMulti("Power", Global.Config.GBController[0].Power);
Global.GBControls = gbControls; Global.GBControls = gbControls;
var agbControls = new AutofireController(Gameboy.GbController); var agbControls = new AutofireController(Gameboy.GbController);

View File

@ -77,7 +77,15 @@ namespace BizHawk.MultiClient
{ {
FieldInfo buttonF = ControllerConfigObject.GetType().GetField(buttons[button]); FieldInfo buttonF = ControllerConfigObject.GetType().GetField(buttons[button]);
object field = ControllerConfigObject.GetType().GetField(buttons[button]).GetValue(ControllerConfigObject); object field = ControllerConfigObject.GetType().GetField(buttons[button]).GetValue(ControllerConfigObject);
Inputs[button].SetBindings(field.ToString());
if (field == null)
{
Inputs[button].SetBindings("");
}
else
{
Inputs[button].SetBindings(field.ToString());
}
} }
} }