Allow controlling settings using gamepad

This commit is contained in:
redphx
2024-07-16 21:52:44 +07:00
parent 2a0af5d0ab
commit 64568532cb
5 changed files with 129 additions and 1 deletions

View File

@@ -452,6 +452,17 @@ BxEvent.dispatch(window, BxEvent.XCLOUD_POLLING_MODE_CHANGED, {mode: e});
return str;
},
patchGamepadPolling(str: string) {
let index = str.indexOf('.shouldHandleGamepadInput)())return void');
if (index === -1) {
return false;
}
index = str.indexOf('{', index - 20) + 1;
str = str.substring(0, index) + 'if (window.BX_EXPOSED.disableGamepadPolling) return;' + str.substring(index);
return str;
},
patchXcloudTitleInfo(str: string) {
const text = 'async cloudConnect';
let index = str.indexOf(text);
@@ -803,6 +814,7 @@ let PATCH_ORDERS: PatchArray = [
'disableStreamGate',
'overrideSettings',
'broadcastPollingMode',
getPref(PrefKey.UI_CONTROLLER_FRIENDLY) && 'patchGamepadPolling',
'exposeStreamSession',
'exposeDialogRoutes',