Skip to content

Added support for saving multiple gamepad settings per project#1

Merged
stephentine merged 1 commit into
masterfrom
multi-gamepad-support
Sep 6, 2025
Merged

Added support for saving multiple gamepad settings per project#1
stephentine merged 1 commit into
masterfrom
multi-gamepad-support

Conversation

@stephentine
Copy link
Copy Markdown
Owner

@stephentine stephentine commented Sep 4, 2025

Reason for changes

Multiplayer Scenario
Recently I've been working on a local multiplayer game where you connect two gamepads to control two different players. The current gamepad addon can only save one of those configurations, meaning I have to re-write one configuration every time

Multiple Different Gamepads Scenario
Another issue is that if I have a game where I save a configuration for one type of gamepad (ex. an N64 controller), but I sometimes want to play the game with a different gamepad (ex. a Nintendo Pro Controller), then I need to re-write the 2nd controller's configuration every time

Changes

Saving your gamepad settings now saves every connected gamepad's configuration independently. Whenever you connect a gamepad, it will try to use the configuration that best matches it (it will prefer configurations that match the gamepad's type and index). The index matching handles multiple gamepads of the same type (i.e. in the case of the Multiplayer Scenario above) while the type matching handles multiple different gamepads (i.e. in the case of the other scenario).

If you only ever use one gamepad in a project, then the addon functions exactly the same as it did before these changes. If you had a configuration saved previously (before upgrading to this version), then those settings are kept and will be used for newly connected gamepads

Configuration Selection Logic
When a gamepad is connected, it will perform the following logic to choose its configuration:

If a saved configuration with the same type and index as this gamepad is found, use it
else, if a saved configuration with the same type as this gamepad is found, use it
else, use the configuration that was saved earliest (the oldest one in the project)

Tests

  • Connected two gamepads of the same type and saved unique configurations for each
    • After reconnecting the gamepads, verified that each gamepad picked up its respective configuration
  • Connected two gamepads of different types (ex. Xbox & Nintendo Joy-Con) and saved unique configurations for each
    • After reconnecting the gamepads, verified that each gamepad picked up its respective configuration
  • Saved a setting using the older version of the addon, then upgraded to this version
    • After connecting a new gamepad, verified that the old configuration was used

Tested in Chrome and Edge

@stephentine stephentine changed the title Added support for saving multiple gamepad settings to one project Added support for saving multiple gamepad settings per project Sep 6, 2025
@stephentine stephentine marked this pull request as ready for review September 6, 2025 01:50
@stephentine stephentine merged commit cde73c5 into master Sep 6, 2025
3 checks passed
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.

1 participant