From e58dcb7186bb3c80ba87279a6643fcb4b8b3b2be Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 3 Sep 2025 10:27:49 +0200 Subject: emotions --- webAO/client.ts | 2 ++ webAO/client/fetchLists.ts | 2 ++ webAO/packets/handlers/handlePV.ts | 3 +-- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'webAO') diff --git a/webAO/client.ts b/webAO/client.ts index 46f4ba9..27861de 100644 --- a/webAO/client.ts +++ b/webAO/client.ts @@ -154,6 +154,7 @@ class Client extends EventEmitter { isLowMemory: () => void; charicon_extensions: string[]; emote_extensions: string[]; + emotions_extensions: string[]; constructor(connectionString: string) { super(); @@ -214,6 +215,7 @@ class Client extends EventEmitter { isLowMemory; this.charicon_extensions = [".png", ".webp"]; this.emote_extensions = [".gif", ".png", ".apng", ".webp", ".webp.static"]; + this.emotions_extensions = [".png", ".webp"]; } /** diff --git a/webAO/client/fetchLists.ts b/webAO/client/fetchLists.ts index 68b1a43..7940eea 100644 --- a/webAO/client/fetchLists.ts +++ b/webAO/client/fetchLists.ts @@ -73,8 +73,10 @@ export const fetchExtensions = async () => { const allextensions = JSON.parse(extensiondata); client.charicon_extensions = allextensions.charicon_extensions || [".png", ".webp"]; client.emote_extensions = allextensions.emote_extensions || [".gif", ".png", ".apng", ".webp", ".webp.static"]; + client.emotions_extensions = allextensions.emotions_extensions || [".png", ".webp"]; console.log("charicons "+client.charicon_extensions) console.log("emotes "+client.emote_extensions) + console.log("emotions "+client.emotions_extensions) } catch (err) { console.warn("there was no extensions.json file"); } diff --git a/webAO/packets/handlers/handlePV.ts b/webAO/packets/handlers/handlePV.ts index 900ea89..4ac747f 100644 --- a/webAO/packets/handlers/handlePV.ts +++ b/webAO/packets/handlers/handlePV.ts @@ -58,9 +58,8 @@ 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) { + for (const extension of client.emotions_extensions) { url = `${AO_HOST}characters/${encodeURI( me.name.toLowerCase(), )}/emotions/button${i}_off${extension}`; -- cgit