resir014 / TMViz

Web-based controller visualisation widget for TrackMania.

Home Page:https://tmviz.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Potential issue when storing gamepad by index with 2 or more gamepads

resir014 opened this issue · comments

Description

There's a potential issue with how we currently store the gamepad index config. If the controller is plugged in out of order the overlay settings might be out of sync.

Current Settings

Any default settings with controllerIndex set to 0.

Additional Information

Reproduction steps:

  • Make sure both gamepads are plugged in, then on the customiser pick the first controller on the list.
  • Test if overlay works.
  • If works, unplug both controllers, then plug them back in, but plug the previously-used controller last.
  • Refresh the customiser, don't change any settings, then test the overlay.

After much consideration, the decision is made to remove the controller options for now, as there is no possible way to ensure that the OS will detect controllers in the right order after a restart.

We will change the gamepads context so that any controllers that are plugged in are added to the context value in an incrementing manner. This means only the most-recently connected controller will work with the overlay.