mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 15:47:18 +02:00
Update better-xcloud.user.js
This commit is contained in:
parent
2e0a59cbe1
commit
7f52479f0a
49
dist/better-xcloud.user.js
vendored
49
dist/better-xcloud.user.js
vendored
@ -190,7 +190,8 @@ var DEFAULT_FLAGS = {
|
|||||||
PreloadUi: false,
|
PreloadUi: false,
|
||||||
EnableXcloudLogging: false,
|
EnableXcloudLogging: false,
|
||||||
SafariWorkaround: true,
|
SafariWorkaround: true,
|
||||||
UseDevTouchLayout: false
|
UseDevTouchLayout: false,
|
||||||
|
ForceNativeMkbTitles: []
|
||||||
};
|
};
|
||||||
var BX_FLAGS = Object.assign(DEFAULT_FLAGS, window.BX_FLAGS || {});
|
var BX_FLAGS = Object.assign(DEFAULT_FLAGS, window.BX_FLAGS || {});
|
||||||
try {
|
try {
|
||||||
@ -3889,6 +3890,8 @@ var BxExposed = {
|
|||||||
let supportedInputTypes = titleInfo.details.supportedInputTypes;
|
let supportedInputTypes = titleInfo.details.supportedInputTypes;
|
||||||
if (getPref(PrefKey.NATIVE_MKB_DISABLED) || UserAgent.isMobile()) {
|
if (getPref(PrefKey.NATIVE_MKB_DISABLED) || UserAgent.isMobile()) {
|
||||||
supportedInputTypes = supportedInputTypes.filter((i) => i !== InputType.MKB);
|
supportedInputTypes = supportedInputTypes.filter((i) => i !== InputType.MKB);
|
||||||
|
} else if (BX_FLAGS.ForceNativeMkbTitles.includes(titleInfo.details.productId)) {
|
||||||
|
supportedInputTypes.push(InputType.MKB);
|
||||||
}
|
}
|
||||||
titleInfo.details.hasMkbSupport = supportedInputTypes.includes(InputType.MKB);
|
titleInfo.details.hasMkbSupport = supportedInputTypes.includes(InputType.MKB);
|
||||||
if (STATES.hasTouchSupport) {
|
if (STATES.hasTouchSupport) {
|
||||||
@ -5533,8 +5536,9 @@ class RemotePlay {
|
|||||||
// src/utils/gamepass-gallery.ts
|
// src/utils/gamepass-gallery.ts
|
||||||
var GamePassCloudGallery;
|
var GamePassCloudGallery;
|
||||||
(function(GamePassCloudGallery2) {
|
(function(GamePassCloudGallery2) {
|
||||||
GamePassCloudGallery2["TOUCH"] = "9c86f07a-f3e8-45ad-82a0-a1f759597059";
|
|
||||||
GamePassCloudGallery2["ALL"] = "29a81209-df6f-41fd-a528-2ae6b91f719c";
|
GamePassCloudGallery2["ALL"] = "29a81209-df6f-41fd-a528-2ae6b91f719c";
|
||||||
|
GamePassCloudGallery2["NATIVE_MKB"] = "8fa264dd-124f-4af3-97e8-596fcdf4b486";
|
||||||
|
GamePassCloudGallery2["TOUCH"] = "9c86f07a-f3e8-45ad-82a0-a1f759597059";
|
||||||
})(GamePassCloudGallery || (GamePassCloudGallery = {}));
|
})(GamePassCloudGallery || (GamePassCloudGallery = {}));
|
||||||
|
|
||||||
// src/utils/network.ts
|
// src/utils/network.ts
|
||||||
@ -5713,6 +5717,18 @@ function interceptHttpRequests() {
|
|||||||
response.json = () => Promise.resolve(obj);
|
response.json = () => Promise.resolve(obj);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
if (BX_FLAGS.ForceNativeMkbTitles && url.includes("catalog.gamepass.com/sigls/") && url.includes(GamePassCloudGallery.NATIVE_MKB)) {
|
||||||
|
const response = await NATIVE_FETCH(request, init);
|
||||||
|
const obj = await response.clone().json();
|
||||||
|
try {
|
||||||
|
const newCustomList = BX_FLAGS.ForceNativeMkbTitles.map((item2) => ({ id: item2 }));
|
||||||
|
obj.push(...newCustomList);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
response.json = () => Promise.resolve(obj);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
let requestType;
|
let requestType;
|
||||||
if (url.includes("/sessions/home") || url.includes("xhome.") || STATES.remotePlay.isPlaying && url.endsWith("/inputconfigs")) {
|
if (url.includes("/sessions/home") || url.includes("xhome.") || STATES.remotePlay.isPlaying && url.endsWith("/inputconfigs")) {
|
||||||
requestType = RequestType.XHOME;
|
requestType = RequestType.XHOME;
|
||||||
@ -5965,11 +5981,17 @@ class XcloudInterceptor {
|
|||||||
let overrides = JSON.parse(obj.clientStreamingConfigOverrides || "{}") || {};
|
let overrides = JSON.parse(obj.clientStreamingConfigOverrides || "{}") || {};
|
||||||
overrides.inputConfiguration = overrides.inputConfiguration || {};
|
overrides.inputConfiguration = overrides.inputConfiguration || {};
|
||||||
overrides.inputConfiguration.enableVibration = true;
|
overrides.inputConfiguration.enableVibration = true;
|
||||||
|
let overrideMkb = null;
|
||||||
if (getPref(PrefKey.NATIVE_MKB_DISABLED) || UserAgent.isMobile()) {
|
if (getPref(PrefKey.NATIVE_MKB_DISABLED) || UserAgent.isMobile()) {
|
||||||
|
overrideMkb = false;
|
||||||
|
} else if (BX_FLAGS.ForceNativeMkbTitles.includes(STATES.currentStream.titleInfo.details.productId)) {
|
||||||
|
overrideMkb = true;
|
||||||
|
}
|
||||||
|
if (overrideMkb !== null) {
|
||||||
overrides.inputConfiguration = Object.assign(overrides.inputConfiguration, {
|
overrides.inputConfiguration = Object.assign(overrides.inputConfiguration, {
|
||||||
enableMouseInput: false,
|
enableMouseInput: overrideMkb,
|
||||||
enableAbsoluteMouse: false,
|
enableAbsoluteMouse: overrideMkb,
|
||||||
enableKeyboardInput: false
|
enableKeyboardInput: overrideMkb
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
overrides.videoConfiguration = overrides.videoConfiguration || {};
|
overrides.videoConfiguration = overrides.videoConfiguration || {};
|
||||||
@ -7311,8 +7333,20 @@ button
|
|||||||
`;
|
`;
|
||||||
if (getPref(PrefKey.BLOCK_SOCIAL_FEATURES)) {
|
if (getPref(PrefKey.BLOCK_SOCIAL_FEATURES)) {
|
||||||
css += `
|
css += `
|
||||||
|
/* Hide "Play with friends" section */
|
||||||
div[class^=HomePage-module__bottomSpacing]:has(button[class*=SocialEmptyCard]),
|
div[class^=HomePage-module__bottomSpacing]:has(button[class*=SocialEmptyCard]),
|
||||||
button[class*=SocialEmptyCard] {
|
button[class*=SocialEmptyCard],
|
||||||
|
/* Hide "Start a party" button in the Guide menu */
|
||||||
|
#gamepass-dialog-root div[class^=AchievementsPreview-module__container] + button[class*=HomeLandingPage-module__button]
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
if (getPref(PrefKey.BLOCK_TRACKING)) {
|
||||||
|
css += `
|
||||||
|
/* Remove Feedback button in the Guide menu */
|
||||||
|
#gamepass-dialog-root #Home-panel button[class*=FeedbackButton] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@ -8502,6 +8536,9 @@ function overridePreloadState() {
|
|||||||
customList = customList.filter((id2) => allGames.includes(id2));
|
customList = customList.filter((id2) => allGames.includes(id2));
|
||||||
sigls[GamePassCloudGallery.TOUCH]?.data.products.push(...customList);
|
sigls[GamePassCloudGallery.TOUCH]?.data.products.push(...customList);
|
||||||
}
|
}
|
||||||
|
if (BX_FLAGS.ForceNativeMkbTitles && GamePassCloudGallery.NATIVE_MKB in sigls) {
|
||||||
|
sigls[GamePassCloudGallery.NATIVE_MKB]?.data.products.push(...BX_FLAGS.ForceNativeMkbTitles);
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
BxLogger.error(LOG_TAG6, e);
|
BxLogger.error(LOG_TAG6, e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user