aboutsummaryrefslogtreecommitdiff
path: root/scenario/client.js
diff options
context:
space:
mode:
Diffstat (limited to 'scenario/client.js')
-rw-r--r--scenario/client.js9
1 files changed, 9 insertions, 0 deletions
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});
+}