From 8286429cc316c5b5f86a64e60dd3b71faa747618 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:12:15 +0700 Subject: [PATCH] Add "patchStreamHud" patch --- better-xcloud.user.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/better-xcloud.user.js b/better-xcloud.user.js index 97e672a..9d199ac 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -8249,6 +8249,22 @@ if (gamepadFound) { funcStr = funcStr.replace(text, 'this.useCombinedAudioVideoStream=true'); return funcStr; }, + + patchStreamHud: function(funcStr) { + const text = 'let{onCollapse'; + if (!funcStr.includes(text)) { + return false; + } + + // Restore the "..." button + funcStr = funcStr.replace(text, 'e.guideUI = null;' + text); + + // Remove the TAK Edit button when the touch controller is disabled + if (getPref(Preferences.STREAM_TOUCH_CONTROLLER) === 'off') { + funcStr = funcStr.replace(text, 'e.canShowTakHUD = false;' + text); + } + return funcStr; + }, }; static #PATCH_ORDERS = [ @@ -8291,6 +8307,8 @@ if (gamepadFound) { getPref(Preferences.REMOTE_PLAY_ENABLED) && ['remotePlayConnectMode'], getPref(Preferences.REMOTE_PLAY_ENABLED) && ['remotePlayGuideWorkaround'], + ['patchStreamHud'], + ['playVibration'], HAS_TOUCH_SUPPORT && getPref(Preferences.STREAM_TOUCH_CONTROLLER) === 'all' && ['exposeTouchLayoutManager'], HAS_TOUCH_SUPPORT && (getPref(Preferences.STREAM_TOUCH_CONTROLLER) === 'off' || getPref(Preferences.STREAM_TOUCH_CONTROLLER_AUTO_OFF)) && ['disableTakRenderer'],