diff options
| author | stonedDiscord <Tukz@gmx.de> | 2026-01-01 17:47:11 +0100 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2026-01-01 17:47:11 +0100 |
| commit | 55b3fa26de5f1c8781e2edbe6b8dee1787a21445 (patch) | |
| tree | afc63c88554a4c407edf3a768e8ae6d8ac82cf87 | |
| parent | 5c24de728f4df3ea144ee5398c7f9c98d022ec5d (diff) | |
| parent | 89d7319e4ae2d6466902cc3cea0c221b33f0e9dc (diff) | |
Merge branch 'bnnuy'
| -rw-r--r-- | webAO/utils/getResources.js | 4 | ||||
| -rw-r--r-- | webAO/viewport/utils/handleICSpeaking.ts | 7 | ||||
| -rw-r--r-- | webAO/viewport/viewport.ts | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/webAO/utils/getResources.js b/webAO/utils/getResources.js index 9837c77..7c71e28 100644 --- a/webAO/utils/getResources.js +++ b/webAO/utils/getResources.js @@ -2,18 +2,22 @@ const getResources = (AO_HOST, THEME) => ({ holdit: { src: `${AO_HOST}misc/default/holdit_bubble.png`, duration: 720, + sfx: `${AO_HOST}misc/default/holdit.opus`, }, objection: { src: `${AO_HOST}misc/default/objection_bubble.png`, duration: 720, + sfx: `${AO_HOST}misc/default/objection.opus`, }, takethat: { src: `${AO_HOST}misc/default/takethat_bubble.png`, duration: 840, + sfx: `${AO_HOST}misc/default/takethat.opus`, }, custom: { src: "", duration: 840, + sfx: "", }, witnesstestimony: { src: `${AO_HOST}themes/${THEME}/witnesstestimony_bubble.gif`, diff --git a/webAO/viewport/utils/handleICSpeaking.ts b/webAO/viewport/utils/handleICSpeaking.ts index c0a9ae1..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<typeof mlConfig> | null = null; @@ -161,11 +162,13 @@ 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`; + 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 { 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 = ""; } |
