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

SteamInput: Add missing API calls for retrieving InputActionOrigins #713

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Gibibit
Copy link

@Gibibit Gibibit commented Apr 11, 2023

Justification

In order to display your own controller glyphs when using Steam Input, you need to be able to retrieve the action origins. Currently you can only display the default Steam glyphs which are fine as a fallback or default, but not customizable.

In addition, Valve recommends you keep retrieving the action origins to check whether they have changed. When this happens you have to update your cached glyphs. Without these added calls that's not possible to do.

Unit Test

I attempted to write a unit test to test these new functions but... Steam Input just doesn't work when it's not running in a standalone proces I think. The Steam Input unit tests that are already in the project don't really test anything either. Did manage to test it in a built Unity project. Here's a gist of my attempts if anyone knows how to get it to work: https://gist.github.com/Gibibit/d32af10629986a4b3737c0d1117e5345 . Make sure to update the app id to something that has a locally configured controller in your steam install /controller_config dir.

Please let me know if there's any issues with the PR or code, I'll be happy to clean it up. I added some comments to existing struct fields as well. If those are unwanted I'll revert it.

…mentation for retrieving both analog and digital glyphs using information from the official docs.
…ngly to do this automatically in the future

InputActionOrigin is required on the user side so the user can check whether the action origin has changed. This is cheaper than continuously requesting the action glyph. In addition the user requires the action origin to be able to supply their own icons.
…nt confusiong between the Pressed and Active values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant