mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-08 14:18:26 +02:00
Fix forcing native MKB not working when mode = "default"
This commit is contained in:
@@ -47,7 +47,7 @@ export const enum PrefKey {
|
||||
CONTROLLER_POLLING_RATE = 'controller.pollingRate',
|
||||
|
||||
NATIVE_MKB_MODE = 'nativeMkb.mode',
|
||||
FORCE_NATIVE_MKB_GAMES = 'nativeMkb.forcedGames',
|
||||
NATIVE_MKB_FORCED_GAMES = 'nativeMkb.forcedGames',
|
||||
NATIVE_MKB_SCROLL_HORIZONTAL_SENSITIVITY = 'nativeMkb.scroll.sensitivityX',
|
||||
NATIVE_MKB_SCROLL_VERTICAL_SENSITIVITY = 'nativeMkb.scroll.sensitivityY',
|
||||
|
||||
|
@@ -353,8 +353,8 @@ isFullVersion() && window.addEventListener(BxEvent.CAPTURE_SCREENSHOT, e => {
|
||||
function main() {
|
||||
GhPagesUtils.fetchLatestCommit();
|
||||
|
||||
if (getPref<NativeMkbMode>(PrefKey.NATIVE_MKB_MODE) === NativeMkbMode.ON) {
|
||||
const customList = getPref<string[]>(PrefKey.FORCE_NATIVE_MKB_GAMES);
|
||||
if (getPref<NativeMkbMode>(PrefKey.NATIVE_MKB_MODE) !== NativeMkbMode.OFF) {
|
||||
const customList = getPref<string[]>(PrefKey.NATIVE_MKB_FORCED_GAMES);
|
||||
BX_FLAGS.ForceNativeMkbTitles.push(...customList);
|
||||
}
|
||||
|
||||
|
@@ -231,8 +231,9 @@ export class SettingsDialog extends NavigationDialog {
|
||||
items: [
|
||||
PrefKey.NATIVE_MKB_MODE,
|
||||
{
|
||||
pref: PrefKey.FORCE_NATIVE_MKB_GAMES,
|
||||
pref: PrefKey.NATIVE_MKB_FORCED_GAMES,
|
||||
multiLines: true,
|
||||
note: CE('a', { href: 'https://github.com/redphx/better-xcloud/discussions/574', target: '_blank' }, t('unofficial-game-list')),
|
||||
},
|
||||
|
||||
PrefKey.MKB_ENABLED,
|
||||
|
@@ -68,10 +68,11 @@ export class SettingElement {
|
||||
tabindex: 0,
|
||||
});
|
||||
|
||||
const size = params.size ? params.size : Object.keys(setting.multipleOptions!).length;
|
||||
const totalOptions = Object.keys(setting.multipleOptions!).length;
|
||||
const size = params.size ? Math.min(params.size, totalOptions) : totalOptions;
|
||||
$control.setAttribute('size', size.toString());
|
||||
|
||||
for (let value in setting.multipleOptions) {
|
||||
for (const value in setting.multipleOptions) {
|
||||
const label = setting.multipleOptions[value];
|
||||
|
||||
const $option = CE<HTMLOptionElement>('option', {value: value}, label) as HTMLOptionElement;
|
||||
|
@@ -424,7 +424,7 @@ export class GlobalSettingsStorage extends BaseSettingsStorage {
|
||||
},
|
||||
},
|
||||
|
||||
[PrefKey.FORCE_NATIVE_MKB_GAMES]: {
|
||||
[PrefKey.NATIVE_MKB_FORCED_GAMES]: {
|
||||
label: t('force-native-mkb-games'),
|
||||
default: [],
|
||||
unsupported: !AppInterface && UserAgent.isMobile(),
|
||||
@@ -437,6 +437,9 @@ export class GlobalSettingsStorage extends BaseSettingsStorage {
|
||||
});
|
||||
}
|
||||
},
|
||||
params: {
|
||||
size: 6,
|
||||
},
|
||||
},
|
||||
|
||||
[PrefKey.NATIVE_MKB_SCROLL_HORIZONTAL_SENSITIVITY]: {
|
||||
|
Reference in New Issue
Block a user