Add "MSFS2020: force native MKB support" setting

This commit is contained in:
redphx 2024-10-07 21:39:42 +07:00
parent 336a965653
commit b9134bc141
4 changed files with 16 additions and 3 deletions

View File

@ -98,4 +98,5 @@ export enum PrefKey {
REMOTE_PLAY_RESOLUTION = 'xhome_resolution',
GAME_FORTNITE_FORCE_CONSOLE = 'game_fortnite_force_console',
GAME_MSFS2020_FORCE_NATIVE_MKB = 'game_msfs2020_force_native_mkb',
}

View File

@ -378,6 +378,10 @@ function waitForRootDialog() {
function main() {
if (getPref(PrefKey.GAME_MSFS2020_FORCE_NATIVE_MKB)) {
BX_FLAGS.ForceNativeMkbTitles.push('9PMQDM08SNK9');
}
// Monkey patches
patchRtcPeerConnection();
patchRtcCodecs();

View File

@ -222,6 +222,7 @@ export class SettingsNavigationDialog extends NavigationDialog {
label: t('mouse-and-keyboard'),
items: [
PrefKey.NATIVE_MKB_ENABLED,
PrefKey.GAME_MSFS2020_FORCE_NATIVE_MKB,
PrefKey.MKB_ENABLED,
PrefKey.MKB_HIDE_IDLE_CURSOR,
],
@ -516,17 +517,17 @@ export class SettingsNavigationDialog extends NavigationDialog {
requiredVariants: 'full',
group: 'native-mkb',
label: t('native-mkb'),
items: [isFullVersion() && {
items: isFullVersion() ? [{
pref: PrefKey.NATIVE_MKB_SCROLL_VERTICAL_SENSITIVITY,
onChange: (e: any, value: number) => {
NativeMkbHandler.getInstance().setVerticalScrollMultiplier(value / 100);
},
}, isFullVersion() && {
}, {
pref: PrefKey.NATIVE_MKB_SCROLL_HORIZONTAL_SENSITIVITY,
onChange: (e: any, value: number) => {
NativeMkbHandler.getInstance().setHorizontalScrollMultiplier(value / 100);
},
}],
}] : [],
}];
private readonly TAB_SHORTCUTS_ITEMS: Array<SettingTabContent | false> = [{

View File

@ -804,6 +804,13 @@ export class GlobalSettingsStorage extends BaseSettingsStorage {
default: false,
note: t('fortnite-allow-stw-mode'),
},
[PrefKey.GAME_MSFS2020_FORCE_NATIVE_MKB]: {
requiredVariants: 'full',
label: '✈️ ' + t('msfs2020-force-native-mkb'),
default: false,
note: t('may-not-work-properly'),
},
} satisfies SettingDefinitions;
constructor() {