SteamInput: Add missing API calls for retrieving InputActionOrigins #713
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.