mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 23:57:19 +02:00
Rename "touchLayoutManager" and "testTouchLayout"
This commit is contained in:
parent
26bf14eda6
commit
500f6671c6
@ -285,7 +285,7 @@ if (window.BX_VIBRATION_INTENSITY && window.BX_VIBRATION_INTENSITY < 1) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
str = str.replace(text, 'window.BX_EXPOSED["touch_layout_manager"] = this,' + text);
|
str = str.replace(text, 'window.BX_EXPOSED["touchLayoutManager"] = this,' + text);
|
||||||
return str;
|
return str;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ export class TouchController {
|
|||||||
retries = retries || 1;
|
retries = retries || 1;
|
||||||
if (retries > 2) {
|
if (retries > 2) {
|
||||||
TouchController.#customLayouts[xboxTitleId] = null;
|
TouchController.#customLayouts[xboxTitleId] = null;
|
||||||
// Wait for BX_EXPOSED.touch_layout_manager
|
// Wait for BX_EXPOSED.touchLayoutManager
|
||||||
window.setTimeout(() => TouchController.#dispatchLayouts(null), 1000);
|
window.setTimeout(() => TouchController.#dispatchLayouts(null), 1000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ export class TouchController {
|
|||||||
json.layouts = layouts;
|
json.layouts = layouts;
|
||||||
TouchController.#customLayouts[xboxTitleId] = json;
|
TouchController.#customLayouts[xboxTitleId] = json;
|
||||||
|
|
||||||
// Wait for BX_EXPOSED.touch_layout_manager
|
// Wait for BX_EXPOSED.touchLayoutManager
|
||||||
window.setTimeout(() => TouchController.#dispatchLayouts(json), 1000);
|
window.setTimeout(() => TouchController.#dispatchLayouts(json), 1000);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Retry
|
// Retry
|
||||||
@ -148,7 +148,7 @@ export class TouchController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static loadCustomLayout(xboxTitleId: string, layoutId: string, delay: number=0) {
|
static loadCustomLayout(xboxTitleId: string, layoutId: string, delay: number=0) {
|
||||||
if (!window.BX_EXPOSED.touch_layout_manager) {
|
if (!window.BX_EXPOSED.touchLayoutManager) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ export class TouchController {
|
|||||||
layoutChanged && Toast.show(msg, layout.name, {html: html});
|
layoutChanged && Toast.show(msg, layout.name, {html: html});
|
||||||
|
|
||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
window.BX_EXPOSED.touch_layout_manager.changeLayoutForScope({
|
window.BX_EXPOSED.touchLayoutManager.changeLayoutForScope({
|
||||||
type: 'showLayout',
|
type: 'showLayout',
|
||||||
scope: xboxTitleId,
|
scope: xboxTitleId,
|
||||||
subscope: 'base',
|
subscope: 'base',
|
||||||
@ -208,10 +208,10 @@ export class TouchController {
|
|||||||
|
|
||||||
static setup() {
|
static setup() {
|
||||||
// Function for testing touch control
|
// Function for testing touch control
|
||||||
window.BX_EXPOSED.test_touch_control = (layout: any) => {
|
(window as any).testTouchLayout = (layout: any) => {
|
||||||
const { touch_layout_manager } = window.BX_EXPOSED;
|
const { touchLayoutManager } = window.BX_EXPOSED;
|
||||||
|
|
||||||
touch_layout_manager && touch_layout_manager.changeLayoutForScope({
|
touchLayoutManager && touchLayoutManager.changeLayoutForScope({
|
||||||
type: 'showLayout',
|
type: 'showLayout',
|
||||||
scope: '' + STATES.currentStream?.xboxTitleId,
|
scope: '' + STATES.currentStream?.xboxTitleId,
|
||||||
subscope: 'base',
|
subscope: 'base',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user