Update touch support detection in Remote Play

This commit is contained in:
redphx 2024-02-07 17:35:13 +07:00
parent 4dc60f965f
commit b6b9ec49f6

View File

@ -9068,7 +9068,18 @@ function interceptHttpRequests() {
return promise.then(response => { return promise.then(response => {
return response.clone().json().then(obj => { return response.clone().json().then(obj => {
if (obj[0].supportedTabs.length > 0) { const xboxTitleId = JSON.parse(opts.body).titleIds[0];
GAME_XBOX_TITLE_ID = xboxTitleId;
const inputConfigs = obj[0];
let hasTouchSupport = inputConfigs.supportedTabs.length > 0;
if (!hasTouchSupport) {
const supportedInputTypes = inputConfigs.supportedInputTypes;
hasTouchSupport = supportedInputTypes.includes('NativeTouch');
}
if (hasTouchSupport) {
TouchController.disable(); TouchController.disable();
BxEvent.dispatch(window, BxEvent.CUSTOM_TOUCH_LAYOUTS_LOADED, { BxEvent.dispatch(window, BxEvent.CUSTOM_TOUCH_LAYOUTS_LOADED, {
@ -9076,9 +9087,6 @@ function interceptHttpRequests() {
}); });
} else { } else {
TouchController.enable(); TouchController.enable();
const xboxTitleId = JSON.parse(opts.body).titleIds[0];
GAME_XBOX_TITLE_ID = xboxTitleId;
TouchController.getCustomLayouts(xboxTitleId); TouchController.getCustomLayouts(xboxTitleId);
} }