From beb53df3646318d99c730d261ec863410ada59b3 Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Mon, 25 Jan 2021 13:18:57 +0100 Subject: [PATCH] Error problem open new map --- front/src/Phaser/Game/GameScene.ts | 10 +++-- front/src/WebRtc/LayoutManager.ts | 1 + maps/Floor0/floor0.json | 64 ++++++++++++++++++++++++++---- 3 files changed, 64 insertions(+), 11 deletions(-) diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 7caa224e..51126013 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -631,22 +631,24 @@ export class GameScene extends ResizableScene implements CenterListener { if (newValue) this.onMapExit(newValue as string); });*/ this.gameMap.onPropertyChange('exitUrl', (newValue, oldValue, allProps) => { - if (newValue === undefined) { + if (newValue) this.onMapExit(newValue as string); + /*if (newValue === undefined) { layoutManager.removeActionButton('exitUrl', this.userInputManager); } else { const exitTriggerValue = allProps.get(TRIGGER_EXIT_PROPERTIES); if (exitTriggerValue && exitTriggerValue === ON_ACTION_TRIGGER_BUTTON) { let message = allProps.get(EXIT_MESSAGE_PROPERTIES); - if(message === undefined){ - message = 'Click on SPACE to entrer in next map'; + if (message === undefined) { + message = 'Click on SPACE to enter in next map'; } layoutManager.addActionButton('exitUrl', message.toString(), () => { + layoutManager.removeActionButton('exitUrl', this.userInputManager); this.onMapExit(newValue as string); }, this.userInputManager); } else { this.onMapExit(newValue as string); } - } + }*/ }); this.gameMap.onPropertyChange('openWebsite', (newValue, oldValue, allProps) => { if (newValue === undefined) { diff --git a/front/src/WebRtc/LayoutManager.ts b/front/src/WebRtc/LayoutManager.ts index db9d0a95..ee7e47fe 100644 --- a/front/src/WebRtc/LayoutManager.ts +++ b/front/src/WebRtc/LayoutManager.ts @@ -24,6 +24,7 @@ export interface CenterListener { } export const ON_ACTION_TRIGGER_BUTTON = 'onaction'; + export const TRIGGER_WEBSITE_PROPERTIES = 'openWebsiteTrigger'; export const TRIGGER_JITSI_PROPERTIES = 'jitsiTrigger'; export const TRIGGER_EXIT_PROPERTIES = 'exitTrigger'; diff --git a/maps/Floor0/floor0.json b/maps/Floor0/floor0.json index 3bbd67cd..f5239941 100644 --- a/maps/Floor0/floor0.json +++ b/maps/Floor0/floor0.json @@ -49,6 +49,11 @@ "name":"jitsiTrigger", "type":"string", "value":"onaction" + }, + { + "name":"jitsiTriggerMessage", + "type":"string", + "value":"Test trigger message" }], "type":"tilelayer", "visible":true, @@ -225,6 +230,11 @@ "name":"openWebsiteTrigger", "type":"string", "value":"onaction" + }, + { + "name":"openWebsiteTriggerMessage", + "type":"string", + "value":"Test d'envoi d'un message" }], "type":"tilelayer", "visible":true, @@ -275,6 +285,16 @@ "name":"exit_stairs", "opacity":1, "properties":[ + { + "name":"exitTrigger", + "type":"string", + "value":"onaction" + }, + { + "name":"exitTriggerMessage", + "type":"string", + "value":"Test d'envoi d'un message" + }, { "name":"exitUrl", "type":"string", @@ -293,10 +313,20 @@ "name":"exit_lyon", "opacity":1, "properties":[ + { + "name":"exitTrigger", + "type":"string", + "value":"onaction" + }, + { + "name":"exitTriggerMessage", + "type":"string", + "value":"Test d'envoi d'un message" + }, { "name":"exitUrl", "type":"string", - "value":"..\/..\/..\/fjhzfiunzedoazmnj\/aurelgit.github.io\/wokalys\/map.json" + "value":"\/@\/tcm\/workadventure\/lyon" }], "type":"tilelayer", "visible":true, @@ -312,9 +342,19 @@ "opacity":1, "properties":[ { - "name":"exitSceneUrl", + "name":"exitTrigger", "type":"string", - "value":"https:\/\/npeguin.github.io\/coders-map\/map.json" + "value":"onaction" + }, + { + "name":"exitTriggerMessage", + "type":"string", + "value":"Test d'envoi d'un message" + }, + { + "name":"exitUrl", + "type":"string", + "value":"\/@\/tcm\/workadventure\/coder" }], "type":"tilelayer", "visible":true, @@ -330,9 +370,19 @@ "opacity":1, "properties":[ { - "name":"exitSceneUrl", + "name":"exitTrigger", "type":"string", - "value":"https:\/\/npeguin.github.io\/corridor-map\/map.json" + "value":"onaction" + }, + { + "name":"exitTriggerMessage", + "type":"string", + "value":"Test d'envoi d'un message" + }, + { + "name":"exitUrl", + "type":"string", + "value":"\/@\/tcm\/workadventure\/corridor" }], "type":"tilelayer", "visible":true, @@ -433,7 +483,7 @@ "nextobjectid":2, "orientation":"orthogonal", "renderorder":"right-down", - "tiledversion":"1.3.3", + "tiledversion":"1.4.3", "tileheight":32, "tilesets":[ { @@ -2379,6 +2429,6 @@ }], "tilewidth":32, "type":"map", - "version":1.2, + "version":1.4, "width":46 } \ No newline at end of file