disable controls

This commit is contained in:
Lurkars 2021-09-14 08:50:43 +02:00
parent beed50874b
commit 91bc524e06
2 changed files with 11 additions and 1 deletions

View File

@ -17,7 +17,7 @@
styleProperties: {
'--font': 'Press Start 2P'
},
showSearch : false
autoFocusSearch : false
});
picker.on("emoji", (selection) => {

View File

@ -173,6 +173,7 @@ export class GameScene extends DirtyScene {
private peerStoreUnsubscribe!: () => void;
private chatVisibilityUnsubscribe!: () => void;
private emoteUnsubscribe!: () => void;
private emoteMenuUnsubscribe!: () => void;
private biggestAvailableAreaStoreUnsubscribe!: () => void;
MapUrlFile: string;
roomUrl: string;
@ -624,6 +625,14 @@ export class GameScene extends DirtyScene {
}
});
this.emoteMenuUnsubscribe = emoteMenuStore.subscribe((emoteMenu) => {
if (emoteMenu) {
this.userInputManager.disableControls();
} else {
this.userInputManager.restoreControls();
}
});
Promise.all([this.connectionAnswerPromise as Promise<unknown>, ...scriptPromises]).then(() => {
this.scene.wake();
});
@ -1313,6 +1322,7 @@ ${escapedMessage}
this.peerStoreUnsubscribe();
this.chatVisibilityUnsubscribe();
this.emoteUnsubscribe();
this.emoteMenuUnsubscribe();
this.biggestAvailableAreaStoreUnsubscribe();
iframeListener.unregisterAnswerer("getState");
iframeListener.unregisterAnswerer("loadTileset");