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

Expose Control Expression variables to mappings UI #9581

Merged
merged 1 commit into from May 24, 2021

Conversation

Filoppi
Copy link
Contributor

@Filoppi Filoppi commented Mar 11, 2021

-add a way to reset their value (from the mappings UI)
-fix "memory leak" where they would never be cleaned, one would be created every time you wrote a character after a "$"
-fix ability to create variables with an empty string by just writing "$" (+ added a parsing error for the case)
-add $ operator to the UI operators list, to expose this functionality even more

The UI will now show all the custom variables used.
Their value is kept as long as there is at least one mapping (control expression) referencing them. You can ever change devices or input profile and as long as the variable was and is still referenced, the value will be kept.
Still, the ability to reset values without restarting Dolphin or being forced to change their names can be useful.
UI is always kept to date with the actual values underneath.

The control ref variables were a bit obscure and confusing and hidden away from users, so this should also help with making them aware of the feature.

Tested everything. There should be no negative consequences to this.

Pic is from my work branch, but you can understand what changed:
unknown

@JMC47
Copy link
Contributor

JMC47 commented May 3, 2021

@dolphin-emu-bot rebuild

Copy link
Contributor

@JMC47 JMC47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really say too much about the code, but I went through it and it looked clean. There were a few minor typos. The only one that's probably major is the user facing one.

Source/Core/DolphinQt/Config/Mapping/IOWindow.cpp Outdated Show resolved Hide resolved
Source/Core/DolphinQt/Config/Mapping/IOWindow.cpp Outdated Show resolved Hide resolved
Source/Core/InputCommon/ControllerEmu/ControllerEmu.h Outdated Show resolved Hide resolved
@Filoppi
Copy link
Contributor Author

Filoppi commented May 23, 2021

I can't really say too much about the code, but I went through it and it looked clean. There were a few minor typos. The only one that's probably major is the user facing one.

Fixed all.
Changed custom ref counter to std::shared_ptr, then fixed a potential nullptr access.

@Filoppi Filoppi force-pushed the expose_input_expr_vars branch 2 times, most recently from 7b17e7e to 906cd51 Compare May 23, 2021 23:10
Copy link
Member

@jordan-woyak jordan-woyak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. Untested.

-add a way to reset their value (from the mappings UI)
-fix "memory leak" where they would never be cleaned,
one would be created every time you wrote a character after a "$"
-fix ability to create variables with an empty string by just writing "$" (+added error for it)
-Add $ operator to the UI operators list, to expose this functionality even more
@JMC47 JMC47 merged commit 509b24a into dolphin-emu:master May 24, 2021
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants