Merge pull request #1817 from thecodingmachine/fix-interaction

fixed actions-menu not appearing
This commit is contained in:
David Négrier 2022-02-03 10:13:36 +01:00 committed by GitHub
commit be2727f5c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,11 +38,11 @@ export class RemotePlayer extends Character implements ActivatableInterface {
//set data
this.userId = userId;
this.visitCardUrl = visitCardUrl;
this.registeredActions = [];
this.registerDefaultActionsMenuActions();
this.setClickable(this.registeredActions.length > 0);
this.activationRadius = activationRadius ?? 96;
this.visitCardUrl = visitCardUrl;
this.actionsMenuStoreUnsubscriber = actionsMenuStore.subscribe((value: ActionsMenuData | undefined) => {
this.isActionsMenuInitialized = value ? true : false;
});
@ -118,7 +118,7 @@ export class RemotePlayer extends Character implements ActivatableInterface {
private bindEventHandlers(): void {
this.on(Phaser.Input.Events.POINTER_DOWN, (event: Phaser.Input.Pointer) => {
if (event.downElement.nodeName === "CANVAS") {
if (event.downElement.nodeName === "CANVAS" && event.leftButtonDown()) {
this.toggleActionsMenu();
}
});