From d7ed9e1603dc64b6bdc7a97c0d3ed06c3a1283a2 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Sun, 7 Jul 2024 16:14:08 +0700 Subject: [PATCH] Add "ignorePlayWithFriendsSection" patch --- src/modules/patcher.ts | 18 ++++++++++++++++++ src/modules/ui/global-settings.ts | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/modules/patcher.ts b/src/modules/patcher.ts index 8e4f662..8c88bc0 100644 --- a/src/modules/patcher.ts +++ b/src/modules/patcher.ts @@ -703,6 +703,22 @@ true` + text; str = str.substring(0, index) + '|| true' + str.substring(index); return str; }, + + // Don't render Play With Friends sections + ignorePlayWithFriendsSection(str: string) { + let index = str.indexOf('location:"PlayWithFriendsRow",'); + if (index === -1) { + return false; + } + + index = str.indexOf('return', index - 50); + if (index === -1) { + return false; + } + + str = str.substring(0, index) + 'return null;' + str.substring(index + 6); + return str; + } }; let PATCH_ORDERS: PatchArray = [ @@ -728,6 +744,8 @@ let PATCH_ORDERS: PatchArray = [ getPref(PrefKey.LOCAL_CO_OP_ENABLED) && 'supportLocalCoOp', getPref(PrefKey.GAME_FORTNITE_FORCE_CONSOLE) && 'forceFortniteConsole', + getPref(PrefKey.BLOCK_SOCIAL_FEATURES) && 'ignorePlayWithFriendsSection', + ...(getPref(PrefKey.BLOCK_TRACKING) ? [ 'disableAiTrack', 'disableTelemetry', diff --git a/src/modules/ui/global-settings.ts b/src/modules/ui/global-settings.ts index 0a52c97..42d2b28 100644 --- a/src/modules/ui/global-settings.ts +++ b/src/modules/ui/global-settings.ts @@ -95,12 +95,12 @@ const SETTINGS_UI = { !AppInterface && PrefKey.UI_SCROLLBAR_HIDE, PrefKey.HIDE_DOTS_ICON, PrefKey.REDUCE_ANIMATIONS, + PrefKey.BLOCK_SOCIAL_FEATURES, ], }, [t('other')]: { items: [ - PrefKey.BLOCK_SOCIAL_FEATURES, PrefKey.BLOCK_TRACKING, ], },