From b16d8c50f09f2c6e698664bad5e83cd94f03e2c7 Mon Sep 17 00:00:00 2001 From: Ben Kyd Date: Sat, 10 Apr 2021 00:39:18 +0100 Subject: [PATCH] ready mechanics to client --- client/public/game/lobbies.js | 7 +++++++ data/en.lang | 2 ++ data/es.lang | 2 ++ data/locale.json | 10 ++++++++++ data/pt.lang | 2 ++ 5 files changed, 23 insertions(+) diff --git a/client/public/game/lobbies.js b/client/public/game/lobbies.js index 63b42a4..89efa33 100644 --- a/client/public/game/lobbies.js +++ b/client/public/game/lobbies.js @@ -250,6 +250,13 @@ socket.on('lobby-update', obj => { pageLog(`${obj.updateuser.username} ${localeString('lobby-deleted')}`); leaveLobby(); } + + if (obj.state === 'user-ready') + pageLog(`${obj.updateuser.username} ${localeString('user-is-ready')}`); + + if (obj.state === 'user-unready') + pageLog(`${obj.updateuser.username} ${localeString('user-is-unready')}`); + }); function leaveLobby() diff --git a/data/en.lang b/data/en.lang index a9c4cc6..d0668fc 100644 --- a/data/en.lang +++ b/data/en.lang @@ -56,5 +56,7 @@ status:Status; (noun) position status-connected:Connected status-connected-as:Connected as status-disconnected:Disconnected +user-is-ready:is ready ; (Action) to be ready, (name) is ready +user-is-unready:is not ready ; (Action) to be not ready (to play), (name) is not ready username:Username visibility:Visibility \ No newline at end of file diff --git a/data/es.lang b/data/es.lang index 126d4d2..70ab713 100644 --- a/data/es.lang +++ b/data/es.lang @@ -56,5 +56,7 @@ status:Status status-connected:Conectado(a) status-connected-as:Conectado/a como status-disconnected:Desconectado/a +user-is-ready: +user-is-unready: username:Nombre de usuario visibility:Visibilidad \ No newline at end of file diff --git a/data/locale.json b/data/locale.json index 8730c06..39882d5 100644 --- a/data/locale.json +++ b/data/locale.json @@ -274,6 +274,16 @@ "es": "Desconectado/a", "pt": "Desconectado/a" }, + "user-is-ready": { + "en": "is ready ", + "es": "", + "pt": "" + }, + "user-is-unready": { + "en": "is not ready ", + "es": "", + "pt": "" + }, "username": { "en": "Username", "es": "Nombre de usuario", diff --git a/data/pt.lang b/data/pt.lang index bb47ed3..e65568a 100644 --- a/data/pt.lang +++ b/data/pt.lang @@ -56,5 +56,7 @@ status:Status status-connected:Conectado(a) status-connected-as:Conectado/a como status-disconnected:Desconectado/a +user-is-ready: +user-is-unready: username:Nome de usuàrio visibility:Visibilidade \ No newline at end of file