diff options
| author | David Skoland <davidskoland@gmail.com> | 2026-02-07 21:10:00 +0100 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2026-02-07 21:10:00 +0100 |
| commit | 5eeb7ac9d90137c3b5ce9578c47bcc2ccff21c7e (patch) | |
| tree | 50ba0df4c3187cba8742762b9a94ff40395bc382 /webAO/client/handleCharacterInfo.ts | |
| parent | 0c76b200cc68c59772df930acd34a58bd6272c7f (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'webAO/client/handleCharacterInfo.ts')
| -rw-r--r-- | webAO/client/handleCharacterInfo.ts | 6 |
1 files changed, 4 insertions, 2 deletions
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 = <HTMLSelectElement>( 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]) { |
