games.noio.input-hints icon indicating copy to clipboard operation
games.noio.input-hints copied to clipboard

added basic support for input composite bindings

Open PanMadzior opened this issue 7 months ago • 3 comments

Hi! I like this package and find it super helpful for my project. One thing I miss, though, is a convenient way of displaying composite bindings.

Let's say you move with the DPAD on the gamepad and the arrows on the keyboard. Displaying the DPAD icon is as simple as having an icon for the dpad control path. However, for the keyboard, you most likely need a composite binding for Vector2, combining upArrow, downArrow, leftArrow, righArrow. In the current state, this plugin will display only the first keyboard binding it finds - in this case, the icon for upArrow. This is an example of composite binding from my game:

Screenshot 2025-05-03 at 15 28 57

With this PR, I added an option to detect composite bindings and define a special icon if all child bindings match the config. In my scenario, it would display the "all 4 arrows" icon for the keyboard. Example:

Screenshot 2025-05-03 at 15 28 06

As a fallback, if no composite binding icon is found, it would display all individual icons for the binding parts. For example, if the player rebinds the composite binding to the WASD keys, it would display [W][A][S][D]. This is an example for my game, where I changed the upArrow binding to u:

Screenshot 2025-05-03 at 15 26 27

This is how you define special icons for composite bindings. You set all individual parts of the binding and if the action's composite binding matches all those parts, it would display the composite icon.

Screenshot 2025-05-03 at 15 29 15

I don't know if you accept PRs and like this update, but if you do, I would appreciate any feedback or acceptance. The code might need some more testing, as I only tested it for my use case.

Thanks

PanMadzior avatar May 03 '25 14:05 PanMadzior

I would love that feature, I need exactly that in my project ! Thanks for your contribution, and I hope it gets merged soon.

Tyex avatar May 26 '25 10:05 Tyex

Yes! Composite bindings is one thing I’ve been meaning to look at.

Thanks so much for the PR, I’ll look into it and see if it’s something to be merged directly or with some tweaks.

I think your approach is right to use one composite icon and then fallbacks if that’s not found.

Bit busy with game announcement at the moment but I’ll try to make some time after .

On Mon, 26 May 2025 at 13:57, Anto @.***> wrote:

Tyex left a comment (noio/games.noio.input-hints#3) https://github.com/noio/games.noio.input-hints/pull/3#issuecomment-2909315200

I would love that feature, I need exactly that in my project ! Thanks for your contribution, and I hope it gets merged soon.

— Reply to this email directly, view it on GitHub https://github.com/noio/games.noio.input-hints/pull/3#issuecomment-2909315200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACCK4UXUO6H4Y7MTBMV3YT3ALXTJAVCNFSM6AAAAAB4LZCFKCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMBZGMYTKMRQGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

noio avatar May 28 '25 09:05 noio

@PanMadzior Thanks! Works like a charm! Tho I didn't test/use the composite special icons, the simple array of individual icons was enough for me.

STARasGAMES avatar Jul 04 '25 20:07 STARasGAMES