diff --git a/front/src/Components/Menu/SettingsSubMenu.svelte b/front/src/Components/Menu/SettingsSubMenu.svelte index 748968a8..93d3eaa9 100644 --- a/front/src/Components/Menu/SettingsSubMenu.svelte +++ b/front/src/Components/Menu/SettingsSubMenu.svelte @@ -7,6 +7,7 @@ let fullscreen: boolean = localUserStore.getFullscreen(); let notification: boolean = localUserStore.getNotification() === "granted"; + let forceCowebsiteTrigger: boolean = localUserStore.getForceCowebsiteTrigger(); let valueGame: number = localUserStore.getGameQualityValue(); let valueVideo: number = localUserStore.getVideoQualityValue(); let previewValueGame = valueGame; @@ -54,6 +55,10 @@ } } + function changeForceCowebsiteTrigger() { + localUserStore.setForceCowebsiteTrigger(forceCowebsiteTrigger); + } + function closeMenu() { menuVisiblilityStore.set(false); } @@ -109,6 +114,15 @@ /> Notifications + diff --git a/front/src/Connexion/LocalUserStore.ts b/front/src/Connexion/LocalUserStore.ts index c212f0f3..5ae9195a 100644 --- a/front/src/Connexion/LocalUserStore.ts +++ b/front/src/Connexion/LocalUserStore.ts @@ -13,6 +13,7 @@ const audioPlayerVolumeKey = "audioVolume"; const audioPlayerMuteKey = "audioMute"; const helpCameraSettingsShown = "helpCameraSettingsShown"; const fullscreenKey = "fullscreen"; +const forceCowebsiteTriggerKey = "forceCowebsiteTrigger"; const lastRoomUrl = "lastRoomUrl"; const authToken = "authToken"; const state = "state"; @@ -120,6 +121,13 @@ class LocalUserStore { return localStorage.getItem(fullscreenKey) === "true"; } + setForceCowebsiteTrigger(value: boolean): void { + localStorage.setItem(forceCowebsiteTriggerKey, value.toString()); + } + getForceCowebsiteTrigger(): boolean { + return localStorage.getItem(forceCowebsiteTriggerKey) === "true"; + } + setLastRoomUrl(roomUrl: string): void { localStorage.setItem(lastRoomUrl, roomUrl.toString()); if ("caches" in window) { diff --git a/front/src/Phaser/Game/GameMapPropertiesListener.ts b/front/src/Phaser/Game/GameMapPropertiesListener.ts index c40990db..2601cd63 100644 --- a/front/src/Phaser/Game/GameMapPropertiesListener.ts +++ b/front/src/Phaser/Game/GameMapPropertiesListener.ts @@ -4,6 +4,7 @@ import { scriptUtils } from "../../Api/ScriptUtils"; import type { CoWebsite } from "../../WebRtc/CoWebsiteManager"; import { coWebsiteManager, CoWebsiteState } from "../../WebRtc/CoWebsiteManager"; import { layoutManagerActionStore } from "../../Stores/LayoutManagerStore"; +import { localUserStore } from "../../Connexion/LocalUserStore"; import { get } from "svelte/store"; import { ON_ACTION_TRIGGER_BUTTON, ON_ACTION_TRIGGER_DISABLE } from "../../WebRtc/LayoutManager"; import type { ITiledMapLayer } from "../Map/ITiledMap"; @@ -37,7 +38,8 @@ export class GameMapPropertiesListener { } if (typeof newValue == "string" && newValue.length) { const openWebsiteTriggerValue = allProps.get(GameMapProperties.OPEN_WEBSITE_TRIGGER); - if (openWebsiteTriggerValue && openWebsiteTriggerValue === ON_ACTION_TRIGGER_BUTTON) { + const forceTrigger = localUserStore.getForceCowebsiteTrigger(); + if (forceTrigger || openWebsiteTriggerValue === ON_ACTION_TRIGGER_BUTTON) { let message = allProps.get(GameMapProperties.OPEN_WEBSITE_TRIGGER_MESSAGE); if (message === undefined) { message = "Press SPACE or touch here to open web site in new tab"; @@ -167,7 +169,8 @@ export class GameMapPropertiesListener { } })); - if (websiteTriggerProperty && websiteTriggerProperty === ON_ACTION_TRIGGER_BUTTON) { + const forceTrigger = localUserStore.getForceCowebsiteTrigger(); + if (forceTrigger || websiteTriggerProperty && websiteTriggerProperty === ON_ACTION_TRIGGER_BUTTON) { createWebsiteTrigger(); } else { this.coWebsitesOpenByLayer.set(layer, { diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 8b3af587..f5e582c8 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -870,7 +870,8 @@ export class GameScene extends DirtyScene { }; const jitsiTriggerValue = allProps.get(GameMapProperties.JITSI_TRIGGER); - if (jitsiTriggerValue && jitsiTriggerValue === ON_ACTION_TRIGGER_BUTTON) { + const forceTrigger = localUserStore.getForceCowebsiteTrigger(); + if (forceTrigger || jitsiTriggerValue === ON_ACTION_TRIGGER_BUTTON) { let message = allProps.get(GameMapProperties.JITSI_TRIGGER_MESSAGE); if (message === undefined) { message = "Press SPACE or touch here to enter Jitsi Meet room";