Disable achievement toast in Remote Play

This commit is contained in:
redphx 2024-05-03 17:17:00 +07:00
parent db1ce23b53
commit 3d3a013a5c

View File

@ -115,6 +115,22 @@ const PATCHES = {
return str.replace(text, `connectMode:window.BX_REMOTE_PLAY_CONFIG?"xhome-connect":"cloud-connect",remotePlayServerId:(window.BX_REMOTE_PLAY_CONFIG&&window.BX_REMOTE_PLAY_CONFIG.serverId)||''`);
},
// Disable achievement toast in Remote Play
remotePlayDisableAchievementToast(str: string) {
const text = '.AchievementUnlock:{';
if (!str.includes(text)) {
return false;
}
const newCode = `
if (!!window.BX_REMOTE_PLAY_CONFIG) {
return;
}
`;
return str.replace(text, text + newCode);
},
// Disable trackEvent() function
disableTrackEvent(str: string) {
const text = 'this.trackEvent=';
@ -467,6 +483,7 @@ let PATCH_ORDERS: PatchArray = [
...(getPref(PrefKey.REMOTE_PLAY_ENABLED) ? [
'remotePlayKeepAlive',
'remotePlayDirectConnectUrl',
'remotePlayDisableAchievementToast',
STATES.hasTouchSupport && 'patchUpdateInputConfigurationAsync',
] : []),