aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.js
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/client.js')
-rw-r--r--webAO/client.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/webAO/client.js b/webAO/client.js
index b106b03..c97c136 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -14,6 +14,8 @@ import background_arr from "./backgrounds.js";
import evidence_arr from "./evidence.js";
import sfx_arr from "./sounds.js";
+import chatbox_arr from "./styles/chatbox/chatboxes.js";
+
import { EventEmitter } from "events";
import { version } from '../package.json';
@@ -504,12 +506,14 @@ class Client extends EventEmitter {
let msg_nameplate = args[3];
let msg_blips = "male";
+ let char_chatbox = "default";
let char_muted = false;
try {
msg_nameplate = this.chars[char_id].showname;
msg_blips = this.chars[char_id].gender;
- char_muted = this.chars[char_id].muted;
+ char_chatbox = this.chars[char_id].chat;
+ char_muted = this.chars[char_id].muted;
if(this.chars[char_id].name !== char_name) {
console.info(this.chars[char_id].name + " is iniediting to " + char_name);
@@ -529,6 +533,7 @@ class Client extends EventEmitter {
deskmod: safe_tags(args[1]).toLowerCase(),
preanim: safe_tags(args[2]).toLowerCase(), // get preanim
nameplate: msg_nameplate, // TODO: there's a new feature that let's people choose the name that's displayed
+ chatbox: char_chatbox,
name: char_name,
sprite: safe_tags(args[4]).toLowerCase(),
content: prepChat(args[5]), // Escape HTML tags
@@ -666,7 +671,8 @@ class Client extends EventEmitter {
name: chargs[0],
showname: chargs[0],
side: "def",
- gender: "male"
+ gender: "male",
+ chat: "default"
};
cini.options = Object.assign(default_options, cini.options);
@@ -681,6 +687,8 @@ class Client extends EventEmitter {
showname: safe_tags(cini.options.showname),
desc: safe_tags(chargs[1]),
gender: safe_tags(cini.options.gender).toLowerCase(),
+ side: safe_tags(cini.options.side).toLowerCase(),
+ chat: safe_tags(cini.options.chat).toLowerCase(),
evidence: chargs[3],
icon: icon,
inifile: cini,
@@ -1642,6 +1650,13 @@ async changeBackground(position) {
this.changeBackground(chatmsg.side);
+ const chatbox_theme = document.getElementById("chatbox_theme");
+ if (chatbox_arr.includes(chatmsg.chatbox)) {
+ chatbox_theme.href = "styles/chatbox/" + chatmsg.chatbox + ".css";
+ } else {
+ chatbox_theme.href = "styles/chatbox/default.css";
+ }
+
// Flip the character
if (this.chatmsg.flip === 1) {
charSprite.style.transform = "scaleX(-1)";