simonoliver / InputSystemActionPrompts

Automatically set controller prompts in text and icons in your Unity game UI.
MIT License
84 stars 10 forks source link

Update method for detecting active device to include mouse movement and gamepad stick movement #10

Open thsbrown opened 1 year ago

thsbrown commented 1 year ago

Overview

Essentially this pr will ensure that our action prompts will change not only when a button is pressed but also when the mouse is moved or gamepad sticks are shifted. This makes for (in my opinion) a much more responsive feeling UI.

Demo

https://github.com/simonoliver/InputSystemActionPrompts/assets/2967721/d6b77609-accc-431a-a82c-4d5466671ff1

simonoliver commented 1 year ago

Thanks, this looks like a great idea - I wonder if its worth generalising this into a list of optional items that will activate a change (eg "GamePad/ButtonPress", "GamePad/AxisMove", "Mouse/Move" etc, allowing them to be enabled/disabled at will in the settings. I know in some cases people play with mouse and joypad for example (using thumbstick on joypad for movement and mouse for look) and you wouldnt want this switching all the time. I wonder if theres a way of generating a list of possible control types from the input system and listing for selection and serialising in the settings?

thsbrown commented 1 year ago

Yeah I had a similar thought, but rather than the specific control I was thinking of having a device list in the settings that you could add or remove to or from that will generate a device change event.

Additionally while I like the idea of getting granular as you said I wonder if getting that granular is overkill?

That said my thoughts were that this was more of a straight up overall improvement on the current setup and the idea above would be an enhancement for a future PR.

I think that this PR would likely be an improvement in the majority of use cases and it's relatively easy to build off of to handle the future PR. This is due to the fact that the OnEvent is generalized to all of the input control types so we can add additional conditions as needed later on.

Let me know what you think 👍.

P.S. As part of this PR I could sneak in the "devices that trigger change event" list in the settings as a sort of middle ground in the interim.

simonoliver commented 11 months ago

Hey just wanted to say sorry for the delay on processing the PR, have been switching over to Unreal and haven't had a lot of free time to review. Will aim to get back to you shortly.