Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputCommon: Allow controller settings specified with input expresions. #8417

Merged
merged 2 commits into from Feb 9, 2020

Conversation

jordan-woyak
Copy link
Member

@jordan-woyak jordan-woyak commented Oct 19, 2019

I've added the ability for input expressions to be used for the values of controller settings.
This is an extension of functionality. Existing configurations remain valid.

A common use would be a button that adjusts the speed of emulated Wii Remote Tilt/Swing but the possibilities are as endless as our button mappings.

With the new toggle() function added in PR #7663 this provides a generic solution to the sideways/upright hotkeys and the "Relative Input Hold" mapping.
I plan on removing these in another PR with backwards compatibility by adapting them into these new "setting expressions".

Demonstration:
https://giant.gfycat.com/CompassionateAlienatedBobolink.webm
(controller icon has since been moved to the right of the spin-button text)

A button to the right of each setting opens the familiar advanced mapping dialog.
When an expression is in use the spin-button/checkbox is updated with the other indicators and a controller symbol is shown to signify the setting has a dynamic value, potentially supplied by user input.
Directly entering a value or checking a box will remove/disable an expression.

Edit: Rebase and added ability to set Wii remote extension with an input expression. This will be useful to "pass through" the attached extension with "Real Wii Remotes in Controller Interface".

@Miksel12
Copy link
Contributor

I did some tests and found that the 'Range' option is acting weird. When using value from 2 to 9 on a checkbox, it keeps the box unchecked and adjusting range does nothing. Value 10 leaves the box unchecked for 'Range' values under 6 and a value of 20 leaves it unchecked under 'Range' values of 3. Values between 10 and 50 show this weird behaviour. 0 and 1 also show different behaviour but that is probably because of their boolean meaning.

Small nit, I think having the controller icon on the right side in the numeric fields would look better

@jordan-woyak
Copy link
Member Author

@Miksel12 "Range" has always been a misnamed percentage scalar and I plan on removing it at some point now that the multiplication operator exists.
Boolean options (checkboxes) are enabled when the expression's result is greater than 0.5 (The same way regular button mappings work). Your testing of ranges and values makes sense based on this.

I agree about the controller icon being on the right. I'll change it.

@jordan-woyak jordan-woyak force-pushed the setting-expressions branch 2 times, most recently from 3025c03 to 9597421 Compare October 20, 2019 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants