From 416307e23ab7f40f45ded502197ed9115ede3053 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Mon, 8 Jul 2024 20:05:20 +0700 Subject: [PATCH] Fix "alwaysShowStreamHud" not working on non-TV devices --- dist/better-xcloud.user.js | 3 ++- src/modules/patcher.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/better-xcloud.user.js b/dist/better-xcloud.user.js index 1b7c703..ab4f35d 100644 --- a/dist/better-xcloud.user.js +++ b/dist/better-xcloud.user.js @@ -5847,7 +5847,8 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { return !1; if (index = str2.indexOf("&&(0,", index - 100), index === -1) return !1; - return str2 = str2.substring(0, index) + "|| true" + str2.substring(index), str2; + const commaIndex = str2.indexOf(",", index - 10); + return str2 = str2.substring(0, commaIndex) + ",true" + str2.substring(index), str2; } }, PATCH_ORDERS = [ ...getPref(PrefKey.NATIVE_MKB_ENABLED) === "on" ? [ diff --git a/src/modules/patcher.ts b/src/modules/patcher.ts index aeff808..5105777 100644 --- a/src/modules/patcher.ts +++ b/src/modules/patcher.ts @@ -759,6 +759,7 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { return str; }, + // game-stream.js 24.16.4 alwaysShowStreamHud(str: string) { let index = str.indexOf(',{onShowStreamMenu:'); if (index === -1) { @@ -770,7 +771,8 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { return false; } - str = str.substring(0, index) + '|| true' + str.substring(index); + const commaIndex = str.indexOf(',', index - 10); + str = str.substring(0, commaIndex) + ',true' + str.substring(index); return str; }, };