Fix - Gamepad support setting "lost focus" behaviour (#658)

* fix "lost focus behaviour" when disabling gamepad and thus repeating RIGHT key

* added some comment

* added full TSDoc, helped by chatGPT, refined every entry manually of course
This commit is contained in:
Greenlamp2 authored and GitHub committed 2024-05-10 09:26:45 -04:00
1 parent 6fbc0cb923
commit 22a73642df
3 files changed
+296 -22

No files matched your search

+3 -1
View File
@@ -149,7 +149,9 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
return false;
break;
case Setting.Gamepad_Support:
scene.gamepadSupport = settingOptions[setting][value] !== 'Disabled';
// if we change the value of the gamepad support, we call a method in the inputController to
// activate or deactivate the controller listener
scene.inputController.setGamepadSupport(settingOptions[setting][value] !== 'Disabled');
break;
case Setting.Swap_A_and_B:
scene.abSwapped = settingOptions[setting][value] !== 'Disabled';