mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 15:00:43 +00:00
hide build menu when click on map on mobile
This commit is contained in:
@@ -140,6 +140,7 @@ export class InputHandler {
|
||||
if (dist < 10) {
|
||||
if (event.pointerType == "touch") {
|
||||
event.preventDefault()
|
||||
console.log('firing context menu event')
|
||||
this.eventBus.emit(new ContextMenuEvent(event.clientX, event.clientY))
|
||||
} else {
|
||||
this.eventBus.emit(new MouseUpEvent(event.x, event.y))
|
||||
|
||||
@@ -40,10 +40,6 @@ export class BuildMenu extends LitElement {
|
||||
private myPlayer: Player;
|
||||
private clickedCell: Cell;
|
||||
|
||||
init() {
|
||||
this.eventBus.on(ContextMenuEvent, (e) => { this.hideMenu() })
|
||||
}
|
||||
|
||||
static styles = css`
|
||||
:host {
|
||||
display: block;
|
||||
|
||||
@@ -201,6 +201,10 @@ export class RadialMenu implements Layer {
|
||||
}
|
||||
|
||||
private onContextMenu(event: ContextMenuEvent) {
|
||||
if (this.buildMenu.isVisible) {
|
||||
this.buildMenu.hideMenu()
|
||||
return
|
||||
}
|
||||
if (this.isVisible) {
|
||||
this.hideRadialMenu()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user