aboutsummaryrefslogtreecommitdiff
path: root/webAO
diff options
context:
space:
mode:
Diffstat (limited to 'webAO')
-rw-r--r--webAO/client.css8
-rw-r--r--webAO/client.html2
-rw-r--r--webAO/client.js32
3 files changed, 37 insertions, 5 deletions
diff --git a/webAO/client.css b/webAO/client.css
index ce057c9..0899e48 100644
--- a/webAO/client.css
+++ b/webAO/client.css
@@ -164,6 +164,14 @@ img {
left: 0;
}
+#client_pair_char {
+ position: absolute;
+ height: 100%;
+ width: 100%;
+ bottom: 0;
+ left: 0;
+}
+
#client_bench {
display: none;
position: absolute;
diff --git a/webAO/client.html b/webAO/client.html
index 5c6a97e..9423341 100644
--- a/webAO/client.html
+++ b/webAO/client.html
@@ -27,8 +27,8 @@
<div id="client_background">
<div id="client_gamewindow">
<img id="client_court" alt="Courtroom backdrop" onerror="imgError(this);">
+ <img id="client_pair_char" alt="Paired character" style="display: none;" onerror="charError(this);">
<img id="client_char" alt="Character" onerror="charError(this);">
- <img id="client_pair_char" alt="Paired character" onerror="charError(this);">
<img id="client_bench">
<img id="client_fg" alt="Various overlay" onerror="imgError(this);">
<img id="client_evi" src="misc/evidence_selector.png" alt="Character Evidence"
diff --git a/webAO/client.js b/webAO/client.js
index 8d2bb27..512dc22 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -43,6 +43,8 @@ let selectedEffect = 0;
let selectedMenu = 1;
let selectedShout = 0;
+let extrafeatures = [];
+
const fp = new Fingerprint({
canvas: true,
ie_activex: true,
@@ -69,8 +71,9 @@ class Client extends EventEmitter {
this.on("close", this.onClose.bind(this));
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;
@@ -206,7 +209,7 @@ class Client extends EventEmitter {
*/
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") ) {
+ if (extrafeatures.includes("cccc_ic_support") ) {
extra_cccc = `${showname}#${other_charid}#${self_offset}#${noninterrupting_preanim}#`;
}
console.log(
@@ -464,7 +467,7 @@ class Client extends EventEmitter {
isnew: true,
};
- if (this.extrafeatures.includes("cccc_ic_support")) {
+ if (extrafeatures.includes("cccc_ic_support")) {
const extra_options = {
showname: escape(args[16]),
other_charid: args[17],
@@ -880,7 +883,7 @@ class Client extends EventEmitter {
handleFL(args) {
console.info("Server-supported features:");
console.info(args);
- this.extrafeatures = args;
+ extrafeatures = args;
if (args.includes("yellowtext")) {
let colorselect = document.getElementById("textcolor");
@@ -1217,6 +1220,7 @@ class Viewport {
const nameBox = document.getElementById("client_name");
const chatBox = document.getElementById("client_chat");
const charSprite = document.getElementById("client_char");
+ const pairSprite = document.getElementById("client_pair_char");
const eviBox = document.getElementById("client_evi");
const background = document.getElementById("client_background");
const shoutSprite = document.getElementById("client_shout");
@@ -1229,6 +1233,15 @@ class Viewport {
charSprite.style.transform = "scaleX(1)";
}
+ if (extrafeatures.includes("cccc_ic_support")) {
+ // Flip the pair character
+ if (this.chatmsg.other_flip === "1") {
+ pairSprite.style.transform = "scaleX(-1)";
+ } else {
+ pairSprite.style.transform = "scaleX(1)";
+ }
+ }
+
if (this._animating) {
this.updater = setTimeout(() => this.tick(), UPDATE_INTERVAL);
}
@@ -1291,6 +1304,17 @@ class Viewport {
charSprite.src = `${AO_HOST}characters/${charName}/${preanim}.gif`;
}
+ if (extrafeatures.includes("cccc_ic_support")) {
+ if (this.chatmsg.other_name) {
+ const pairName = this.chatmsg.other_name.toLowerCase();
+ const pairEmote = this.chatmsg.other_emote.toLowerCase();
+ pairSprite.style.display = "";
+ pairSprite.src = `${AO_HOST}characters/${pairName}/(a)${pairEmote}.gif`;
+ } else {
+ pairSprite.style.display = "none";
+ }
+ }
+
this.chatmsg.startpreanim = false;
this.chatmsg.startspeaking = true;
} else if (this.textTimer >= this.shoutTimer + this.chatmsg.preanimdelay && !this.chatmsg.startpreanim) {