Use props on GamePad/GamePad360 for pad prefixes
This commit is contained in:
parent
d02863e491
commit
bdfc54443f
|
@ -41,15 +41,13 @@ namespace BizHawk.Bizware.DirectX
|
|||
{
|
||||
foreach (var pad in GamePad360.EnumerateDevices())
|
||||
{
|
||||
var inputNamePrefix = $"X{pad.PlayerNumber} ";
|
||||
for (int b = 0, n = pad.NumButtons; b < n; b++) handleButton(inputNamePrefix + pad.ButtonName(b), pad.Pressed(b), ClientInputFocus.Pad);
|
||||
foreach (var (axisName, f) in pad.GetAxes()) handleAxis(inputNamePrefix + axisName, (int) f);
|
||||
for (int b = 0, n = pad.NumButtons; b < n; b++) handleButton(pad.InputNamePrefix + pad.ButtonName(b), pad.Pressed(b), ClientInputFocus.Pad);
|
||||
foreach (var (axisName, f) in pad.GetAxes()) handleAxis(pad.InputNamePrefix + axisName, (int) f);
|
||||
}
|
||||
foreach (var pad in GamePad.EnumerateDevices())
|
||||
{
|
||||
var inputNamePrefix = $"J{pad.PlayerNumber} ";
|
||||
for (int b = 0, n = pad.NumButtons; b < n; b++) handleButton(inputNamePrefix + pad.ButtonName(b), pad.Pressed(b), ClientInputFocus.Pad);
|
||||
foreach (var (axisName, f) in pad.GetAxes()) handleAxis(inputNamePrefix + axisName, (int) f);
|
||||
for (int b = 0, n = pad.NumButtons; b < n; b++) handleButton(pad.InputNamePrefix + pad.ButtonName(b), pad.Pressed(b), ClientInputFocus.Pad);
|
||||
foreach (var (axisName, f) in pad.GetAxes()) handleAxis(pad.InputNamePrefix + axisName, (int) f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -96,6 +96,7 @@ namespace BizHawk.Bizware.DirectX
|
|||
{
|
||||
_joystick = joystick;
|
||||
PlayerNumber = index + 1;
|
||||
InputNamePrefix = $"J{PlayerNumber} ";
|
||||
Update();
|
||||
InitializeCallbacks();
|
||||
}
|
||||
|
@ -141,6 +142,8 @@ namespace BizHawk.Bizware.DirectX
|
|||
|
||||
public int PlayerNumber { get; }
|
||||
|
||||
public readonly string InputNamePrefix;
|
||||
|
||||
public string ButtonName(int index)
|
||||
{
|
||||
return _names[index];
|
||||
|
|
|
@ -122,10 +122,13 @@ namespace BizHawk.Bizware.DirectX
|
|||
|
||||
public int PlayerNumber => (int)_index0 + 1;
|
||||
|
||||
public readonly string InputNamePrefix;
|
||||
|
||||
private GamePad360(uint index0, Controller c)
|
||||
{
|
||||
this._index0 = index0;
|
||||
_controller = c;
|
||||
InputNamePrefix = $"X{PlayerNumber} ";
|
||||
InitializeButtons();
|
||||
Update();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue