diff --git a/package-lock.json b/package-lock.json index 701f525..8fde2ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2157,9 +2157,9 @@ "dev": true }, "@workadventure/iframe-api-typings": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@workadventure/iframe-api-typings/-/iframe-api-typings-1.4.14.tgz", - "integrity": "sha512-p9uoU1m6aZD7ut+TGorMRaSB9oxDblwhOYZQgPD2U55jVNmSI9ZAlpp+J4hAvUaIOSP71G2qB7M/FoeyCyX4yA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@workadventure/iframe-api-typings/-/iframe-api-typings-1.7.1.tgz", + "integrity": "sha512-a74vllJZ+yaCOEsKck8y5IRbIHOR8pbyAum4/ydddOfeIlJDQU17+kb6UAZ9Dmu+ZpFaugPEtjNmW6hivPu6ug==", "dev": true }, "@workadventure/tiled-map-type-guard": { diff --git a/package.json b/package.json index 35e6d7f..15f4115 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "@types/mini-css-extract-plugin": "^2.2.0", "@types/mustache": "^4.1.2", "@types/webpack-dev-server": "^4.1.0", - "@workadventure/iframe-api-typings": "^1.4.14", + "@workadventure/iframe-api-typings": "^1.7.1", "copy-webpack-plugin": "^9.0.1", "cross-env": "^7.0.3", "css-loader": "^5.2.4", diff --git a/src/Features/configuration.ts b/src/Features/configuration.ts index ae80236..524e847 100644 --- a/src/Features/configuration.ts +++ b/src/Features/configuration.ts @@ -67,7 +67,7 @@ function initConfigurationPanel(openConfigVariables: string, properties: Propert WA.nav.closeCoWebSite(); } - WA.room.onEnterZone(zoneName, () => { + WA.room.onEnterLayer(zoneName).subscribe(() => { const openConfigTriggerValue = properties.getString("openConfigTrigger"); // Do not display conf panel if the user is not allowed by tag @@ -80,7 +80,7 @@ function initConfigurationPanel(openConfigVariables: string, properties: Propert } }); - WA.room.onLeaveZone(zoneName, () => { + WA.room.onLeaveLayer(zoneName).subscribe(() => { if (actionMessage) { actionMessage.remove(); closeConfigurationPanel(); diff --git a/src/Features/doors.ts b/src/Features/doors.ts index 04e4041..60d8fdb 100644 --- a/src/Features/doors.ts +++ b/src/Features/doors.ts @@ -184,7 +184,7 @@ function initDoorstep( } } - WA.room.onEnterZone(zoneName, () => { + WA.room.onEnterLayer(zoneName).subscribe(() => { inZone = true; if (properties.getBoolean("autoOpen") && allowed) { WA.state[doorVariable.name] = true; @@ -211,7 +211,7 @@ function initDoorstep( } }); - WA.room.onLeaveZone(zoneName, () => { + WA.room.onLeaveLayer(zoneName).subscribe(() => { inZone = false; if (properties.getBoolean("autoClose")) { WA.state[doorVariable.name] = false; @@ -278,7 +278,7 @@ function initBellLayer(bellVariable: string, properties: Properties): void { const bellPopupName = properties.getString("bellPopup"); - WA.room.onEnterZone(zoneName, () => { + WA.room.onEnterLayer(zoneName).subscribe(() => { if (!bellPopupName) { WA.state[bellVariable] = (WA.state[bellVariable] as number) + 1; } else { @@ -293,7 +293,7 @@ function initBellLayer(bellVariable: string, properties: Properties): void { } }); - WA.room.onLeaveZone(zoneName, () => { + WA.room.onLeaveLayer(zoneName).subscribe(() => { if (popup) { popup.close(); popup = undefined; diff --git a/src/Features/variable_actions.ts b/src/Features/variable_actions.ts index 4db1652..661e273 100644 --- a/src/Features/variable_actions.ts +++ b/src/Features/variable_actions.ts @@ -31,7 +31,7 @@ function setupVariableActionLayer( } if (enterValue !== undefined) { - WA.room.onEnterZone(zone, () => { + WA.room.onEnterLayer(zone).subscribe(() => { if (triggerMessage) { // TODO WHEN WA.ui.displayMessage is merged! //WA.ui. @@ -41,7 +41,7 @@ function setupVariableActionLayer( }); } if (leaveValue !== undefined) { - WA.room.onLeaveZone(zone, () => { + WA.room.onLeaveLayer(zone).subscribe(() => { WA.state[variableName] = leaveValue; }); }