From 19855fa729af4551d17672e2be3f57884f3d5e0c Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Thu, 1 Jan 2026 17:44:40 +0100 Subject: dont use opacity --- webAO/viewport/utils/handleICSpeaking.ts | 9 +++++++-- webAO/viewport/viewport.ts | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'webAO/viewport') diff --git a/webAO/viewport/utils/handleICSpeaking.ts b/webAO/viewport/utils/handleICSpeaking.ts index c0a9ae1..cf75a80 100644 --- a/webAO/viewport/utils/handleICSpeaking.ts +++ b/webAO/viewport/utils/handleICSpeaking.ts @@ -161,11 +161,16 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { shoutSprite.src = client.resources[shout].src; shoutSprite.style.animation = "bubble 700ms steps(10, jump-both)"; } - shoutSprite.style.opacity = "1"; + shoutSprite.style.display = "block"; - client.viewport.shoutaudio.src = `${AO_HOST}characters/${encodeURI( + const perCharPath = `${AO_HOST}characters/${encodeURI( client.viewport.getChatmsg().name.toLowerCase(), )}/${shout}.opus`; + client.viewport.shoutaudio.src = perCharPath; + client.viewport.shoutaudio.onerror = () => { + client.viewport.shoutaudio.src = client.resources[shout].sfx; + client.viewport.shoutaudio.play(); + }; client.viewport.shoutaudio.play(); client.viewport.setShoutTimer(client.resources[shout].duration); } else { diff --git a/webAO/viewport/viewport.ts b/webAO/viewport/viewport.ts index b5a96a0..c03d750 100644 --- a/webAO/viewport/viewport.ts +++ b/webAO/viewport/viewport.ts @@ -317,7 +317,7 @@ const viewport = (): Viewport => { // Pre-animation stuff if (chatmsg.preanimdelay > 0) { - shoutSprite.style.opacity = "0"; + shoutSprite.style.display = "none"; shoutSprite.style.animation = ""; const preanim = chatmsg.preanim.toLowerCase(); setEmote(AO_HOST, client, charName, preanim, "", false, chatmsg.side); @@ -370,7 +370,7 @@ const viewport = (): Viewport => { chatBoxInner.className = `text_${COLORS[chatmsg.color]}`; if (chatmsg.preanimdelay === 0) { - shoutSprite.style.opacity = "0"; + shoutSprite.style.display = "none"; shoutSprite.style.animation = ""; } -- cgit From 89d7319e4ae2d6466902cc3cea0c221b33f0e9dc Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Thu, 1 Jan 2026 17:46:49 +0100 Subject: bring back objection sounds for chars that dont have their own --- webAO/viewport/utils/handleICSpeaking.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'webAO/viewport') diff --git a/webAO/viewport/utils/handleICSpeaking.ts b/webAO/viewport/utils/handleICSpeaking.ts index cf75a80..6cf665c 100644 --- a/webAO/viewport/utils/handleICSpeaking.ts +++ b/webAO/viewport/utils/handleICSpeaking.ts @@ -12,6 +12,7 @@ import transparentPng from "../../constants/transparentPng"; import { COLORS } from "../constants/colors"; import mlConfig from "../../utils/aoml"; import request from "../../services/request"; +import fileExists from "../../utils/fileExists"; let attorneyMarkdown: ReturnType | null = null; @@ -166,11 +167,8 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { const perCharPath = `${AO_HOST}characters/${encodeURI( client.viewport.getChatmsg().name.toLowerCase(), )}/${shout}.opus`; - client.viewport.shoutaudio.src = perCharPath; - client.viewport.shoutaudio.onerror = () => { - client.viewport.shoutaudio.src = client.resources[shout].sfx; - client.viewport.shoutaudio.play(); - }; + const exists = await fileExists(perCharPath); + client.viewport.shoutaudio.src = exists ? perCharPath : client.resources[shout].sfx; client.viewport.shoutaudio.play(); client.viewport.setShoutTimer(client.resources[shout].duration); } else { -- cgit