From 1ee0b28f66ac251a339fa7617e8848bdf69d4913 Mon Sep 17 00:00:00 2001 From: Alexis Faizeau Date: Thu, 7 Oct 2021 14:40:02 +0200 Subject: [PATCH 01/16] Fix co website closing on exit zone --- .../Phaser/Game/GameMapPropertiesListener.ts | 65 ++++++++++--------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/front/src/Phaser/Game/GameMapPropertiesListener.ts b/front/src/Phaser/Game/GameMapPropertiesListener.ts index 950e1ebc..29084d2a 100644 --- a/front/src/Phaser/Game/GameMapPropertiesListener.ts +++ b/front/src/Phaser/Game/GameMapPropertiesListener.ts @@ -37,37 +37,44 @@ export class GameMapPropertiesListener { } }); this.gameMap.onPropertyChange("openWebsite", (newValue, oldValue, allProps) => { - if (newValue === undefined) { - layoutManagerActionStore.removeAction("openWebsite"); - coWebsiteManager.closeCoWebsite(); - } else { - const openWebsiteFunction = () => { - coWebsiteManager.loadCoWebsite( - newValue as string, - this.scene.MapUrlFile, - allProps.get("openWebsiteAllowApi") as boolean | undefined, - allProps.get("openWebsitePolicy") as string | undefined, - allProps.get("openWebsiteWidth") as number | undefined - ); + const handler = async () => { + if (newValue === undefined || newValue !== oldValue) { layoutManagerActionStore.removeAction("openWebsite"); - }; - const openWebsiteTriggerValue = allProps.get(TRIGGER_WEBSITE_PROPERTIES); - if (openWebsiteTriggerValue && openWebsiteTriggerValue === ON_ACTION_TRIGGER_BUTTON) { - let message = allProps.get(WEBSITE_MESSAGE_PROPERTIES); - if (message === undefined) { - message = "Press SPACE or touch here to open web site"; - } - layoutManagerActionStore.addAction({ - uuid: "openWebsite", - type: "message", - message: message, - callback: () => openWebsiteFunction(), - userInputManager: this.scene.userInputManager, - }); - } else { - openWebsiteFunction(); + await coWebsiteManager.closeCoWebsites(); } - } + + if (newValue !== undefined) { + const openWebsiteFunction = () => { + coWebsiteManager.loadCoWebsite( + newValue as string, + this.scene.MapUrlFile, + allProps.get("openWebsiteAllowApi") as boolean | undefined, + allProps.get("openWebsitePolicy") as string | undefined, + allProps.get("openWebsiteWidth") as number | undefined + ); + + layoutManagerActionStore.removeAction("openWebsite"); + }; + const openWebsiteTriggerValue = allProps.get(TRIGGER_WEBSITE_PROPERTIES); + if (openWebsiteTriggerValue && openWebsiteTriggerValue === ON_ACTION_TRIGGER_BUTTON) { + let message = allProps.get(WEBSITE_MESSAGE_PROPERTIES); + if (message === undefined) { + message = "Press SPACE or touch here to open web site"; + } + layoutManagerActionStore.addAction({ + uuid: "openWebsite", + type: "message", + message: message, + callback: () => openWebsiteFunction(), + userInputManager: this.scene.userInputManager, + }); + } else { + openWebsiteFunction(); + } + } + }; + + handler(); }); } } From da8cc661b72766b4140e63af6f4fa8a8e9a091b6 Mon Sep 17 00:00:00 2001 From: Alexis Faizeau Date: Thu, 7 Oct 2021 14:44:15 +0200 Subject: [PATCH 02/16] Implement the new co website system --- front/dist/index.tmpl.html | 74 ++- front/src/Components/Menu/Menu.svelte | 1 + front/src/Components/Menu/MenuIcon.svelte | 2 + front/src/Phaser/Game/GameScene.ts | 2 +- front/src/WebRtc/CoWebsiteManager.ts | 566 ++++++++++++++++++---- front/src/WebRtc/JitsiFactory.ts | 10 +- front/src/index.ts | 2 +- front/style/cowebsite-mobile.scss | 79 ++- front/style/cowebsite.scss | 167 ++++++- front/style/style.scss | 17 +- 10 files changed, 761 insertions(+), 159 deletions(-) diff --git a/front/dist/index.tmpl.html b/front/dist/index.tmpl.html index 0c89b611..dc21765b 100644 --- a/front/dist/index.tmpl.html +++ b/front/dist/index.tmpl.html @@ -37,6 +37,54 @@
+
+
+
+
+ + +
+
+
+ +
+
+
+
+ +
+
+ + +
+
+
+ +
+
+
+ +
+
+ + +
+
+
+ +
+
+
+ +
+
+ + +
+
+
+
+
@@ -48,19 +96,25 @@
+
diff --git a/front/src/Components/Menu/Menu.svelte b/front/src/Components/Menu/Menu.svelte index 6cbef9c1..4eecb370 100644 --- a/front/src/Components/Menu/Menu.svelte +++ b/front/src/Components/Menu/Menu.svelte @@ -124,6 +124,7 @@ top: 10%; position: relative; + z-index: 80; margin: auto; display: grid; diff --git a/front/src/Components/Menu/MenuIcon.svelte b/front/src/Components/Menu/MenuIcon.svelte index 02d6eb53..fa177c88 100644 --- a/front/src/Components/Menu/MenuIcon.svelte +++ b/front/src/Components/Menu/MenuIcon.svelte @@ -29,6 +29,8 @@