From 1c46a4c775872321271d9d11577503737ef14279 Mon Sep 17 00:00:00 2001 From: sD Date: Sat, 21 Dec 2019 15:32:25 +0100 Subject: add showname ui --- webAO/client.html | 8 ++++++++ webAO/client.js | 3 +++ 2 files changed, 11 insertions(+) (limited to 'webAO') diff --git a/webAO/client.html b/webAO/client.html index 64ddcc1..b2ea02c 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -229,6 +229,14 @@

+ +
+
Music diff --git a/webAO/client.js b/webAO/client.js index ed28819..5702e13 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -838,6 +838,9 @@ class Client extends EventEmitter { handleFL(args) { console.info("Server-supported features:"); console.info(args); + if (args.contains("cccc_ic_support")) { + document.getElementById("cccc").style.display = ""; + } } /** -- cgit From 92d5ac9974f288deb6e08836b42fe271df846627 Mon Sep 17 00:00:00 2001 From: sD Date: Sat, 21 Dec 2019 16:41:36 +0100 Subject: add shownames and prepare for cccc features --- webAO/client.js | 64 +++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 15 deletions(-) (limited to 'webAO') diff --git a/webAO/client.js b/webAO/client.js index 5702e13..4446d96 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -70,6 +70,7 @@ class Client extends EventEmitter { this.on("message", this.onMessage.bind(this)); this.on("error", this.onError.bind(this)); // Preset some of the variables + this.extrafeatures = []; this.flip = false; this.presentable = false; @@ -184,25 +185,34 @@ class Client extends EventEmitter { /** * Sends an in-character chat message. + * @param {string} deskmod currently unused * @param {string} speaking who is speaking * @param {string} name the name of the current character * @param {string} silent whether or not it's silent * @param {string} message the message to be sent * @param {string} side the name of the side in the background - * @param {string} ssfxname the name of the sound effect - * @param {string} zoom whether or not to zoom - * @param {number} ssfxdelay the delay (in milliseconds) to play the sound effect - * @param {string} objection the number of the shout to play + * @param {string} sfx_name the name of the sound effect + * @param {string} emote_modifier whether or not to zoom + * @param {number} sfx_delay the delay (in milliseconds) to play the sound effect + * @param {string} objection_modifier the number of the shout to play * @param {string} evidence the filename of evidence to show * @param {number} flip change to 1 to reverse sprite for position changes - * @param {string} flash screen flash effect - * @param {string} color text color + * @param {string} realization screen flash effect + * @param {string} text_color text color + * @param {string} showname custom name to be displayed (optional) + * @param {string} other_charid paired character (optional) + * @param {string} self_offset offset to paired character (optional) + * @param {string} noninterrupting_preanim play the full preanim (optional) */ - sendIC(speaking, name, silent, message, side, ssfxname, zoom, ssfxdelay, objection, evidence, flip, flash, color) { + sendIC(deskmod, speaking, name, silent, message, side, sfx_name, emote_modifier, sfx_delay, objection_modifier, evidence, flip, realization, text_color, showname, other_charid, self_offset, noninterrupting_preanim) { + let extra_cccc = ``; + if (this.extrafeatures.includes("cccc_ic_support")) { + extra_cccc = `${showname}#${other_charid}#${self_offset}#${noninterrupting_preanim}#`; + } this.serv.send( - `MS#chat#${speaking}#${name}#${silent}` + - `#${escapeChat(encodeChat(message))}#${side}#${ssfxname}#${zoom}` + - `#${this.charID}#${ssfxdelay}#${selectedShout}#${evidence}#${flip}#${flash}#${color}#%` + `MS#${deskmod}#${speaking}#${name}#${silent}` + + `#${escapeChat(encodeChat(message))}#${side}#${sfx_name}#${emote_modifier}` + + `#${this.charID}#${sfx_delay}#${objection_modifier}#${evidence}#${flip}#${realization}#${text_color}#${extra_cccc}%` ); } @@ -427,7 +437,8 @@ class Client extends EventEmitter { //we already set defaults } - const chatmsg = { + let chatmsg = { + deskmod: escape(args[1]), preanim: escape(args[2]).toLowerCase(), // get preanim nameplate: msg_nameplate, // TODO: there's a new feature that let's people choose the name that's displayed name: args[3].toLowerCase(), @@ -448,10 +459,27 @@ class Client extends EventEmitter { isnew: true, }; + if (this.extrafeatures.includes("cccc_ic_support")) { + const extra_options = { + showname: escape(args[16]), + other_charid: args[17], + other_name: args[18], + other_emote: args[19], + self_offset: args[20], + other_offset: args[21], + other_flip: args[22], + noninterrupting_preanim: args[23] + }; + chatmsg = Object.assign(extra_options, chatmsg); + if (chatmsg.showname && document.getElementById("showname").checked) { + chatmsg.nameplate = chatmsg.showname; + } + } + if (chatmsg.charid === this.charID) { resetICParams(); } - + console.log(chatmsg); viewport.say(chatmsg); // no await } } @@ -811,13 +839,17 @@ class Client extends EventEmitter { } /** - * Handles the issuance of a player ID by the server. + * Identifies the server and issues a playerID * @param {Array} args packet arguments */ handleID(args) { this.playerID = args[1]; } + /** + * Indicates how many users are on this server + * @param {Array} args packet arguments + */ handlePN(_args) { this.serv.send("askchaa#%"); } @@ -838,7 +870,8 @@ class Client extends EventEmitter { handleFL(args) { console.info("Server-supported features:"); console.info(args); - if (args.contains("cccc_ic_support")) { + this.extrafeatures = args; + if (args.includes("cccc_ic_support")) { document.getElementById("cccc").style.display = ""; } } @@ -1427,6 +1460,7 @@ export function onEnter(event) { const myevi = client.evidence; const myflip = ((client.flip) ? 1 : 0); const mycolor = document.getElementById("textcolor").value; + const showname = document.getElementById("ic_chat_name").value; let ssfxname = "0"; let ssfxdelay = "0"; if (document.getElementById("sendsfx").checked) { @@ -1437,7 +1471,7 @@ export function onEnter(event) { client.sendIC(myemo.speaking, mychar.name, myemo.silent, document.getElementById("client_inputbox").value, mychar.side, ssfxname, myemo.zoom, ssfxdelay, selectedShout, myevi, myflip, - selectedEffect, mycolor); + selectedEffect, mycolor, showname); } } window.onEnter = onEnter; -- cgit From 0f09863265a922bdabd65f912e782da69fab06d0 Mon Sep 17 00:00:00 2001 From: sD Date: Sat, 21 Dec 2019 16:52:53 +0100 Subject: adjust colors to match the client --- webAO/client.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'webAO') diff --git a/webAO/client.js b/webAO/client.js index 4446d96..a477474 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1308,15 +1308,16 @@ class Viewport { chatBox.style.display = "block"; chatBox.style.fontSize = (chatBox.offsetHeight * 0.25) + "px"; - // TODO: add missing colors - const colors = { - "0": "#ffffff", - "1": "#00ff00", - "2": "#ff0000", - "3": "#ffaa00", - "4": "#0000ff", - "5": "#ffff00", - "6": "#aa00aa" + let colors = { + "0": "#ffffff", // white + "1": "#00ff00", // green + "2": "#ff0000", // red + "3": "#ffa500", // orange + "4": "#4596ff", // blue + "5": "#ffff00", // yellow + "6": "#fedcba", // 6 is rainbow. + "7": "#aac0cb", // pink + "8": "#00ffff" // cyan }; chatBoxInner.style.color = colors[this.chatmsg.color] || "#ffffff"; this.chatmsg.startspeaking = false; -- cgit From d76123f3745fafad75450eea84b37fa4d3697312 Mon Sep 17 00:00:00 2001 From: sD Date: Sat, 21 Dec 2019 17:56:12 +0100 Subject: handle colors like client --- webAO/client.html | 4 +--- webAO/client.js | 53 ++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 37 insertions(+), 20 deletions(-) (limited to 'webAO') diff --git a/webAO/client.html b/webAO/client.html index b2ea02c..6c7db4a 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -64,13 +64,11 @@
diff --git a/webAO/client.js b/webAO/client.js index a477474..9fc169a 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -197,18 +197,27 @@ class Client extends EventEmitter { * @param {string} objection_modifier the number of the shout to play * @param {string} evidence the filename of evidence to show * @param {number} flip change to 1 to reverse sprite for position changes - * @param {string} realization screen flash effect - * @param {string} text_color text color + * @param {number} realization screen flash effect + * @param {number} text_color text color * @param {string} showname custom name to be displayed (optional) - * @param {string} other_charid paired character (optional) - * @param {string} self_offset offset to paired character (optional) - * @param {string} noninterrupting_preanim play the full preanim (optional) + * @param {number} other_charid paired character (optional) + * @param {string} other_name offset to paired character (optional) + * @param {string} other_emote offset to paired character (optional) + * @param {number} self_offset offset to paired character (optional) + * @param {number} other_offset offset to paired character (optional) + * @param {number} other_flip offset to paired character (optional) + * @param {number} noninterrupting_preanim play the full preanim (optional) */ - sendIC(deskmod, speaking, name, silent, message, side, sfx_name, emote_modifier, sfx_delay, objection_modifier, evidence, flip, realization, text_color, showname, other_charid, self_offset, noninterrupting_preanim) { + sendIC(deskmod, speaking, name, silent, message, side, sfx_name, emote_modifier, sfx_delay, objection_modifier, evidence, flip, realization, text_color, showname, other_charid, other_name, other_emote, self_offset, other_offset, other_flip, noninterrupting_preanim) { let extra_cccc = ``; - if (this.extrafeatures.includes("cccc_ic_support")) { + if (this.extrafeatures.includes("cccc_ic_support") ) { extra_cccc = `${showname}#${other_charid}#${self_offset}#${noninterrupting_preanim}#`; } + console.log( + `MS#${deskmod}#${speaking}#${name}#${silent}` + + `#${escapeChat(encodeChat(message))}#${side}#${sfx_name}#${emote_modifier}` + + `#${this.charID}#${sfx_delay}#${objection_modifier}#${evidence}#${flip}#${realization}#${text_color}#${extra_cccc}%` + ); this.serv.send( `MS#${deskmod}#${speaking}#${name}#${silent}` + `#${escapeChat(encodeChat(message))}#${side}#${sfx_name}#${emote_modifier}` + @@ -479,7 +488,7 @@ class Client extends EventEmitter { if (chatmsg.charid === this.charID) { resetICParams(); } - console.log(chatmsg); + viewport.say(chatmsg); // no await } } @@ -859,7 +868,7 @@ class Client extends EventEmitter { * webAO doesn't have this feature yet, but i want the warning to go away. * @param {Array} args packet arguments */ - handleARUP(args) { + handleARUP(_args) { // TODO: webAO doesn't have this feature yet } @@ -871,6 +880,15 @@ class Client extends EventEmitter { console.info("Server-supported features:"); console.info(args); this.extrafeatures = args; + + if (args.includes("yellowtext")) { + let colorselect = document.getElementById("textcolor"); + + colorselect.options[colorselect.options.length] = new Option("Yellow", 5); + colorselect.options[colorselect.options.length] = new Option("Pink", 7); + colorselect.options[colorselect.options.length] = new Option("Cyan", 8); + } + if (args.includes("cccc_ic_support")) { document.getElementById("cccc").style.display = ""; } @@ -1462,17 +1480,18 @@ export function onEnter(event) { const myflip = ((client.flip) ? 1 : 0); const mycolor = document.getElementById("textcolor").value; const showname = document.getElementById("ic_chat_name").value; - let ssfxname = "0"; - let ssfxdelay = "0"; + const mytext = document.getElementById("client_inputbox").value; + let sfxname = "0"; + let sfxdelay = "0"; if (document.getElementById("sendsfx").checked) { - ssfxname = myemo.sfx; - ssfxdelay = myemo.sfxdelay; + sfxname = myemo.sfx; + sfxdelay = myemo.sfxdelay; } - client.sendIC(myemo.speaking, mychar.name, myemo.silent, - document.getElementById("client_inputbox").value, mychar.side, - ssfxname, myemo.zoom, ssfxdelay, selectedShout, myevi, myflip, - selectedEffect, mycolor, showname); + client.sendIC("chat", myemo.speaking, mychar.name, myemo.silent, + mytext, mychar.side, + sfxname, myemo.zoom, sfxdelay, selectedShout, myevi, myflip, + selectedEffect, mycolor, showname, -1, "", "", 0, 0, 0, 0); } } window.onEnter = onEnter; -- cgit From 0db57eb3e94aa77b45e957516770cd00115b84b4 Mon Sep 17 00:00:00 2001 From: sD Date: Sat, 21 Dec 2019 18:04:28 +0100 Subject: add pairing ui --- webAO/client.html | 7 +++++++ webAO/client.js | 6 ++++++ 2 files changed, 13 insertions(+) (limited to 'webAO') diff --git a/webAO/client.html b/webAO/client.html index 6c7db4a..2c72d2d 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -116,6 +116,13 @@ No actions available for this role. +
+
diff --git a/webAO/client.js b/webAO/client.js index 9fc169a..6437df7 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -562,6 +562,11 @@ class Client extends EventEmitter { // If it does, give the user a visual indication that the character is unusable } + const mute_select = document.getElementById("mute_select"); + mute_select.add(new Option(escape(chargs[0]), charid)); + const pair_select = document.getElementById("pair_select"); + pair_select.add(new Option(escape(chargs[0]), charid)); + // sometimes ini files lack important settings const default_options = { name: chargs[0], @@ -891,6 +896,7 @@ class Client extends EventEmitter { if (args.includes("cccc_ic_support")) { document.getElementById("cccc").style.display = ""; + document.getElementById("pairing").style.display = ""; } } -- cgit From c70873d102a669a3e39faabee37d535e65c7ea0e Mon Sep 17 00:00:00 2001 From: sD Date: Sat, 21 Dec 2019 18:08:14 +0100 Subject: add muting ui --- webAO/client.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'webAO') diff --git a/webAO/client.html b/webAO/client.html index 2c72d2d..ea86a7c 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -28,6 +28,7 @@
Courtroom backdrop Character + Paired character Various overlay Character Evidence - No actions available for this role. + No judge actions available for this role. + +
+
-- cgit From 772e8eb4f5869b47f2000285ecf85a0cdc06b485 Mon Sep 17 00:00:00 2001 From: sD Date: Sat, 21 Dec 2019 18:16:21 +0100 Subject: correct mute ui, add pairing send to code --- webAO/client.html | 8 +++++--- webAO/client.js | 21 +++++++++++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) (limited to 'webAO') diff --git a/webAO/client.html b/webAO/client.html index ea86a7c..5c6a97e 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -118,14 +118,16 @@ No judge actions available for this role.
-