Controller customization feature

This commit is contained in:
redphx
2024-12-22 17:17:03 +07:00
parent 8ef5a95c88
commit 7b60ba3a3e
89 changed files with 3286 additions and 1188 deletions

View File

@@ -580,7 +580,7 @@ export class EmulatedMkbHandler extends MkbHandler {
updateGamepadSlots() {
// Set gamepad slot
this.VIRTUAL_GAMEPAD.index = getPref<number>(PrefKey.MKB_P1_SLOT) - 1;
this.VIRTUAL_GAMEPAD.index = getPref(PrefKey.MKB_P1_SLOT) - 1;
}
start() {

View File

@@ -7,6 +7,7 @@ import { NativeMkbHandler } from "./native-mkb-handler";
import { StreamSettings } from "@/utils/stream-settings";
import { KeyHelper } from "./key-helper";
import { BxEventBus } from "@/utils/bx-event-bus";
import { BxIcon } from "@/utils/bx-icon";
type MkbPopupType = 'virtual' | 'native';
@@ -90,6 +91,7 @@ export class MkbPopup {
createButton({
label: t('manage'),
icon: BxIcon.MANAGE,
style: ButtonStyle.FOCUSABLE,
onClick: () => {
const dialog = SettingsDialog.getInstance();

View File

@@ -43,7 +43,7 @@ export class NativeMkbHandler extends MkbHandler {
private readonly LOG_TAG = 'NativeMkbHandler';
static isAllowed = () => {
return STATES.browser.capabilities.emulatedNativeMkb && getPref<NativeMkbMode>(PrefKey.NATIVE_MKB_MODE) === NativeMkbMode.ON;
return STATES.browser.capabilities.emulatedNativeMkb && getPref(PrefKey.NATIVE_MKB_MODE) === NativeMkbMode.ON;
}
private pointerClient: PointerClient | undefined;