Commit Graph

37 Commits

Author SHA1 Message Date
YoshiRulz 3decfa5019
Use inheritance instead of Type for PadSchema controls
* Rename ButtonSchema to PadSchemaControl, create ButtonSchema subclass, rename
AnalogSchema to AnalogStickSchema, and make PadSchemaControl abstract
* Replace switching on PadSchemaControl.Type (enum PadInputType) with type
checks
* Refactor and merge VirtualpadTool.CheckPads() into .CreatePads() (it was
easier than just using type checks in the old algorithm)
* Move members from PadSchemaControl to subtypes and cleanup
2020-03-31 21:40:36 +10:00
YoshiRulz 0ba7a5a7df
Rename axis-related types, members, and locals
I left a few methods where they had an equivalent *Bool*() for buttons, and also
left some in TAStudio that get serialised.
2020-03-31 17:29:55 +10:00
adelikat 1f8171fc9b PadSchema - remove MaxSize as it wasn't being used, rename DefaultSize to just Size 2020-03-22 16:23:01 -05:00
adelikat 1b7698aa71 ButtonSchema - simplify UDLR helper methods more 2020-03-22 15:57:43 -05:00
adelikat 828bc2b9dc ButtonSchema - use overloads more 2020-03-22 14:27:12 -05:00
adelikat 7b6ff18775 ButtonSchema - use more constructor overloads to simplify 2020-03-22 14:13:01 -05:00
adelikat 0344b0affb make PadSchema.IsConsole not settable, force the use of inheritance 2020-03-22 12:37:28 -05:00
adelikat ec36ed6206 ButtonSchema - make Type not directly settable and force the use of inheritance to set it 2020-03-22 12:18:47 -05:00
adelikat 2560def438 Virtual Pad - ButtonSchema - make location constructor the only option since location is always required, change param order on Directional helper methods for consistency 2020-03-21 22:24:06 -05:00
adelikat a52c46339e VirtualPad Schema - add some helper methods for creating directional pad buttons, since those are so common 2020-03-21 18:12:26 -05:00
adelikat 4476cc53af VirtualPads - unnest ButtonScehma and PadInputType 2020-03-21 18:12:26 -05:00
adelikat 0ecc1e8023 VirtualPad Schema - default to type Button, and remove now redundant setting of this value 2020-03-21 16:10:01 -05:00
adelikat c1e2f6afe5 VirtualPad Schema - don't show display name if icon is preset, default to Name if displayName is not present (and no icon). Delete a lot of now redundant DisplayName assignments 2020-03-21 15:22:30 -05:00
YoshiRulz e12b5d8137
Refactor FloatRange creation and usage
effectively resolves #1200
* Replaced floats in FloatRange with ints (would have used shorts but
SubGBHawk/SubNesHawk use an axis to hack in cycle count or something), added
both Range<int> and Range<float> auto-properties
* Added bool field IsReversed to FloatRange
* Added enum AxisPairOrientation and factory method using it
* Cleaned up usages of FloatRange fields and properties
* Added new properties to PadSchema.ButtonSchema for type
PadInputType.AnalogStick (to hold the two FloatRanges) and used
ControllerDefinitions from cores to dedup these ranges in the schemata
* Made VirtualPadAnalogStick work properly: both the direction and bounds are
correctly set from the controller schemata, the polar conversion measures angles
consistently (though I think it might not work outside -128..127 e.g. for PSX),
and I didn't break the sensitivity override, plus negative percentages might
work now but I didn't allow those
* Renamed FloatRange to AxisRange, but did not rename related symbols
2020-03-14 20:47:45 +10:00
adelikat b390c2829c cleanup virtualpad code 2019-12-31 11:36:22 -06:00
YoshiRulz e6374ef477
Use string interpolation 2019-03-19 00:06:37 +10:00
adelikat 5d855ef60b more attribute renaming 2017-07-12 14:40:10 -05:00
adelikat 50b5f4a1a9 Virtualpad misc cleanups 2017-05-24 09:07:03 -05:00
adelikat 436a853c96 Fix typo - Scema -> Schema 2017-04-29 15:41:27 -05:00
adelikat f1e528f68f Virtual pads - pass the current core into schema objects instead of using Global.Emulator 2016-12-05 19:33:21 -06:00
Hathor86 f145f3cc68 Polar Coord
- Add polar coordinates to VirtualPadAnalogStick
- Update N64 pad Schema as VirtualPadAnalogStick is a bit larger
- Add Clamp method to NumberExtensions (allows a IComparable<T> value to be restriced between 2 specified other values)
2016-01-23 22:56:41 +01:00
zeromus 0787a3be47 rework virtual pad analog widget to support n64 and psx simultaneously 2015-07-19 21:46:52 -05:00
jlennox a64017366c Create ISettable<T,T2>/ISettable interfaces. This checkin has not been extensively tested. 2014-10-19 01:22:47 +00:00
adelikat 546b3f3e19 a slight work around for N64 virtualpad, a button will be the default focused widget now instead of the numeric, which avoids the "ding" problem by default (if they focus onto a numeric it will happen of course, but at least it doesn't start in this state) 2014-07-27 14:16:12 +00:00
adelikat 9469f5ac80 Virtualpads - N64 - change the positioning of buttons to better resemble a real n64 controller 2014-07-27 14:08:39 +00:00
adelikat 6039b921d2 add Yellow arrows to project and use them for the N64 C buttons 2014-07-27 13:53:25 +00:00
adelikat 7881775d59 Fix N64 virtualpad 2014-07-21 00:41:19 +00:00
adelikat 38b76ea5d9 fix N64 dpad mnemonics and virtualpad buttons, fix pce and snes virtualpad buttons 2014-06-29 13:05:10 +00:00
adelikat ee6d73aac7 Virtualpads - some code cleanup 2014-06-29 03:14:40 +00:00
adelikat 75d4ff5117 Virtualpads - refactor schema objects to return a PadSchema collection instead of Virtualpad collection, and create the pads in the calling code 2014-06-27 17:02:46 +00:00
adelikat 4d9f46c6a1 Implement read-only for VirtualPadButton 2014-06-25 20:40:20 +00:00
adelikat 5f71bf11c8 N64 - dynamically generate buttons in controller definition based on connected controllers, Virtualpads - show pads based on connected controllers 2014-06-25 02:18:11 +00:00
adelikat bb93dd0d42 Virtualpads - make a custom attribute for schema objects instead of using the Description attribute 2014-06-23 23:46:44 +00:00
xmikecampx7 886681bb9d Schema GamePads Added 2014-06-23 14:13:07 +00:00
xmikecampx7 20200adf3a Adding Buttons to Schemas 2014-06-23 01:43:33 +00:00
adelikat a248e2d99b Virtual Pads - analog stick should be done now (including max X,Y constraints) 2014-06-22 17:41:13 +00:00
adelikat 2009e07e35 Virtualpads - Some Progress 2014-06-22 15:43:45 +00:00