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;');
|
return str.replace(text, text + 'return;');
|
||||||
},
|
},
|
||||||
|
|
||||||
// Set TV layout
|
// Set custom website layout
|
||||||
tvLayout(str: string) {
|
websiteLayout(str: string) {
|
||||||
const text = '?"tv":"default"';
|
const text = '?"tv":"default"';
|
||||||
if (!str.includes(text)) {
|
if (!str.includes(text)) {
|
||||||
return false;
|
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"
|
// Replace "/direct-connect" with "/play"
|
||||||
@ -465,7 +466,7 @@ let PATCH_ORDERS: PatchArray = [
|
|||||||
'overrideSettings',
|
'overrideSettings',
|
||||||
'broadcastPollingMode',
|
'broadcastPollingMode',
|
||||||
|
|
||||||
getPref(PrefKey.UI_LAYOUT) === 'tv' && 'tvLayout',
|
getPref(PrefKey.UI_LAYOUT) !== 'default' && 'websiteLayout',
|
||||||
getPref(PrefKey.LOCAL_CO_OP_ENABLED) && 'supportLocalCoOp',
|
getPref(PrefKey.LOCAL_CO_OP_ENABLED) && 'supportLocalCoOp',
|
||||||
getPref(PrefKey.GAME_FORTNITE_FORCE_CONSOLE) && 'forceFortniteConsole',
|
getPref(PrefKey.GAME_FORTNITE_FORCE_CONSOLE) && 'forceFortniteConsole',
|
||||||
|
|
||||||
|
@ -417,6 +417,7 @@ export class Preferences {
|
|||||||
default: 'default',
|
default: 'default',
|
||||||
options: {
|
options: {
|
||||||
default: t('default'),
|
default: t('default'),
|
||||||
|
normal: t('normal'),
|
||||||
tv: t('smart-tv'),
|
tv: t('smart-tv'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user