Lite: hide unsupported features

This commit is contained in:
redphx 2025-01-16 16:37:18 +07:00
parent 48da8bc527
commit 785df72972
4 changed files with 17 additions and 11 deletions

View File

@ -236,8 +236,10 @@ BxEventBus.Stream.on('state.starting', () => {
}); });
BxEventBus.Stream.on('state.playing', payload => { BxEventBus.Stream.on('state.playing', payload => {
if (isFullVersion()) {
window.BX_STREAM_SETTINGS = StreamSettings.settings; window.BX_STREAM_SETTINGS = StreamSettings.settings;
StreamSettings.refreshAllSettings(); StreamSettings.refreshAllSettings();
}
STATES.isPlaying = true; STATES.isPlaying = true;
StreamUiHandler.observe(); StreamUiHandler.observe();

View File

@ -313,7 +313,7 @@ export class SettingsDialog extends NavigationDialog {
items: [ items: [
PrefKey.BLOCK_TRACKING, PrefKey.BLOCK_TRACKING,
], ],
}, { }, isFullVersion() && {
group: 'advanced', group: 'advanced',
label: t('advanced'), label: t('advanced'),
items: [ items: [
@ -495,24 +495,23 @@ export class SettingsDialog extends NavigationDialog {
}], }],
}]; }];
private readonly TAB_CONTROLLER_ITEMS: Array<SettingTabSection | HTMLElement | false> = [{ private readonly TAB_CONTROLLER_ITEMS: Array<SettingTabSection | HTMLElement | false> = isFullVersion() ? [{
group: 'controller', group: 'controller',
label: t('controller'), label: t('controller'),
helpUrl: 'https://better-xcloud.github.io/ingame-features/#controller', helpUrl: 'https://better-xcloud.github.io/ingame-features/#controller',
items: [ items: [
isFullVersion() && { {
pref: PrefKey.LOCAL_CO_OP_ENABLED, pref: PrefKey.LOCAL_CO_OP_ENABLED,
onChange: () => { BxExposed.toggleLocalCoOp(getPref(PrefKey.LOCAL_CO_OP_ENABLED)); }, onChange: () => { BxExposed.toggleLocalCoOp(getPref(PrefKey.LOCAL_CO_OP_ENABLED)); },
}, }, {
isFullVersion() && {
pref: PrefKey.CONTROLLER_POLLING_RATE, pref: PrefKey.CONTROLLER_POLLING_RATE,
onChange: () => StreamSettings.refreshControllerSettings(), onChange: () => StreamSettings.refreshControllerSettings(),
}, isFullVersion() && ($parent => { }, ($parent => {
$parent.appendChild(ControllerExtraSettings.renderSettings.apply(this)); $parent.appendChild(ControllerExtraSettings.renderSettings.apply(this));
})], })],
}, },
isFullVersion() && STATES.userAgent.capabilities.touch && { STATES.userAgent.capabilities.touch && {
group: 'touch-control', group: 'touch-control',
label: t('touch-controller'), label: t('touch-controller'),
items: [{ items: [{
@ -564,7 +563,9 @@ export class SettingsDialog extends NavigationDialog {
}); });
}, },
}], }],
}, isFullVersion() && STATES.browser.capabilities.deviceVibration && { },
STATES.browser.capabilities.deviceVibration && {
group: 'device', group: 'device',
label: t('device'), label: t('device'),
items: [{ items: [{
@ -577,7 +578,7 @@ export class SettingsDialog extends NavigationDialog {
unsupported: !STATES.browser.capabilities.deviceVibration, unsupported: !STATES.browser.capabilities.deviceVibration,
onChange: () => StreamSettings.refreshControllerSettings(), onChange: () => StreamSettings.refreshControllerSettings(),
}], }],
}]; }] : [];
private readonly TAB_MKB_ITEMS: (() => Array<SettingTabSection | false>) = isFullVersion() ? () => [ private readonly TAB_MKB_ITEMS: (() => Array<SettingTabSection | false>) = isFullVersion() ? () => [
{ {

View File

@ -15,6 +15,7 @@ export function addCss() {
if (isLiteVersion()) { if (isLiteVersion()) {
// Hide Controller icon in Game tiles // Hide Controller icon in Game tiles
selectorToHide.push('div[class*=SupportedInputsBadge] svg:first-of-type'); selectorToHide.push('div[class*=SupportedInputsBadge] svg:first-of-type');
selectorToHide.push('div[class*=SupportedInputsBadge]:not(:has(:nth-child(2)))');
} }
// Hide "News" section // Hide "News" section

View File

@ -194,6 +194,7 @@ export class GlobalSettingsStorage extends BaseSettingsStorage {
default: false, default: false,
}, },
[PrefKey.UI_IMAGE_QUALITY]: { [PrefKey.UI_IMAGE_QUALITY]: {
requiredVariants: 'full',
label: t('image-quality'), label: t('image-quality'),
default: 90, default: 90,
min: 10, min: 10,
@ -617,6 +618,7 @@ export class GlobalSettingsStorage extends BaseSettingsStorage {
default: false, default: false,
}, },
[PrefKey.BLOCK_FEATURES]: { [PrefKey.BLOCK_FEATURES]: {
requiredVariants: 'full',
label: t('disable-features'), label: t('disable-features'),
default: [], default: [],
multipleOptions: { multipleOptions: {