mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Fix keybindings not being properly assigned
This commit is contained in:
parent
23db5b117e
commit
b963b48df5
@ -105,6 +105,10 @@ export class KeybindingsState extends TextualGameState {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
if (event.target && event.target.tagName === "BUTTON" && keyCode === 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
// Enter
|
||||
keyCode === 13 ||
|
||||
@ -121,22 +125,8 @@ export class KeybindingsState extends TextualGameState {
|
||||
this.updateKeybindings();
|
||||
});
|
||||
|
||||
const clickListener = event => {
|
||||
if (event.target.tagName == "BUTTON") {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
const keyCode = event.button + 1;
|
||||
|
||||
this.app.settings.updateKeybindingOverride(id, keyCode);
|
||||
|
||||
this.dialogs.closeDialog(dialog);
|
||||
this.updateKeybindings();
|
||||
};
|
||||
|
||||
dialog.inputReciever.backButton.add(() => {});
|
||||
this.dialogs.internalShowDialog(dialog);
|
||||
dialog.element.addEventListener("mousedown", clickListener);
|
||||
|
||||
this.app.sound.playUiSound(SOUNDS.dialogOk);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user