From 5eeb7ac9d90137c3b5ce9578c47bcc2ccff21c7e Mon Sep 17 00:00:00 2001 From: David Skoland Date: Sat, 7 Feb 2026 21:10:00 +0100 Subject: Use charicon_extensions from extensions.json for char icon URLs Instead of hardcoding .png, read the preferred extension from client.charicon_extensions[0] (populated via extensions.json), falling back to .png if unavailable. Co-Authored-By: Claude Opus 4.6 --- webAO/client/handleCharacterInfo.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'webAO/client/handleCharacterInfo.ts') diff --git a/webAO/client/handleCharacterInfo.ts b/webAO/client/handleCharacterInfo.ts index 0235f3b..28992e9 100644 --- a/webAO/client/handleCharacterInfo.ts +++ b/webAO/client/handleCharacterInfo.ts @@ -14,9 +14,10 @@ export const setupCharacterBasic = (chargs: string[], charid: number) => { if (chargs[0]) { img.alt = chargs[0]; img.title = chargs[0]; + const iconExt = client.charicon_extensions[0] || ".png"; img.src = `${AO_HOST}characters/${encodeURI( chargs[0].toLowerCase(), - )}/char_icon.png`; + )}/char_icon${iconExt}`; const mute_select = ( document.getElementById("mute_select") @@ -116,9 +117,10 @@ export const handleCharacterInfo = async (chargs: string[], charid: number) => { if (chargs[0]) { img.alt = chargs[0]; img.title = chargs[0]; + const iconExt = client.charicon_extensions[0] || ".png"; img.src = `${AO_HOST}characters/${encodeURI( chargs[0].toLowerCase(), - )}/char_icon.png`; + )}/char_icon${iconExt}`; // Reset inifile so ensureCharIni will re-fetch if (client.chars[charid]) { -- cgit