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

Open
wants to merge 1 commit into
base: master
from

Conversation

@jordan-woyak
Copy link
Member

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.

@jordan-woyak jordan-woyak force-pushed the jordan-woyak:setting-expressions branch from 675e0e5 to 3ebb3b6 Oct 19, 2019
@jordan-woyak jordan-woyak force-pushed the jordan-woyak:setting-expressions branch from 3ebb3b6 to 6d7ad21 Oct 19, 2019
@Miksel12

This comment has been minimized.

Copy link
Contributor

Miksel12 commented Oct 20, 2019

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

This comment has been minimized.

Copy link
Member Author

jordan-woyak commented Oct 20, 2019

@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 jordan-woyak:setting-expressions branch 2 times, most recently from 3025c03 to 9597421 Oct 20, 2019
@jordan-woyak jordan-woyak force-pushed the jordan-woyak:setting-expressions branch from 9597421 to a77a2e0 Oct 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.