From f0b283ea243bb2af70213b6e035712efad5219c3 Mon Sep 17 00:00:00 2001 From: Lukas Hass Date: Sat, 2 Apr 2022 00:18:22 +0200 Subject: [PATCH] Enable right click on overlay --- front/src/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/front/src/index.ts b/front/src/index.ts index cfe06a46..8310263f 100644 --- a/front/src/index.ts +++ b/front/src/index.ts @@ -104,7 +104,6 @@ const config: GameConfig = { dom: { createContainer: true, }, - disableContextMenu: true, render: { pixelArt: true, roundPixels: true, @@ -142,6 +141,14 @@ const game = new Game(config); waScaleManager.setGame(game); +/* +TODO: replace with disableContextMenu when Phaser does not disable context menu on document.body +see https://github.com/photonstorm/phaser/issues/6064 +*/ +HtmlUtils.querySelectorOrFail("#game canvas").addEventListener("contextmenu", function (e) { + e.preventDefault(); +}); + window.addEventListener("resize", function (event) { coWebsiteManager.resetStyleMain();