diff --git a/front/src/Components/Chat/Chat.svelte b/front/src/Components/Chat/Chat.svelte
index cfb12103..8432df3b 100644
--- a/front/src/Components/Chat/Chat.svelte
+++ b/front/src/Components/Chat/Chat.svelte
@@ -31,13 +31,13 @@
\ No newline at end of file
diff --git a/front/src/Components/Chat/ChatSubMenu.svelte b/front/src/Components/Chat/ChatSubMenu.svelte
new file mode 100644
index 00000000..6d311656
--- /dev/null
+++ b/front/src/Components/Chat/ChatSubMenu.svelte
@@ -0,0 +1,34 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts
index 3ccc9fd9..a363fe27 100644
--- a/front/src/Phaser/Game/GameScene.ts
+++ b/front/src/Phaser/Game/GameScene.ts
@@ -92,6 +92,7 @@ import { peerStore, screenSharingPeerStore } from "../../Stores/PeerStore";
import { videoFocusStore } from "../../Stores/VideoFocusStore";
import { biggestAvailableAreaStore } from "../../Stores/BiggestAvailableAreaStore";
import { playersStore } from "../../Stores/PlayersStore";
+import { chatVisibilityStore } from "../../Stores/ChatStore";
export interface GameSceneInitInterface {
initPosition: PointInterface | null;
@@ -169,6 +170,7 @@ export class GameScene extends DirtyScene {
private createPromiseResolve!: (value?: void | PromiseLike) => void;
private iframeSubscriptionList!: Array;
private peerStoreUnsubscribe!: () => void;
+ private chatVisibilityUnsubscribe!: () => void;
private biggestAvailableAreaStoreUnsubscribe!: () => void;
MapUrlFile: string;
RoomId: string;
@@ -571,6 +573,10 @@ export class GameScene extends DirtyScene {
}
oldPeerNumber = newPeerNumber;
});
+
+ this.chatVisibilityUnsubscribe = chatVisibilityStore.subscribe((v) => {
+ this.openChatIcon.setVisible(!v);
+ });
}
/**
@@ -1150,6 +1156,7 @@ ${escapedMessage}
this.pinchManager?.destroy();
this.emoteManager.destroy();
this.peerStoreUnsubscribe();
+ this.chatVisibilityUnsubscribe();
this.biggestAvailableAreaStoreUnsubscribe();
iframeListener.unregisterAnswerer("getState");
diff --git a/front/src/Stores/ChatStore.ts b/front/src/Stores/ChatStore.ts
index 344a424e..bc7c2d33 100644
--- a/front/src/Stores/ChatStore.ts
+++ b/front/src/Stores/ChatStore.ts
@@ -100,3 +100,19 @@ function createChatMessagesStore() {
};
}
export const chatMessagesStore = createChatMessagesStore();
+
+function createChatSubMenuVisibilityStore() {
+ const { subscribe, update } = writable("");
+
+ return {
+ subscribe,
+ openSubMenu(playerName: string, index: number) {
+ let id = playerName + index;
+ update((oldValue) => {
+ return oldValue === id ? "" : id;
+ });
+ },
+ };
+}
+
+export const chatSubMenuVisbilityStore = createChatSubMenuVisibilityStore();