mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37:19 +02:00
Allow hiding BYOG section
This commit is contained in:
parent
66b1f92f4c
commit
d4f070f6bb
9
dist/better-xcloud.pretty.user.js
vendored
9
dist/better-xcloud.pretty.user.js
vendored
File diff suppressed because one or more lines are too long
8
dist/better-xcloud.user.js
vendored
8
dist/better-xcloud.user.js
vendored
File diff suppressed because one or more lines are too long
@ -762,6 +762,18 @@ true` + text;
|
|||||||
return str;
|
return str;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
ignoreByogSection(str: string) {
|
||||||
|
let index = str.indexOf('"ByogRow-module__container');
|
||||||
|
index > -1 && (index = PatcherUtils.lastIndexOf(str, 'return', index, 100));
|
||||||
|
|
||||||
|
if (index < 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
str = PatcherUtils.insertAt(str, index, 'return null;');
|
||||||
|
return str;
|
||||||
|
},
|
||||||
|
|
||||||
// home-page.js
|
// home-page.js
|
||||||
ignorePlayWithTouchSection(str: string) {
|
ignorePlayWithTouchSection(str: string) {
|
||||||
let index = str.indexOf('("Play_With_Touch"),');
|
let index = str.indexOf('("Play_With_Touch"),');
|
||||||
@ -1207,6 +1219,8 @@ let HOME_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches([
|
|||||||
hideSections.includes(UiSection.FRIENDS) && 'ignorePlayWithFriendsSection',
|
hideSections.includes(UiSection.FRIENDS) && 'ignorePlayWithFriendsSection',
|
||||||
hideSections.includes(UiSection.ALL_GAMES) && 'ignoreAllGamesSection',
|
hideSections.includes(UiSection.ALL_GAMES) && 'ignoreAllGamesSection',
|
||||||
hideSections.includes(UiSection.GENRES) && 'ignoreGenresSection',
|
hideSections.includes(UiSection.GENRES) && 'ignoreGenresSection',
|
||||||
|
!getGlobalPref(GlobalPref.BLOCK_FEATURES).includes(BlockFeature.BYOG) && hideSections.includes(UiSection.BOYG) && 'ignoreByogSection',
|
||||||
|
|
||||||
STATES.browser.capabilities.touch && hideSections.includes(UiSection.TOUCH) && 'ignorePlayWithTouchSection',
|
STATES.browser.capabilities.touch && hideSections.includes(UiSection.TOUCH) && 'ignorePlayWithTouchSection',
|
||||||
hideSections.some(value => [UiSection.NATIVE_MKB, UiSection.MOST_POPULAR].includes(value)) && 'ignoreSiglSections',
|
hideSections.some(value => [UiSection.NATIVE_MKB, UiSection.MOST_POPULAR].includes(value)) && 'ignoreSiglSections',
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ export function addCss() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hide BYOG section
|
// Hide BYOG section
|
||||||
if (getGlobalPref(GlobalPref.BLOCK_FEATURES).includes(BlockFeature.BYOG)) {
|
if (getGlobalPref(GlobalPref.BLOCK_FEATURES).includes(BlockFeature.BYOG) || getGlobalPref(GlobalPref.UI_HIDE_SECTIONS).includes(UiSection.BOYG)) {
|
||||||
selectorToHide.push('#BodyContent > div[class*=ByogRow-module__container___]');
|
selectorToHide.push('#BodyContent > div[class*=ByogRow-module__container___]');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -466,6 +466,7 @@ export class GlobalSettingsStorage extends BaseSettingsStorage<GlobalPref> {
|
|||||||
[UiSection.NATIVE_MKB]: t('section-native-mkb'),
|
[UiSection.NATIVE_MKB]: t('section-native-mkb'),
|
||||||
[UiSection.TOUCH]: t('section-touch'),
|
[UiSection.TOUCH]: t('section-touch'),
|
||||||
[UiSection.MOST_POPULAR]: t('section-most-popular'),
|
[UiSection.MOST_POPULAR]: t('section-most-popular'),
|
||||||
|
[UiSection.BOYG]: t('stream-your-own-game'),
|
||||||
[UiSection.RECENTLY_ADDED]: t('section-recently-added'),
|
[UiSection.RECENTLY_ADDED]: t('section-recently-added'),
|
||||||
[UiSection.LEAVING_SOON]: t('section-leaving-soon'),
|
[UiSection.LEAVING_SOON]: t('section-leaving-soon'),
|
||||||
[UiSection.GENRES]: t('section-genres'),
|
[UiSection.GENRES]: t('section-genres'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user