PIXI Controls: Change virtual gamepad index

This commit is contained in:
OleSTEEP 2024-02-08 17:20:20 +03:00
parent e544037d3c
commit a673524ec3
2 changed files with 3 additions and 2 deletions

View file

@ -4245,7 +4245,7 @@ var $plugins = [
{
"zIndex": 1488,
"gamepadId": "Xbox Wireless Controller (STANDARD GAMEPAD Vendor: 045e Product: 02e0)",
"gamepadIndex": 0,
"gamepadIndex": 1,
"buttonsScale": 1.2,
"buttonsOpacity": 0.8
}

View file

@ -324,7 +324,8 @@ VirtualGamepad.gamepad = {
VirtualGamepad.replaceNavigator = function() {
var gamepads = navigator.getGamepads();
navigator.getGamepads = function() {
gamepads[0] = VirtualGamepad.gamepad;
var index = ONSControls.options.gamepadIndex;
gamepads[index] = VirtualGamepad.gamepad;
return gamepads;
}
}