mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37:19 +02:00
Add ability to use normal website's layout on TV
This commit is contained in:
parent
7588f37472
commit
8a7be5d523
@ -67,14 +67,15 @@ const PATCHES = {
|
||||
return str.replace(text, text + 'return;');
|
||||
},
|
||||
|
||||
// Set TV layout
|
||||
tvLayout(str: string) {
|
||||
// Set custom website layout
|
||||
websiteLayout(str: string) {
|
||||
const text = '?"tv":"default"';
|
||||
if (!str.includes(text)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return str.replace(text, '?"tv":"tv"');
|
||||
const layout = getPref(PrefKey.UI_LAYOUT) === 'tv' ? 'tv' : 'default';
|
||||
return str.replace(text, `?"${layout}":"${layout}"`);
|
||||
},
|
||||
|
||||
// Replace "/direct-connect" with "/play"
|
||||
@ -465,7 +466,7 @@ let PATCH_ORDERS: PatchArray = [
|
||||
'overrideSettings',
|
||||
'broadcastPollingMode',
|
||||
|
||||
getPref(PrefKey.UI_LAYOUT) === 'tv' && 'tvLayout',
|
||||
getPref(PrefKey.UI_LAYOUT) !== 'default' && 'websiteLayout',
|
||||
getPref(PrefKey.LOCAL_CO_OP_ENABLED) && 'supportLocalCoOp',
|
||||
getPref(PrefKey.GAME_FORTNITE_FORCE_CONSOLE) && 'forceFortniteConsole',
|
||||
|
||||
|
@ -417,6 +417,7 @@ export class Preferences {
|
||||
default: 'default',
|
||||
options: {
|
||||
default: t('default'),
|
||||
normal: t('normal'),
|
||||
tv: t('smart-tv'),
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user