From 39424891b41dac9269f89c12678ced73e453a67c Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 23 Jul 2020 17:42:36 -0500 Subject: [PATCH] virtualpads - add another constructor overload to simplify schema classes more --- .../tools/VirtualPads/schema/A26Schema.cs | 23 +-- .../tools/VirtualPads/schema/A78Schema.cs | 6 +- .../tools/VirtualPads/schema/C64Schema.cs | 2 +- .../tools/VirtualPads/schema/ColecoSchema.cs | 4 +- .../tools/VirtualPads/schema/DualGBSchema.cs | 4 +- .../tools/VirtualPads/schema/GBSchema.cs | 4 +- .../tools/VirtualPads/schema/GGLSchema.cs | 6 +- .../tools/VirtualPads/schema/GenSchema.cs | 36 +--- .../tools/VirtualPads/schema/IntvSchema.cs | 12 +- .../tools/VirtualPads/schema/N64Schema.cs | 2 +- .../tools/VirtualPads/schema/NesSchema.cs | 186 ++++-------------- .../tools/VirtualPads/schema/NgpSchema.cs | 2 +- .../tools/VirtualPads/schema/PSXSchema.cs | 22 +-- .../VirtualPads/schema/PadSchemaControl.cs | 4 + .../tools/VirtualPads/schema/PceSchema.cs | 28 +-- .../tools/VirtualPads/schema/PcfxSchema.cs | 12 +- .../tools/VirtualPads/schema/SGBSchema.cs | 4 +- .../tools/VirtualPads/schema/SaturnSchema.cs | 24 +-- .../tools/VirtualPads/schema/SmsSchema.cs | 6 +- .../tools/VirtualPads/schema/SnesSchema.cs | 14 +- .../tools/VirtualPads/schema/VECSchema.cs | 5 +- .../VirtualPads/schema/WonderSwanSchema.cs | 4 +- .../VirtualPads/schema/ZXSpectrumSchema.cs | 5 +- 23 files changed, 118 insertions(+), 297 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A26Schema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A26Schema.cs index b409989dc5..d5b5798b48 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A26Schema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A26Schema.cs @@ -55,7 +55,7 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(23, 36, controller), ButtonSchema.Left(2, 24, controller), ButtonSchema.Right(44, 24, controller), - new ButtonSchema(124, 24, controller, "Button") { DisplayName = "B" } + new ButtonSchema(124, 24, controller, "Button", "B") } }; } @@ -68,14 +68,8 @@ namespace BizHawk.Client.EmuHawk Size = new Size(334, 94), Buttons = new PadSchemaControl[] { - new ButtonSchema(5, 24, controller, "Button 1") - { - DisplayName = "B1" - }, - new ButtonSchema(5, 48, controller, "Button 2") - { - DisplayName = "B2" - }, + new ButtonSchema(5, 24, controller, "Button 1", "B1"), + new ButtonSchema(5, 48, controller, "Button 2", "B2"), new SingleAxisSchema(55, 17, controller, "Paddle X 1") { TargetSize = new Size(128, 69), @@ -104,9 +98,9 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(23, 36, controller), ButtonSchema.Left(2, 24, controller), ButtonSchema.Right(44, 24, controller), - new ButtonSchema(132, 24, controller, "Button") { DisplayName = "B" }, - new ButtonSchema(68, 36, controller, "Button 1") { DisplayName = "B1" }, - new ButtonSchema(100, 36, controller, "Button 2") { DisplayName = "B2" } + new ButtonSchema(132, 24, controller, "Button", "B"), + new ButtonSchema(68, 36, controller, "Button 1", "B1"), + new ButtonSchema(100, 36, controller, "Button 2", "B2") } }; } @@ -119,10 +113,7 @@ namespace BizHawk.Client.EmuHawk Size = new Size(334, 94), Buttons = new PadSchemaControl[] { - new ButtonSchema(5, 24, controller, "Button") - { - DisplayName = "B1" - }, + new ButtonSchema(5, 24, controller, "Button", "B1"), new SingleAxisSchema(55, 17, controller, "Wheel X 1") { TargetSize = new Size(128, 69), diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A78Schema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A78Schema.cs index 8c2fc7bd16..b6cf4ce214 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A78Schema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/A78Schema.cs @@ -66,7 +66,7 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(23, 36, controller), ButtonSchema.Left(2, 24, controller), ButtonSchema.Right(44, 24, controller), - new ButtonSchema(120, 24, controller, "Button") { DisplayName = "1" } + new ButtonSchema(120, 24, controller, "Button", "1") } }; } @@ -83,8 +83,8 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(23, 36, controller), ButtonSchema.Left(2, 24, controller), ButtonSchema.Right(44, 24, controller), - new ButtonSchema(120, 24, controller, "Trigger") { DisplayName = "1" }, - new ButtonSchema(145, 24, controller, "Trigger 2") { DisplayName = "2" } + new ButtonSchema(120, 24, controller, "Trigger", "1"), + new ButtonSchema(145, 24, controller, "Trigger 2", "2") } }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/C64Schema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/C64Schema.cs index ac6a236a39..f35f1e73a9 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/C64Schema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/C64Schema.cs @@ -28,7 +28,7 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(23, 36, controller), ButtonSchema.Left(2, 24, controller), ButtonSchema.Right(44, 24, controller), - new ButtonSchema(124, 24, controller, "Button") { DisplayName = "B" } + new ButtonSchema(124, 24, controller, "Button", "B") } }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/ColecoSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/ColecoSchema.cs index 21dc332c11..56e2227183 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/ColecoSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/ColecoSchema.cs @@ -103,9 +103,9 @@ namespace BizHawk.Client.EmuHawk new ButtonSchema(27, 131, controller, "7"), new ButtonSchema(50, 131, controller, "8"), new ButtonSchema(73, 131, controller, "9"), - new ButtonSchema(27, 154, controller, "Star") { DisplayName = "*" }, + new ButtonSchema(27, 154, controller, "Star", "*"), new ButtonSchema(50, 154, controller, "0"), - new ButtonSchema(73, 154, controller, "Pound") { DisplayName = "#" } + new ButtonSchema(73, 154, controller, "Pound", "#") }; } } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/DualGBSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/DualGBSchema.cs index ce45ea16fc..faeae41edd 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/DualGBSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/DualGBSchema.cs @@ -28,8 +28,8 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Right(24, 34, controller), new ButtonSchema(122, 34, controller, "B"), new ButtonSchema(146, 34, controller, "A"), - new ButtonSchema(52, 34, controller, "Select") { DisplayName = "s" }, - new ButtonSchema(74, 34, controller, "Start") { DisplayName = "S" } + new ButtonSchema(52, 34, controller, "Select", "s"), + new ButtonSchema(74, 34, controller, "Start", "S") } }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GBSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GBSchema.cs index aab55439dd..ef6b095e55 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GBSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GBSchema.cs @@ -75,8 +75,8 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Right(24, 34, controller), new ButtonSchema(122, 34, controller, "B"), new ButtonSchema(146, 34, controller, "A"), - new ButtonSchema(52, 34, controller, "Select") { DisplayName = "s" }, - new ButtonSchema(74, 34, controller, "Start") { DisplayName = "S" } + new ButtonSchema(52, 34, controller, "Select", "s"), + new ButtonSchema(74, 34, controller, "Start", "S") } }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GGLSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GGLSchema.cs index a6efbd3144..6e1a029eda 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GGLSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GGLSchema.cs @@ -26,9 +26,9 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(14, 56, controller), ButtonSchema.Left(2, 34, controller), ButtonSchema.Right(24, 34, controller), - new ButtonSchema(134, 12, controller, "Start") { DisplayName = "S" }, - new ButtonSchema(122, 34, controller, "B1") { DisplayName = "1" }, - new ButtonSchema(146, 34, controller, "B2") { DisplayName = "2" } + new ButtonSchema(134, 12, controller, "Start", "S"), + new ButtonSchema(122, 34, controller, "B1", "1"), + new ButtonSchema(146, 34, controller, "B2", "2") } }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs index 53c48b01b3..a0f6501e0f 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs @@ -101,7 +101,7 @@ namespace BizHawk.Client.EmuHawk new ButtonSchema(98, 40, controller, "A"), new ButtonSchema(122, 40, controller, "B"), new ButtonSchema(146, 40, controller, "C"), - new ButtonSchema(122, 12, controller, "Start") { DisplayName = "S" } + new ButtonSchema(122, 12, controller, "Start", "S") }; } @@ -117,14 +117,8 @@ namespace BizHawk.Client.EmuHawk { TargetSize = new Size(320, 240) }, - new ButtonSchema(284, 17, controller, "Lightgun Trigger") - { - DisplayName = "Trigger" - }, - new ButtonSchema(284, 40, controller, "Lightgun Start") - { - DisplayName = "Start" - } + new ButtonSchema(284, 17, controller, "Lightgun Trigger", "Trigger"), + new ButtonSchema(284, 40, controller, "Lightgun Start", "Start") } }; } @@ -142,22 +136,10 @@ namespace BizHawk.Client.EmuHawk // MaxValue = 255, // TargetSize = new Size(520, 570) }, - new ButtonSchema(365, 17, controller, "Mouse Left") - { - DisplayName = "Left" - }, - new ButtonSchema(365, 40, controller, "Mouse Center") - { - DisplayName = "Center" - }, - new ButtonSchema(365, 63, "Mouse Right") - { - DisplayName = "Right" - }, - new ButtonSchema(365, 86, "Mouse Start") - { - DisplayName = "Start" - } + new ButtonSchema(365, 17, controller, "Mouse Left", "Left"), + new ButtonSchema(365, 40, controller, "Mouse Center", "Center"), + new ButtonSchema(365, 63, controller, "Mouse Right", "Right"), + new ButtonSchema(365, 86, controller, "Mouse Start", "Start") } }; } @@ -207,8 +189,8 @@ namespace BizHawk.Client.EmuHawk new ButtonSchema(122, 40, controller, "B"), new ButtonSchema(146, 40, controller, "C"), new ButtonSchema(98, 65, controller, "D"), - new ButtonSchema(122, 65, controller, "E1") { DisplayName = "E¹" }, - new ButtonSchema(152, 65, controller, "E2") { DisplayName = "E²" }, + new ButtonSchema(122, 65, controller, "E1", "E¹"), + new ButtonSchema(152, 65, controller, "E2", "E²"), new ButtonSchema(122, 12, controller, "Start"), new ButtonSchema(162, 12, controller, "Select") } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/IntvSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/IntvSchema.cs index ae5504e90d..143bb62a4c 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/IntvSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/IntvSchema.cs @@ -99,13 +99,13 @@ namespace BizHawk.Client.EmuHawk Key(25, 67, controller, 7), Key(51, 67, controller, 8), Key(77, 67, controller, 9), - new ButtonSchema(25, 93, controller, "Clear") { DisplayName = "C" }, + new ButtonSchema(25, 93, controller, "Clear", "C"), Key(51, 93, controller, 0), - new ButtonSchema(77, 93, controller, "Enter") { DisplayName = "E" }, - new ButtonSchema(2, 41, controller, "Top") { DisplayName = "T" }, - new ButtonSchema(100, 41, controller, "Top") { DisplayName = "T" }, - new ButtonSchema(2, 67, controller, "L") { DisplayName = "L" }, - new ButtonSchema(100, 67, controller, "R") { DisplayName = "R" } + new ButtonSchema(77, 93, controller, "Enter", "E"), + new ButtonSchema(2, 41, controller, "Top", "T"), + new ButtonSchema(100, 41, controller, "Top", "T"), + new ButtonSchema(2, 67, controller, "L"), + new ButtonSchema(100, 67, controller, "R") }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/N64Schema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/N64Schema.cs index 3ef9e98219..507807400c 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/N64Schema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/N64Schema.cs @@ -37,7 +37,7 @@ namespace BizHawk.Client.EmuHawk new ButtonSchema(3, 185, controller, "L"), new ButtonSchema(191, 185, controller, "R"), new ButtonSchema(81, 269, controller, "Z"), - new ButtonSchema(81, 246, controller, "Start") { DisplayName = "S" }, + new ButtonSchema(81, 246, controller, "Start", "S"), new ButtonSchema(127, 246, controller, "B"), new ButtonSchema(138, 269, controller, "A"), new ButtonSchema(173, 210, controller, "C Up") diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NesSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NesSchema.cs index 9f2d9759a2..f82cceade1 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NesSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NesSchema.cs @@ -220,8 +220,8 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Right(44, 24, controller), new ButtonSchema(124, 24, controller, "B"), new ButtonSchema(147, 24, controller, "A"), - new ButtonSchema(72, 24, controller, "Select") { DisplayName = "s" }, - new ButtonSchema(93, 24, controller, "Start") { DisplayName = "S" } + new ButtonSchema(72, 24, controller, "Select", "s"), + new ButtonSchema(93, 24, controller, "Start", "S") } }; } @@ -241,7 +241,7 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Right(44, 24, controller), new ButtonSchema(124, 24, controller, "B"), new ButtonSchema(147, 24, controller, "A"), - new ButtonSchema(72, 24, controller, "Microphone") { DisplayName = "Mic" } + new ButtonSchema(72, 24, controller, "Microphone", "Mic") } }; } @@ -340,38 +340,14 @@ namespace BizHawk.Client.EmuHawk Size = new Size(560, 180), Buttons = new[] { - new ButtonSchema(23, 15, controller, "F1") - { - DisplayName = " F1 " - }, - new ButtonSchema(76, 15, controller, "F2") - { - DisplayName = " F2 " - }, - new ButtonSchema(129, 15, controller, "F3") - { - DisplayName = " F3 " - }, - new ButtonSchema(182, 15, controller, "F4") - { - DisplayName = " F4 " - }, - new ButtonSchema(235, 15, controller, "F5") - { - DisplayName = " F5 " - }, - new ButtonSchema(288, 15, controller, "F6") - { - DisplayName = " F6 " - }, - new ButtonSchema(341, 15, controller, "F7") - { - DisplayName = " F7 " - }, - new ButtonSchema(394, 15, controller, "F8") - { - DisplayName = " F8 " - }, + new ButtonSchema(23, 15, controller, "F1", " F1 "), + new ButtonSchema(76, 15, controller, "F2", " F2 "), + new ButtonSchema(129, 15, controller, "F3", " F3 "), + new ButtonSchema(182, 15, controller, "F4", " F4 "), + new ButtonSchema(235, 15, controller, "F5", " F5 "), + new ButtonSchema(288, 15, controller, "F6", " F6 "), + new ButtonSchema(341, 15, controller, "F7", " F7 "), + new ButtonSchema(394, 15, controller, "F8", " F8 "), new ButtonSchema(36, 38, controller, "1"), new ButtonSchema(60, 38, controller, "2"), new ButtonSchema(84, 38, controller, "3"), @@ -382,26 +358,11 @@ namespace BizHawk.Client.EmuHawk new ButtonSchema(204, 38, controller, "8"), new ButtonSchema(228, 38, controller, "9"), new ButtonSchema(252, 38, controller, "0"), - new ButtonSchema(276, 38, controller, "Minus") - { - DisplayName = "-" - }, - new ButtonSchema(296, 38, controller, "Caret") - { - DisplayName = "^" - }, - new ButtonSchema(320, 38, controller, "Yen") - { - DisplayName = "¥" - }, - new ButtonSchema(344, 38, controller, "Stop") - { - DisplayName = "STOP" - }, - new ButtonSchema(15, 61, controller, "Escape") - { - DisplayName = "ESC" - }, + new ButtonSchema(276, 38, controller, "Minus", "-"), + new ButtonSchema(296, 38, controller, "Caret", "^"), + new ButtonSchema(320, 38, controller, "Yen", "¥"), + new ButtonSchema(344, 38, controller, "Stop", "STOP"), + new ButtonSchema(15, 61, controller, "Escape", "ESC"), new ButtonSchema(54, 61, controller, "Q"), new ButtonSchema(80, 61, controller, "W"), new ButtonSchema(108, 61, controller, "E"), @@ -412,22 +373,10 @@ namespace BizHawk.Client.EmuHawk new ButtonSchema(232, 61, controller, "I"), new ButtonSchema(252, 61, controller, "O"), new ButtonSchema(278, 61, controller, "P"), - new ButtonSchema(302, 61, controller, "At") - { - DisplayName = "@" - }, - new ButtonSchema(330, 61, controller, "Left Bracket") - { - DisplayName = "[" - }, - new ButtonSchema(350, 61, controller, "Return") - { - DisplayName = "RETURN" - }, - new ButtonSchema(30, 84, controller, "Control") - { - DisplayName = "CTR" - }, + new ButtonSchema(302, 61, controller, "At", "@"), + new ButtonSchema(330, 61, controller, "Left Bracket", "["), + new ButtonSchema(350, 61, controller, "Return", "RETURN"), + new ButtonSchema(30, 84, controller, "Control", "CTR"), new ButtonSchema(70, 84, controller, "A"), new ButtonSchema(94, 84, controller, "S"), new ButtonSchema(118, 84, controller, "D"), @@ -437,26 +386,11 @@ namespace BizHawk.Client.EmuHawk new ButtonSchema(220, 84, controller, "J"), new ButtonSchema(242, 84, controller, "K"), new ButtonSchema(266, 84, controller, "L"), - new ButtonSchema(290, 84, controller, "Semicolon") - { - DisplayName = ";" - }, - new ButtonSchema(311, 84, controller, "Colon") - { - DisplayName = ":" - }, - new ButtonSchema(332, 84, controller, "Right Bracket") - { - DisplayName = "]" - }, - new ButtonSchema(352, 84, controller, "カナ") - { - DisplayName = "カナ" - }, - new ButtonSchema(10, 107, controller, "Left Shift") - { - DisplayName = "SHIFT" - }, + new ButtonSchema(290, 84, controller, "Semicolon", ";"), + new ButtonSchema(311, 84, controller, "Colon", ":"), + new ButtonSchema(332, 84, controller, "Right Bracket", "]"), + new ButtonSchema(352, 84, controller, "カナ"), + new ButtonSchema(10, 107, controller, "Left Shift", "SHIFT"), new ButtonSchema(58, 107, controller, "Z"), new ButtonSchema(82, 107, controller, "X"), new ButtonSchema(106, 107, controller, "C"), @@ -464,62 +398,20 @@ namespace BizHawk.Client.EmuHawk new ButtonSchema(154, 107, controller, "B"), new ButtonSchema(178, 107, controller, "N"), new ButtonSchema(203, 107, controller, "M"), - new ButtonSchema(229, 107, controller, "Comma") - { - DisplayName = "," - }, - new ButtonSchema(249, 107, controller, "Period") - { - DisplayName = "." - }, - new ButtonSchema(270, 107, controller, "Slash") - { - DisplayName = "/" - }, - new ButtonSchema(292, 107, controller, "Underscore") - { - DisplayName = "_" - }, - new ButtonSchema(316, 107, controller, "Right Shift") - { - DisplayName = "SHIFT" - }, - new ButtonSchema(82, 130, controller, "Graph") - { - DisplayName = "GRPH" - }, - new ButtonSchema(130, 130, controller, "Space") - { - DisplayName = " SPACE " - }, - new ButtonSchema(420, 46, controller, "Clear/Home") - { - DisplayName = " CLR\nHOME" - }, - new ButtonSchema(470, 46, controller, "Insert") - { - DisplayName = "\nINS" - }, - new ButtonSchema(506, 46, controller, "Delete") - { - DisplayName = "\nDEL" - }, - new ButtonSchema(468, 86, controller, "Up") - { - DisplayName = " ↑ " - }, - new ButtonSchema(468, 134, controller, "Down") - { - DisplayName = " ↓ " - }, - new ButtonSchema(446, 110, controller, "Left") - { - DisplayName = " ← " - }, - new ButtonSchema(488, 110, controller, "Right") - { - DisplayName = " ➝ " - } + new ButtonSchema(229, 107, controller, "Comma", ","), + new ButtonSchema(249, 107, controller, "Period", "."), + new ButtonSchema(270, 107, controller, "Slash", "/"), + new ButtonSchema(292, 107, controller, "Underscore", "_"), + new ButtonSchema(316, 107, controller, "Right Shift", "SHIFT"), + new ButtonSchema(82, 130, controller, "Graph", "GRPH"), + new ButtonSchema(130, 130, controller, "Space", " SPACE "), + new ButtonSchema(420, 46, controller, "Clear/Home", " CLR\nHOME"), + new ButtonSchema(470, 46, controller, "Insert", "\nINS"), + new ButtonSchema(506, 46, controller, "Delete", "\nDEL"), + new ButtonSchema(468, 86, controller, "Up", " ↑ "), + new ButtonSchema(468, 134, controller, "Down", " ↓ "), + new ButtonSchema(446, 110, controller, "Left", " ← "), + new ButtonSchema(488, 110, controller, "Right", " ➝ ") } }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NgpSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NgpSchema.cs index 0ec6dd2222..fb51d978e9 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NgpSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NgpSchema.cs @@ -28,7 +28,7 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Right(24, 34, 1), new ButtonSchema(74, 34, 1, "B"), new ButtonSchema(98, 34, 1, "A"), - new ButtonSchema(146, 12, 1, "Option") { DisplayName = "O" } + new ButtonSchema(146, 12, 1, "Option", "O") } }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs index 928a4ad19b..9d144af8ba 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs @@ -79,14 +79,8 @@ namespace BizHawk.Client.EmuHawk { Icon = Properties.Resources.Cross }, - new ButtonSchema(112, 62, controller, "Start") - { - DisplayName = "S" - }, - new ButtonSchema(90, 62, controller, "Select") - { - DisplayName = "s" - }, + new ButtonSchema(112, 62, controller, "Start", "S"), + new ButtonSchema(90, 62, controller, "Select", "s"), new AnalogSchema(3, 120, $"P{controller} LStick X") { Spec = stickRanges[0], @@ -133,14 +127,8 @@ namespace BizHawk.Client.EmuHawk { Icon = Properties.Resources.Cross }, - new ButtonSchema(112, 67, controller, "Start") - { - DisplayName = "S" - }, - new ButtonSchema(90, 67, controller, "Select") - { - DisplayName = "s" - } + new ButtonSchema(112, 67, controller, "Start", "S"), + new ButtonSchema(90, 67, controller, "Select", "s") } }; } @@ -157,7 +145,7 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(36, 104, controller), ButtonSchema.Left(15, 95, controller), ButtonSchema.Right(57, 95, controller), - new ButtonSchema(78, 118, controller, "Start") { DisplayName = "S" }, + new ButtonSchema(78, 118, controller, "Start", "S"), new ButtonSchema(278, 38, controller, "B"), new ButtonSchema(308, 55, controller, "A"), new ButtonSchema(308, 15, controller, "R"), diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PadSchemaControl.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PadSchemaControl.cs index bf39a30b4c..ba07ffb63f 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PadSchemaControl.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PadSchemaControl.cs @@ -36,6 +36,10 @@ namespace BizHawk.Client.EmuHawk : base(new Point(x, y), $"P{controller} {name}") => DisplayName = name; + public ButtonSchema(int x, int y, int controller, string name, string displayName) + : this(x, y, controller, name) + => DisplayName = displayName; + public static ButtonSchema Up(int x, int y, string? name = null) => new ButtonSchema(x, y, name ?? "Up") { Icon = Resources.BlueUp }; diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PceSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PceSchema.cs index 783e98ebbc..8e18af7e8f 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PceSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PceSchema.cs @@ -75,22 +75,10 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(14, 56, controller), ButtonSchema.Left(2, 34, controller), ButtonSchema.Right(24, 34, controller), - new ButtonSchema(122, 34, controller, "B2") - { - DisplayName = "II" - }, - new ButtonSchema(146, 34, controller, "B1") - { - DisplayName = "I" - }, - new ButtonSchema(52, 34, controller, "Select") - { - DisplayName = "s" - }, - new ButtonSchema(74, 34, controller, "Run") - { - DisplayName = "R" - } + new ButtonSchema(122, 34, controller, "B2", "II"), + new ButtonSchema(146, 34, controller, "B1", "I"), + new ButtonSchema(52, 34, controller, "Select", "s"), + new ButtonSchema(74, 34, controller, "Run", "R") } }; } @@ -129,16 +117,16 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(14, 56, controller), ButtonSchema.Left(2, 34, controller), ButtonSchema.Right(24, 34, controller), - new ButtonSchema(77, 17, controller, "Mode: Set 2-button") { DisplayName = "2 Btn" }, - new ButtonSchema(77, 40, controller, "Mode: Set 6-button") { DisplayName = "6 Btn" }, + new ButtonSchema(77, 17, controller, "Mode: Set 2-button", "2 Btn"), + new ButtonSchema(77, 40, controller, "Mode: Set 6-button", "6 Btn"), new ButtonSchema(140, 63, controller, "IV"), new ButtonSchema(166, 53, controller, "V"), new ButtonSchema(192, 43, controller, "VI"), new ButtonSchema(140, 40, controller, "I"), new ButtonSchema(166, 30, controller, "II"), new ButtonSchema(192, 20, controller, "III"), - new ButtonSchema(77, 63, controller, "Select") { DisplayName = "s" }, - new ButtonSchema(101, 63, controller, "Run") { DisplayName = "R" } + new ButtonSchema(77, 63, controller, "Select", "s"), + new ButtonSchema(101, 63, controller, "Run", "R") } }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PcfxSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PcfxSchema.cs index 04021841a3..acd6dfbb49 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PcfxSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PcfxSchema.cs @@ -53,18 +53,18 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(14, 56, controller), ButtonSchema.Left(2, 34, controller), ButtonSchema.Right(24, 34, controller), - new ButtonSchema(72, 17, controller, "Mode 1: Set A") { DisplayName = "1A" }, - new ButtonSchema(72, 40, controller, "Mode 2: Set A") { DisplayName = "2A" }, - new ButtonSchema(102, 17, controller, "Mode 1: Set B") { DisplayName = "1B" }, - new ButtonSchema(102, 40, controller, "Mode 2: Set B") { DisplayName = "2B" }, + new ButtonSchema(72, 17, controller, "Mode 1: Set A", "1A"), + new ButtonSchema(72, 40, controller, "Mode 2: Set A", "2A"), + new ButtonSchema(102, 17, controller, "Mode 1: Set B", "1B"), + new ButtonSchema(102, 40, controller, "Mode 2: Set B", "2B"), new ButtonSchema(140, 63, controller, "IV"), new ButtonSchema(166, 53, controller, "V"), new ButtonSchema(192, 43, controller, "VI"), new ButtonSchema(140, 40, controller, "I"), new ButtonSchema(166, 30, controller, "II"), new ButtonSchema(192, 20, controller, "III"), - new ButtonSchema(77, 63, controller, "Select") { DisplayName = "s" }, - new ButtonSchema(101, 63, controller, "Run") { DisplayName = "R" } + new ButtonSchema(77, 63, controller, "Select", "s"), + new ButtonSchema(101, 63, controller, "Run", "R") } }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SGBSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SGBSchema.cs index 7df7bb8a13..cc0ebd5735 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SGBSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SGBSchema.cs @@ -30,8 +30,8 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Right(24, 34, controller), new ButtonSchema(122, 34, controller, "B"), new ButtonSchema(146, 34, controller, "A"), - new ButtonSchema(52, 34, controller, "Select") { DisplayName = "s" }, - new ButtonSchema(74, 34, controller, "Start") { DisplayName = "S" } + new ButtonSchema(52, 34, controller, "Select", "s"), + new ButtonSchema(74, 34, controller, "Start", "S") } }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SaturnSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SaturnSchema.cs index 0bc6966fa0..a6b231f3d8 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SaturnSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SaturnSchema.cs @@ -69,7 +69,7 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(34, 61, controller), ButtonSchema.Left(22, 39, controller), ButtonSchema.Right(44, 39, controller), - new ButtonSchema(78, 52, controller, "Start") { DisplayName = "S" }, + new ButtonSchema(78, 52, controller, "Start", "S"), new ButtonSchema(110, 63, controller, "A"), new ButtonSchema(134, 53, controller, "B"), new ButtonSchema(158, 43, controller, "C"), @@ -93,7 +93,7 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(290, 121, $"P{controller} D-Pad Down"), ButtonSchema.Left(278, 99, $"P{controller} D-Pad Left"), ButtonSchema.Right(300, 99, $"P{controller} D-Pad Right"), - new ButtonSchema(334, 112, controller, "Start") { DisplayName = "S" }, + new ButtonSchema(334, 112, controller, "Start", "S"), new ButtonSchema(366, 123, controller, "A"), new ButtonSchema(390, 113, controller, "B"), new ButtonSchema(414, 103, controller, "C"), @@ -137,18 +137,9 @@ namespace BizHawk.Client.EmuHawk SecondaryName = $"P{controller} Motion Up / Down", TargetSize = new Size(256, 256) }, - new ButtonSchema(300, 17, controller, "Left Button") - { - DisplayName = "Left" - }, - new ButtonSchema(300, 47, controller, "Middle Button") - { - DisplayName = "Middle" - }, - new ButtonSchema(300, 77, controller, "Right Button") - { - DisplayName = "Right" - }, + new ButtonSchema(300, 17, controller, "Left Button", "Left"), + new ButtonSchema(300, 47, controller, "Middle Button", "Middle"), + new ButtonSchema(300, 77, controller, "Right Button", "Right"), new ButtonSchema(300, 107, controller, "Start") } }; @@ -280,10 +271,7 @@ namespace BizHawk.Client.EmuHawk }, new ButtonSchema(300, 17, controller, "Trigger"), new ButtonSchema(300, 57, controller, "Start"), - new ButtonSchema(300, 290, controller, "Offscreen Shot") - { - DisplayName = "Offscreen" - } + new ButtonSchema(300, 290, controller, "Offscreen Shot", "Offscreen") } }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SmsSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SmsSchema.cs index 0ae2cf9bbd..7f6102800b 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SmsSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SmsSchema.cs @@ -40,11 +40,11 @@ namespace BizHawk.Client.EmuHawk yield return ButtonSchema.Down(14, 56, controller); yield return ButtonSchema.Left(2, 34, controller); yield return ButtonSchema.Right(24, 34, controller); - yield return new ButtonSchema(122, 34, controller, "B1") { DisplayName = "1" }; - yield return new ButtonSchema(146, 34, controller, "B2") { DisplayName = "2" }; + yield return new ButtonSchema(122, 34, controller, "B1", "1"); + yield return new ButtonSchema(146, 34, controller, "B2", "2"); if (!isSms) { - yield return new ButtonSchema(134, 12, controller, "Start") { DisplayName = "S" }; + yield return new ButtonSchema(134, 12, controller, "Start", "S"); } } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs index d4595b8567..b2b0c84a58 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SnesSchema.cs @@ -147,8 +147,8 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Right(44, 39, controller), new ButtonSchema(2, 10, controller, "L"), new ButtonSchema(174, 10, controller, "R"), - new ButtonSchema(70, 39, controller, "Select") { DisplayName = "s" }, - new ButtonSchema(92, 39, controller, "Start") { DisplayName = "S" }, + new ButtonSchema(70, 39, controller, "Select", "s"), + new ButtonSchema(92, 39, controller, "Start", "S"), new ButtonSchema(121, 39, controller, "Y"), new ButtonSchema(145, 52, controller, "B"), new ButtonSchema(122, 15, controller, "X"), @@ -170,14 +170,8 @@ namespace BizHawk.Client.EmuHawk Spec = defAxes.SpecAtIndex(0), SecondarySpec = defAxes.SpecAtIndex(1) }, - new ButtonSchema(275, 15, controller, "Mouse Left") - { - DisplayName = "Left" - }, - new ButtonSchema(275, 45, controller, "Mouse Right") - { - DisplayName = "Right" - } + new ButtonSchema(275, 15, controller, "Mouse Left", "Left"), + new ButtonSchema(275, 45, controller, "Mouse Right", "Right") } }; } diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/VECSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/VECSchema.cs index e54853fd0b..36d4aa8d8c 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/VECSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/VECSchema.cs @@ -81,10 +81,7 @@ namespace BizHawk.Client.EmuHawk private static ButtonSchema Button(int x, int y, int controller, int button) { - return new ButtonSchema(x, y, controller, $"Button {button}") - { - DisplayName = button.ToString() - }; + return new ButtonSchema(x, y, controller, $"Button {button}", button.ToString()); } private static PadSchema ConsoleButtons() diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/WonderSwanSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/WonderSwanSchema.cs index a3ddafb9b2..f66c5c657c 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/WonderSwanSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/WonderSwanSchema.cs @@ -32,7 +32,7 @@ namespace BizHawk.Client.EmuHawk new ButtonSchema(9, 114, controller, "X4"), new ButtonSchema(38, 114, controller, "X2"), new ButtonSchema(23, 136, controller, "X3"), - new ButtonSchema(80, 114, controller, "Start") { DisplayName = "S" }, + new ButtonSchema(80, 114, controller, "Start", "S"), new ButtonSchema(110, 114, controller, "B"), new ButtonSchema(133, 103, controller, "A") } @@ -49,7 +49,7 @@ namespace BizHawk.Client.EmuHawk { new ButtonSchema(23, 12, controller, "A"), new ButtonSchema(46, 22, controller, "B"), - new ButtonSchema(32, 58, controller, "Start") { DisplayName = "S" }, + new ButtonSchema(32, 58, controller, "Start", "S"), new ButtonSchema(23, 112, controller, "Y2"), new ButtonSchema(9, 134, controller, "Y1"), new ButtonSchema(38, 134, controller, "Y3"), diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/ZXSpectrumSchema.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/ZXSpectrumSchema.cs index c4b6d4f94d..d1c25a18c0 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/ZXSpectrumSchema.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/ZXSpectrumSchema.cs @@ -30,10 +30,7 @@ namespace BizHawk.Client.EmuHawk ButtonSchema.Down(23, 36, controller), ButtonSchema.Left(2, 24, controller), ButtonSchema.Right(44, 24, controller), - new ButtonSchema(124, 24, controller, "Button") - { - DisplayName = "B" - } + new ButtonSchema(124, 24, controller, "Button", "B") } }; }