ButtonSchema - simplify with another overload

This commit is contained in:
adelikat 2020-03-22 15:15:22 -05:00
parent 554e0dcf80
commit ec353e163e
7 changed files with 24 additions and 29 deletions

View File

@ -77,16 +77,14 @@ namespace BizHawk.Client.EmuHawk
{
DisplayName = "B2"
},
new SingleFloatSchema(55, 17, $"P{controller} Paddle X 1")
new SingleFloatSchema(55, 17, controller, "Paddle X 1")
{
DisplayName = "Paddle X 1",
TargetSize = new Size(128, 69),
MaxValue = 127,
MinValue = -127
},
new SingleFloatSchema(193, 17, $"P{controller} Paddle X 2")
new SingleFloatSchema(193, 17, controller, "Paddle X 2")
{
DisplayName = "Paddle X 2",
TargetSize = new Size(128, 69),
MaxValue = 127,
MinValue = -127
@ -137,16 +135,14 @@ namespace BizHawk.Client.EmuHawk
{
DisplayName = "B1"
},
new SingleFloatSchema(55, 17, $"P{controller} Wheel X 1")
new SingleFloatSchema(55, 17, controller, "Wheel X 1")
{
DisplayName = "Wheel X 1",
TargetSize = new Size(128, 69),
MaxValue = 127,
MinValue = -127
},
new SingleFloatSchema(193, 17, $"P{controller} Wheel X 2")
new SingleFloatSchema(193, 17, controller, "Wheel X 2")
{
DisplayName = "Wheel X 2",
TargetSize = new Size(128, 69),
MaxValue = 127,
MinValue = -127

View File

@ -105,10 +105,7 @@ namespace BizHawk.Client.EmuHawk
DefaultSize = new Size(250, 74),
Buttons = new[]
{
new SingleFloatSchema(23, 15, $"P{controller} Paddle")
{
DisplayName = "Paddle"
},
new SingleFloatSchema(23, 15, controller, "Paddle"),
new ButtonSchema(12, 90, $"P{controller} Trigger")
{
DisplayName = "1"

View File

@ -77,6 +77,12 @@ namespace BizHawk.Client.EmuHawk
{
Type = PadInputType.SingleFloat;
}
public SingleFloatSchema(int x, int y, int controller, string name)
: base(x, y, controller, name)
{
Type = PadInputType.SingleFloat;
}
}
public class TargetedPairSchema : ButtonSchema

View File

@ -110,7 +110,7 @@ namespace BizHawk.Client.EmuHawk
new ButtonSchema(27, 154, controller, "Star") { DisplayName = "*" },
new ButtonSchema(50, 154, controller, "0"),
new ButtonSchema(73, 154, controller, "Pound") { DisplayName = "#" },
new SingleFloatSchema(6, 200, $"P{controller} Disc X")
new SingleFloatSchema(6, 200, controller, "Disc X")
{
DisplayName = "Disc",
TargetSize = new Size(180, 55),

View File

@ -284,7 +284,7 @@ namespace BizHawk.Client.EmuHawk
MaxSize = new Size(380, 110),
Buttons = new[]
{
new SingleFloatSchema(14, 17, $"P{controller} Paddle")
new SingleFloatSchema(14, 17, controller, "Paddle")
{
DisplayName = "Arkanoid Paddle",
TargetSize = new Size(380, 69),

View File

@ -164,29 +164,27 @@ namespace BizHawk.Client.EmuHawk
new ButtonSchema(278, 38, controller, "B"),
new ButtonSchema(308, 55, controller, "A"),
new ButtonSchema(308, 15, controller, "R"),
new SingleFloatSchema(5, 15, $"P{controller} L")
new SingleFloatSchema(5, 15, controller, "L")
{
DisplayName = "L",
TargetSize = new Size(128, 55),
MinValue = 0,
MaxValue = 255
},
new SingleFloatSchema(125, 15, $"P{controller} Twist")
new SingleFloatSchema(125, 15, controller, "Twist")
{
DisplayName = "Twist",
TargetSize = new Size(64, 178),
MinValue = 0,
MaxValue = 255,
Orientation = Orientation.Vertical
},
new SingleFloatSchema(180, 60, $"P{controller} 2")
new SingleFloatSchema(180, 60, controller, "2")
{
DisplayName = "II",
TargetSize = new Size(128, 55),
MinValue = 0,
MaxValue = 255
},
new SingleFloatSchema(220, 120, $"P{controller} 1")
new SingleFloatSchema(220, 120, controller, "1")
{
DisplayName = "I",
TargetSize = new Size(128, 55),

View File

@ -115,16 +115,16 @@ namespace BizHawk.Client.EmuHawk
AxisRange = axisRanges[0],
SecondaryAxisRange = axisRanges[1],
},
new SingleFloatSchema(8, 12, $"P{controller} Left Shoulder")
new SingleFloatSchema(8, 12, controller, "Left Shoulder")
{
DisplayName = "L",
TargetSize = new Size(128, 55),
MinValue = 0,
MaxValue = 255
},
new SingleFloatSchema(328, 12, $"P{controller} Right Shoulder")
new SingleFloatSchema(328, 12, controller, "Right Shoulder")
{
DisplayName = "L",
DisplayName = "R",
TargetSize = new Size(128, 55),
MinValue = 0,
MaxValue = 255
@ -170,9 +170,8 @@ namespace BizHawk.Client.EmuHawk
DefaultSize = new Size(325, 100),
Buttons = new[]
{
new SingleFloatSchema(8, 12, $"P{controller} Wheel")
new SingleFloatSchema(8, 12, controller, "Wheel")
{
DisplayName = "Wheel",
TargetSize = new Size(128, 55),
MinValue = 0,
MaxValue = 255
@ -214,9 +213,8 @@ namespace BizHawk.Client.EmuHawk
AxisRange = axisRanges[0],
SecondaryAxisRange = axisRanges[1]
},
new SingleFloatSchema(135, 13, $"P{controller} Throttle")
new SingleFloatSchema(135, 13, controller, "Throttle")
{
DisplayName = "Throttle",
TargetSize = new Size(64, 178),
MinValue = 0,
MaxValue = 255,
@ -241,7 +239,7 @@ namespace BizHawk.Client.EmuHawk
AxisRange = axisRanges[3],
SecondaryAxisRange = axisRanges[4]
},
new SingleFloatSchema(8, 13, $"P{controller} Left Throttle")
new SingleFloatSchema(8, 13, controller, "Left Throttle")
{
DisplayName = "Throttle",
TargetSize = new Size(64, 178),
@ -255,7 +253,7 @@ namespace BizHawk.Client.EmuHawk
AxisRange = axisRanges[0],
SecondaryAxisRange = axisRanges[1]
},
new SingleFloatSchema(350, 13, $"P{controller} Right Throttle")
new SingleFloatSchema(350, 13, controller, "Right Throttle")
{
DisplayName = "Throttle",
TargetSize = new Size(64, 178),