From 5d301b6588bc1a6c334f395063af0b4d663bf192 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Sun, 30 Jul 2023 15:47:56 +0700 Subject: [PATCH] Add setting to hide/disable touch controller (#38) --- better-xcloud.user.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/better-xcloud.user.js b/better-xcloud.user.js index 11d3f3a..3570ade 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -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); }