aboutsummaryrefslogtreecommitdiff
path: root/webAO/packets
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/packets')
-rw-r--r--webAO/packets/handlers/handleMS.ts10
-rw-r--r--webAO/packets/handlers/handlePV.ts18
2 files changed, 21 insertions, 7 deletions
diff --git a/webAO/packets/handlers/handleMS.ts b/webAO/packets/handlers/handleMS.ts
index 8464942..1c30d55 100644
--- a/webAO/packets/handlers/handleMS.ts
+++ b/webAO/packets/handlers/handleMS.ts
@@ -78,7 +78,7 @@ export const handleMS = (args: string[]) => {
speed: UPDATE_INTERVAL,
};
- if (args.length>16) {
+ if (args.length > 16) {
const extra_cccc = {
showname: prepChat(args[16]),
other_charid: Number(args[17]),
@@ -91,7 +91,7 @@ export const handleMS = (args: string[]) => {
};
chatmsg = Object.assign(extra_cccc, chatmsg);
- if (args.length>24) {
+ if (args.length > 24) {
const extra_27 = {
looping_sfx: Number(args[24]),
screenshake: Number(args[25]),
@@ -101,7 +101,7 @@ export const handleMS = (args: string[]) => {
};
chatmsg = Object.assign(extra_27, chatmsg);
- if (args.length>29) {
+ if (args.length > 29) {
const extra_28 = {
additive: Number(args[29]),
effects: args[30].split("|"),
@@ -159,6 +159,8 @@ export const handleMS = (args: string[]) => {
if (chatmsg.content.trim() === "") {
//blankpost
chatmsg.content = "";
+ // empty string as chatbox means hide it
+ chatmsg.chatbox = "";
}
// our own message appeared, reset the buttons
@@ -169,4 +171,4 @@ export const handleMS = (args: string[]) => {
handle_ic_speaking(chatmsg); // no await
}
}
-} \ No newline at end of file
+}
diff --git a/webAO/packets/handlers/handlePV.ts b/webAO/packets/handlers/handlePV.ts
index 938fb0d..247845b 100644
--- a/webAO/packets/handlers/handlePV.ts
+++ b/webAO/packets/handlers/handlePV.ts
@@ -44,6 +44,20 @@ export const handlePV = async (args: string[]) => {
}
// Make sure the asset server is case insensitive, or that everything on it is lowercase
+ const extensionsMap = [".png", ".webp"];
+ let url;
+ for (const extension of extensionsMap) {
+ url = `${AO_HOST}characters/${encodeURI(
+ me.name.toLowerCase()
+ )}/emotions/button${i}_off${extension}`;
+
+ const exists = await fileExists(url);
+
+ if (exists) {
+ break;
+ }
+ }
+
emotes[i] = {
desc: emoteinfo[0].toLowerCase(),
preanim: emoteinfo[1].toLowerCase(),
@@ -55,9 +69,7 @@ export const handlePV = async (args: string[]) => {
frame_screenshake: "",
frame_realization: "",
frame_sfx: "",
- button: `${AO_HOST}characters/${encodeURI(
- me.name.toLowerCase()
- )}/emotions/button${i}_off.png`,
+ button: url,
};
const emote_item = new Image();