diff --git a/CHANGELOG.md b/CHANGELOG.md
index ff7496ba..08c0f7db 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,11 @@
- Use `WA.ui.registerMenuCommand(): void` to add a custom menu
- Use `WA.room.setTiles(): void` to add, delete or change an array of tiles
- Users blocking now relies on UUID rather than ID. A blocked user that leaves a room and comes back will stay blocked.
+- The text chat was redesigned to be prettier and to use more features :
+ - The chat is now persistent bewteen discussions and always accesible
+ - The chat now tracks incoming and outcoming users in your conversation
+ - The chat allows your to see the visit card of users
+ - You can close the chat window with the escape key
## Version 1.4.3 - 1.4.4 - 1.4.5
diff --git a/back/src/Model/GameRoom.ts b/back/src/Model/GameRoom.ts
index 020f4c29..71d2124e 100644
--- a/back/src/Model/GameRoom.ts
+++ b/back/src/Model/GameRoom.ts
@@ -15,12 +15,6 @@ import { Admin } from "../Model/Admin";
export type ConnectCallback = (user: User, group: Group) => void;
export type DisconnectCallback = (user: User, group: Group) => void;
-export enum GameRoomPolicyTypes {
- ANONYMOUS_POLICY = 1,
- MEMBERS_ONLY_POLICY,
- USE_TAGS_POLICY,
-}
-
export class GameRoom {
private readonly minDistance: number;
private readonly groupRadius: number;
diff --git a/back/src/Services/SocketManager.ts b/back/src/Services/SocketManager.ts
index 8d04e713..8d1659df 100644
--- a/back/src/Services/SocketManager.ts
+++ b/back/src/Services/SocketManager.ts
@@ -436,10 +436,7 @@ export class SocketManager {
const serverToClientMessage1 = new ServerToClientMessage();
serverToClientMessage1.setWebrtcstartmessage(webrtcStartMessage1);
- //if (!user.socket.disconnecting) {
user.socket.write(serverToClientMessage1);
- //console.log('Sending webrtcstart initiator to '+user.socket.userId)
- //}
const webrtcStartMessage2 = new WebRtcStartMessage();
webrtcStartMessage2.setUserid(user.id);
@@ -453,10 +450,7 @@ export class SocketManager {
const serverToClientMessage2 = new ServerToClientMessage();
serverToClientMessage2.setWebrtcstartmessage(webrtcStartMessage2);
- //if (!otherUser.socket.disconnecting) {
otherUser.socket.write(serverToClientMessage2);
- //console.log('Sending webrtcstart to '+otherUser.socket.userId)
- //}
}
}
diff --git a/front/dist/index.tmpl.html b/front/dist/index.tmpl.html
index 9214b7ab..5801e8eb 100644
--- a/front/dist/index.tmpl.html
+++ b/front/dist/index.tmpl.html
@@ -35,8 +35,7 @@
-
-
+
diff --git a/front/dist/resources/service-worker.js b/front/dist/resources/service-worker.js
new file mode 100644
index 00000000..e496f7fc
--- /dev/null
+++ b/front/dist/resources/service-worker.js
@@ -0,0 +1,53 @@
+let CACHE_NAME = 'workavdenture-cache-v1';
+let urlsToCache = [
+ '/'
+];
+
+self.addEventListener('install', function(event) {
+ // Perform install steps
+ event.waitUntil(
+ caches.open(CACHE_NAME)
+ .then(function(cache) {
+ console.log('Opened cache');
+ return cache.addAll(urlsToCache);
+ })
+ );
+});
+
+self.addEventListener('fetch', function(event) {
+ event.respondWith(
+ caches.match(event.request)
+ .then(function(response) {
+ // Cache hit - return response
+ if (response) {
+ return response;
+ }
+
+ return fetch(event.request).then(
+ function(response) {
+ // Check if we received a valid response
+ if(!response || response.status !== 200 || response.type !== 'basic') {
+ return response;
+ }
+
+ // IMPORTANT: Clone the response. A response is a stream
+ // and because we want the browser to consume the response
+ // as well as the cache consuming the response, we need
+ // to clone it so we have two streams.
+ var responseToCache = response.clone();
+
+ caches.open(CACHE_NAME)
+ .then(function(cache) {
+ cache.put(event.request, responseToCache);
+ });
+
+ return response;
+ }
+ );
+ })
+ );
+});
+
+self.addEventListener('activate', function(event) {
+ //TODO activate service worker
+});
\ No newline at end of file
diff --git a/front/dist/static/images/favicons/icon-512x512.png b/front/dist/static/images/favicons/icon-512x512.png
new file mode 100644
index 00000000..86cb7477
Binary files /dev/null and b/front/dist/static/images/favicons/icon-512x512.png differ
diff --git a/front/dist/static/images/favicons/manifest.json b/front/dist/static/images/favicons/manifest.json
index 47ad9377..30d08769 100644
--- a/front/dist/static/images/favicons/manifest.json
+++ b/front/dist/static/images/favicons/manifest.json
@@ -119,7 +119,13 @@
"src": "/static/images/favicons/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
- "density": "4.0"
+ "density": "4.0",
+ "purpose": "any maskable"
+ },
+ {
+ "src": "/static/images/favicons/icon-512x512.png",
+ "sizes": "512x512",
+ "type": "image\/png"
}
],
"start_url": "/",
@@ -127,6 +133,7 @@
"display_override": ["window-control-overlay", "minimal-ui"],
"display": "standalone",
"scope": "/",
+ "lang": "en",
"theme_color": "#000000",
"shortcuts": [
{
@@ -134,7 +141,7 @@
"short_name": "WA",
"description": "WorkAdventure application",
"url": "/",
- "icons": [{ "src": "/static/images/favicons/android-icon-192x192.png", "sizes": "192x192" }]
+ "icons": [{ "src": "/static/images/favicons/android-icon-192x192.png", "sizes": "192x192", "type": "image/png" }]
}
],
"description": "WorkAdventure application",
diff --git a/front/dist/static/images/send.png b/front/dist/static/images/send.png
new file mode 100644
index 00000000..1f75634a
Binary files /dev/null and b/front/dist/static/images/send.png differ
diff --git a/front/src/Components/App.svelte b/front/src/Components/App.svelte
index 8ade9398..0f808074 100644
--- a/front/src/Components/App.svelte
+++ b/front/src/Components/App.svelte
@@ -10,12 +10,14 @@
import {errorStore} from "../Stores/ErrorStore";
import CustomCharacterScene from "./CustomCharacterScene/CustomCharacterScene.svelte";
import LoginScene from "./Login/LoginScene.svelte";
+ import Chat from "./Chat/Chat.svelte";
import {loginSceneVisibleStore} from "../Stores/LoginSceneStore";
import EnableCameraScene from "./EnableCamera/EnableCameraScene.svelte";
import VisitCard from "./VisitCard/VisitCard.svelte";
import {requestVisitCardsStore} from "../Stores/GameStore";
import type {Game} from "../Phaser/Game/Game";
+ import {chatVisibilityStore} from "../Stores/ChatStore";
import {helpCameraSettingsVisibleStore} from "../Stores/HelpCameraSettingsStore";
import HelpCameraSettingsPopup from "./HelpCameraSettings/HelpCameraSettingsPopup.svelte";
import AudioPlaying from "./UI/AudioPlaying.svelte";
@@ -61,14 +63,6 @@
{/if}
-
-
{#if $gameOverlayVisibilityStore}
@@ -94,4 +88,7 @@
{/if}
+ {#if $chatVisibilityStore}
+
+ {/if}
diff --git a/front/src/Components/Chat/Chat.svelte b/front/src/Components/Chat/Chat.svelte
new file mode 100644
index 00000000..8432df3b
--- /dev/null
+++ b/front/src/Components/Chat/Chat.svelte
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/front/src/Components/Chat/ChatElement.svelte b/front/src/Components/Chat/ChatElement.svelte
new file mode 100644
index 00000000..d656aca9
--- /dev/null
+++ b/front/src/Components/Chat/ChatElement.svelte
@@ -0,0 +1,83 @@
+
+
+
+
+ {#if message.type === ChatMessageTypes.userIncoming}
+ >> {#each targets as target, index}{#if !isLastIteration(index)}, {/if}{/each} enter ({renderDate(message.date)})
+ {:else if message.type === ChatMessageTypes.userOutcoming}
+ << {#each targets as target, index}{#if !isLastIteration(index)}, {/if}{/each} left ({renderDate(message.date)})
+ {:else if message.type === ChatMessageTypes.me}
+
Me: ({renderDate(message.date)})
+ {#each texts as text}
+
{@html urlifyText(text)}
+ {/each}
+ {:else}
+
: ({renderDate(message.date)})
+ {#each texts as text}
+
{@html urlifyText(text)}
+ {/each}
+ {/if}
+
+
+
+
\ No newline at end of file
diff --git a/front/src/Components/Chat/ChatMessageForm.svelte b/front/src/Components/Chat/ChatMessageForm.svelte
new file mode 100644
index 00000000..5445b8b8
--- /dev/null
+++ b/front/src/Components/Chat/ChatMessageForm.svelte
@@ -0,0 +1,57 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/front/src/Components/Chat/ChatPlayerName.svelte b/front/src/Components/Chat/ChatPlayerName.svelte
new file mode 100644
index 00000000..9b0630c0
--- /dev/null
+++ b/front/src/Components/Chat/ChatPlayerName.svelte
@@ -0,0 +1,51 @@
+
+
+
+
+ {player.name}
+
+ {#if isSubMenuOpen}
+
+ {/if}
+
+
+
+
\ 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..6690699e
--- /dev/null
+++ b/front/src/Components/Chat/ChatSubMenu.svelte
@@ -0,0 +1,33 @@
+
+
+