Add BX_EXPOSED.test_touch_control() for layout testing

This commit is contained in:
redphx 2024-02-09 17:57:25 +07:00
parent 70a8fc9866
commit b07318e07f

View File

@ -3586,6 +3586,24 @@ class TouchController {
}
static setup() {
// Function for testing touch control
window.BX_EXPOSED.test_touch_control = content => {
const { touch_layout_manager } = window.BX_EXPOSED;
touch_layout_manager && touch_layout_manager.changeLayoutForScope({
type: 'showLayout',
scope: '' + GAME_XBOX_TITLE_ID,
subscope: 'base',
layout: {
id: 'System.Standard',
displayName: 'Custom',
layoutFile: {
content: content,
},
},
});
};
const $fragment = document.createDocumentFragment();
const $style = document.createElement('style');
$fragment.appendChild($style);