diff --git a/front/src/Api/Events/ui/MenuItemRegisterEvent.ts b/front/src/Api/Events/ui/MenuItemRegisterEvent.ts index 404bdb13..e9ee1a50 100644 --- a/front/src/Api/Events/ui/MenuItemRegisterEvent.ts +++ b/front/src/Api/Events/ui/MenuItemRegisterEvent.ts @@ -1,5 +1,6 @@ import * as tg from "generic-type-guard"; import { Subject } from "rxjs"; +import { subMenusStore } from "../../../Stores/MenuStore"; export const isMenuItemRegisterEvent = new tg.IsInterface() .withProperties({ @@ -22,5 +23,5 @@ const _registerMenuCommandStream: Subject = new Subject(); export const registerMenuCommandStream = _registerMenuCommandStream.asObservable(); export function handleMenuItemRegistrationEvent(event: MenuItemRegisterEvent) { - _registerMenuCommandStream.next(event.menutItem); + subMenusStore.addMenu(event.menutItem); } diff --git a/front/src/Api/IframeListener.ts b/front/src/Api/IframeListener.ts index 4dde1b7d..b56e6c99 100644 --- a/front/src/Api/IframeListener.ts +++ b/front/src/Api/IframeListener.ts @@ -34,6 +34,7 @@ import { SetTilesEvent, isSetTilesEvent } from "./Events/SetTilesEvent"; import type { SetVariableEvent } from "./Events/SetVariableEvent"; import { ModifyEmbeddedWebsiteEvent, isEmbeddedWebsiteEvent } from "./Events/EmbeddedWebsiteEvent"; import { EmbeddedWebsite } from "./iframe/Room/EmbeddedWebsite"; +import { subMenusStore } from "../Stores/MenuStore"; type AnswererCallback = ( query: IframeQueryMap[T]["query"], @@ -93,12 +94,6 @@ class IframeListener { private readonly _setPropertyStream: Subject = new Subject(); public readonly setPropertyStream = this._setPropertyStream.asObservable(); - private readonly _registerMenuCommandStream: Subject = new Subject(); - public readonly registerMenuCommandStream = this._registerMenuCommandStream.asObservable(); - - private readonly _unregisterMenuCommandStream: Subject = new Subject(); - public readonly unregisterMenuCommandStream = this._unregisterMenuCommandStream.asObservable(); - private readonly _playSoundStream: Subject = new Subject(); public readonly playSoundStream = this._playSoundStream.asObservable(); @@ -264,7 +259,7 @@ class IframeListener { const data = payload.data.menutItem; // @ts-ignore this.iframeCloseCallbacks.get(iframe).push(() => { - this._unregisterMenuCommandStream.next(data); + subMenusStore.removeMenu(data); }); handleMenuItemRegistrationEvent(payload.data); } else if (payload.type == "setTiles" && isSetTilesEvent(payload.data)) { diff --git a/front/src/Api/iframe/Ui/MenuItem.ts b/front/src/Api/iframe/Ui/MenuItem.ts index aa61d749..443bb68e 100644 --- a/front/src/Api/iframe/Ui/MenuItem.ts +++ b/front/src/Api/iframe/Ui/MenuItem.ts @@ -2,6 +2,7 @@ import type { MenuItemClickedEvent } from "../../Events/ui/MenuItemClickedEvent" import { iframeListener } from "../../IframeListener"; export function sendMenuClickedEvent(menuItem: string) { + console.log("Menu " + menuItem); iframeListener.postMessage({ type: "menuItemClicked", data: { diff --git a/front/src/Api/iframe/ui.ts b/front/src/Api/iframe/ui.ts index ab5b2007..f4af2cbb 100644 --- a/front/src/Api/iframe/ui.ts +++ b/front/src/Api/iframe/ui.ts @@ -51,6 +51,7 @@ export class WorkAdventureUiCommands extends IframeApiContribution { + console.log("BOUM : " + event.menuItem); const callback = menuCallbacks.get(event.menuItem); if (callback) { callback(event.menuItem); diff --git a/front/src/Components/Menu/AboutRoomSubMenu.svelte b/front/src/Components/Menu/AboutRoomSubMenu.svelte index bd9ed80f..711ebb5d 100644 --- a/front/src/Components/Menu/AboutRoomSubMenu.svelte +++ b/front/src/Components/Menu/AboutRoomSubMenu.svelte @@ -52,7 +52,7 @@
-

This room use this map :

+

This room use the following map :

{mapName}

{mapDescription}

diff --git a/front/src/Components/Menu/ContactSubMenu.svelte b/front/src/Components/Menu/ContactSubMenu.svelte index bf16e42d..223f0324 100644 --- a/front/src/Components/Menu/ContactSubMenu.svelte +++ b/front/src/Components/Menu/ContactSubMenu.svelte @@ -22,37 +22,37 @@ The WorkAdventure team has its own offices in ... WorkAdventure! Do not hesitate to come see and talk to us.

- Visit us + Visit us

Our Mail

Although we offer a solution to reduce their use, we have an email address that allows us to receive all your requests.

- hello@workadventu.re + hello@workadventu.re

Our web site

If you want to know more about us, follow the link to our web site.

- About us + About us

Our social media

- {'Discord'} + {'Discord'} - {'Facebook'} + {'Facebook'} - {'Instagram'} + {'Instagram'} - {'LinkedIn'} + {'LinkedIn'} - {'Twitter'} + {'Twitter'} - {'Youtube'} + {'Youtube'}
diff --git a/front/src/Components/Menu/CustomSubMenu.svelte b/front/src/Components/Menu/CustomSubMenu.svelte new file mode 100644 index 00000000..6e51c38d --- /dev/null +++ b/front/src/Components/Menu/CustomSubMenu.svelte @@ -0,0 +1,13 @@ + + +
+ +
\ No newline at end of file diff --git a/front/src/Components/Menu/Menu.svelte b/front/src/Components/Menu/Menu.svelte index 3ac1f781..572fa19e 100644 --- a/front/src/Components/Menu/Menu.svelte +++ b/front/src/Components/Menu/Menu.svelte @@ -1,32 +1,57 @@ + +
- open menu + open menu