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

NumericSetting: Stop values from binding to numbered input names. #12655

Merged
merged 3 commits into from Apr 12, 2024

Conversation

jordan-woyak
Copy link
Member

@jordan-woyak jordan-woyak commented Mar 21, 2024

The problem:
When the "..." button is clicked, the numeric setting is converted to an input expression. Unfortunately integers are also valid keyboard Input names and get handled by CoalesceExpression.
Despite the expression being 1, the "Sideways Wii Remote" setting turns off, because the keyboard's 1 key is not being pressed..
When the dialog is closed, the expression is correctly converted to a simple true value, but in the meanwhile, it's false, which is especially strange when quickly opening and closing the advanced window.
The Wii Remote Extension setting has the same issue.
image

The solution:
The sign of the value is always included to not match any Input names.
image

Alternatively, instead of always including the + sign, decimal places could be always included, but this is maybe equally weird for integer or boolean settings to appear as 1.0. Opinions?

@jordan-woyak jordan-woyak force-pushed the numeric-setting-fix branch 2 times, most recently from 1f03744 to b6154d7 Compare March 21, 2024 04:10
@Miksel12
Copy link
Contributor

Could true and false be added as keywords? Having to add a + sign to every number in order to differentiate between bindings and integers/bools seems not ideal. Having keywords for bools and decimal points for integers seems like a better solution, though probably more involved.

@jordan-woyak
Copy link
Member Author

Could true and false be added as keywords? Having to add a + sign to every number in order to differentiate between bindings and integers/bools seems not ideal. Having keywords for bools and decimal points for integers seems like a better solution, though probably more involved.

true/false could be added, but they are maybe slightly out of place in the input expression language that effectively only has double values. If 1.0/0.0 is being used for int, I think I'd just as soon also do it for bool.

@AdmiralCurtiss
Copy link
Contributor

Looks like a reasonable workaround to me.

@AdmiralCurtiss AdmiralCurtiss merged commit a445117 into dolphin-emu:master Apr 12, 2024
11 checks passed
@jordan-woyak jordan-woyak deleted the numeric-setting-fix branch April 13, 2024 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants