diff --git a/dist/better-xcloud.lite.user.js b/dist/better-xcloud.lite.user.js index 48ab793..4339c6b 100644 --- a/dist/better-xcloud.lite.user.js +++ b/dist/better-xcloud.lite.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Better xCloud (Lite) // @namespace https://github.com/redphx -// @version 5.9.5 +// @version 5.9.6-beta // @description Improve Xbox Cloud Gaming (xCloud) experience // @author redphx // @license MIT @@ -105,7 +105,7 @@ class UserAgent { }); } } -var SCRIPT_VERSION = "5.9.5", SCRIPT_VARIANT = "lite", AppInterface = window.AppInterface; +var SCRIPT_VERSION = "5.9.6-beta", SCRIPT_VARIANT = "lite", AppInterface = window.AppInterface; UserAgent.init(); var userAgent = window.navigator.userAgent.toLowerCase(), isTv = userAgent.includes("smart-tv") || userAgent.includes("smarttv") || /\baft.*\b/.test(userAgent), isVr = window.navigator.userAgent.includes("VR") && window.navigator.userAgent.includes("OculusBrowser"), browserHasTouchSupport = "ontouchstart" in window || navigator.maxTouchPoints > 0, userAgentHasTouchSupport = !isTv && !isVr && browserHasTouchSupport, supportMkb = AppInterface || !userAgent.match(/(android|iphone|ipad)/), STATES = { supportedRegion: !0, diff --git a/dist/better-xcloud.user.js b/dist/better-xcloud.user.js index 910f4c5..0a31986 100644 --- a/dist/better-xcloud.user.js +++ b/dist/better-xcloud.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Better xCloud // @namespace https://github.com/redphx -// @version 5.9.5 +// @version 5.9.6-beta // @description Improve Xbox Cloud Gaming (xCloud) experience // @author redphx // @license MIT @@ -107,7 +107,7 @@ class UserAgent { }); } } -var SCRIPT_VERSION = "5.9.5", SCRIPT_VARIANT = "full", AppInterface = window.AppInterface; +var SCRIPT_VERSION = "5.9.6-beta", SCRIPT_VARIANT = "full", AppInterface = window.AppInterface; UserAgent.init(); var userAgent = window.navigator.userAgent.toLowerCase(), isTv = userAgent.includes("smart-tv") || userAgent.includes("smarttv") || /\baft.*\b/.test(userAgent), isVr = window.navigator.userAgent.includes("VR") && window.navigator.userAgent.includes("OculusBrowser"), browserHasTouchSupport = "ontouchstart" in window || navigator.maxTouchPoints > 0, userAgentHasTouchSupport = !isTv && !isVr && browserHasTouchSupport, supportMkb = AppInterface || !userAgent.match(/(android|iphone|ipad)/), STATES = { supportedRegion: !0, @@ -4399,9 +4399,9 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { }, guideAchievementsDefaultLocked(str) { let index = str.indexOf("FilterButton-module__container"); - if (index >= 0 && (index = PatcherUtils.lastIndexOf(str, ".All", index, 150)), index < 0) return !1; - if (str = PatcherUtils.replaceWith(str, index, ".All", ".Locked"), index = str.indexOf('"Guide_Achievements_Unlocked_Empty","Guide_Achievements_Locked_Empty"'), index >= 0 && (index = PatcherUtils.indexOf(str, ".All", index, 250)), index < 0) return !1; - return str = PatcherUtils.replaceWith(str, index, ".All", ".Locked"), str; + if (index >= 0 && (index = PatcherUtils.lastIndexOf(str, '"All"', index, 150)), index < 0) return !1; + if (str = PatcherUtils.replaceWith(str, index, '"All"', '"Locked"'), index = str.indexOf('"Guide_Achievements_Unlocked_Empty","Guide_Achievements_Locked_Empty"'), index >= 0 && (index = PatcherUtils.indexOf(str, '"All"', index, 250)), index < 0) return !1; + return str = PatcherUtils.replaceWith(str, index, '"All"', '"Locked"'), str; }, disableTouchContextMenu(str) { let index = str.indexOf('"ContextualCardActions-module__container'); diff --git a/src/modules/patcher.ts b/src/modules/patcher.ts index 6054ce4..e382711 100644 --- a/src/modules/patcher.ts +++ b/src/modules/patcher.ts @@ -942,20 +942,20 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { // Set Achievements list's filter default to "Locked" guideAchievementsDefaultLocked(str: string) { let index = str.indexOf('FilterButton-module__container'); - index >= 0 && (index = PatcherUtils.lastIndexOf(str, '.All', index, 150)); + index >= 0 && (index = PatcherUtils.lastIndexOf(str, '"All"', index, 150)); if (index < 0) { return false; } - str = PatcherUtils.replaceWith(str, index, '.All', '.Locked'); + str = PatcherUtils.replaceWith(str, index, '"All"', '"Locked"'); index = str.indexOf('"Guide_Achievements_Unlocked_Empty","Guide_Achievements_Locked_Empty"'); - index >= 0 && (index = PatcherUtils.indexOf(str, '.All', index, 250)); + index >= 0 && (index = PatcherUtils.indexOf(str, '"All"', index, 250)); if (index < 0) { return false; } - str = PatcherUtils.replaceWith(str, index, '.All', '.Locked'); + str = PatcherUtils.replaceWith(str, index, '"All"', '"Locked"'); return str; },