From 8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 5 Jun 2021 19:27:48 +0200 Subject: Presque sortie du jeu --- scenario/client.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 scenario/client.js (limited to 'scenario/client.js') diff --git a/scenario/client.js b/scenario/client.js new file mode 100644 index 0000000..38412c5 --- /dev/null +++ b/scenario/client.js @@ -0,0 +1,9 @@ +function scenar(ns, emote, cb) { + if (!require('@electron/remote').getCurrentWindow().voice) { return; }; + + min = 0; + max = lang.scenario[ns].length - 1; + id = Math.floor(Math.random() * (max - min + 1) + min); + + require('@electron/remote').getCurrentWindow().webContents.send("scenario", {message:lang.scenario[ns][id],lang:lp,namespace:ns,id:id,emote:emote,callback:cb}); +} -- cgit