Add setting to hide/disable touch controller (#38)

This commit is contained in:
redphx 2023-07-30 15:47:56 +07:00
parent 32123a7891
commit 5d301b6588

View File

@ -370,6 +370,7 @@ class Preferences {
static get USE_DESKTOP_CODEC() { return 'use_desktop_codec'; }
static get USER_AGENT_PROFILE() { return 'user_agent_profile'; }
static get USER_AGENT_CUSTOM() { return 'user_agent_custom'; }
static get STREAM_HIDE_TOUCH_CONTROLLER() { return 'stream_hide_touch_controller'; }
static get SCREENSHOT_BUTTON_POSITION() { return 'screenshot_button_position'; }
static get BLOCK_TRACKING() { return 'block_tracking'; }
@ -477,6 +478,10 @@ class Preferences {
'label': 'Hide Dots icon while playing',
'default': false,
},
[Preferences.STREAM_HIDE_TOUCH_CONTROLLER]: {
'label': 'Disable touch controller',
'default': false,
},
[Preferences.HIDE_IDLE_CURSOR]: {
'label': 'Hide mouse cursor while playing',
'default': false,
@ -1184,6 +1189,15 @@ div[class*=StreamHUD-module__buttonsContainer] {
`;
}
// Hide touch controller
if (PREFS.get(Preferences.STREAM_HIDE_TOUCH_CONTROLLER)) {
css += `
#MultiTouchSurface, #BabylonCanvasContainer-main {
display: none !important;
}
`;
}
const $style = createElement('style', {}, css);
document.documentElement.appendChild($style);
}