diff options
| author | stonedDiscord <Tukz@gmx.de> | 2026-02-11 12:28:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-11 12:28:49 +0100 |
| commit | 8e7af5b93009c987a4c0c3fef014cf7b64463e03 (patch) | |
| tree | 04b0c383ca35962dc3054ec7ace34bb64f019622 /webAO/viewport | |
| parent | 726d89ce8605d27be1c14bba59f81cfd6254ccb3 (diff) | |
| parent | 5bb35a981e2f35df7fbf126faa8655ee3b3ca142 (diff) | |
Merge pull request #293 from OmniTroid/better-charloading
Better charloading
Diffstat (limited to 'webAO/viewport')
| -rw-r--r-- | webAO/viewport/utils/handleICSpeaking.ts | 2 | ||||
| -rw-r--r-- | webAO/viewport/utils/initTestimonyUpdater.ts | 2 | ||||
| -rw-r--r-- | webAO/viewport/viewport.ts | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/webAO/viewport/utils/handleICSpeaking.ts b/webAO/viewport/utils/handleICSpeaking.ts index 6cf665c..ec791c5 100644 --- a/webAO/viewport/utils/handleICSpeaking.ts +++ b/webAO/viewport/utils/handleICSpeaking.ts @@ -169,7 +169,7 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { )}/${shout}.opus`; const exists = await fileExists(perCharPath); client.viewport.shoutaudio.src = exists ? perCharPath : client.resources[shout].sfx; - client.viewport.shoutaudio.play(); + client.viewport.shoutaudio.play().catch(() => {}); client.viewport.setShoutTimer(client.resources[shout].duration); } else { client.viewport.setShoutTimer(0); diff --git a/webAO/viewport/utils/initTestimonyUpdater.ts b/webAO/viewport/utils/initTestimonyUpdater.ts index c1e4d93..a545c97 100644 --- a/webAO/viewport/utils/initTestimonyUpdater.ts +++ b/webAO/viewport/utils/initTestimonyUpdater.ts @@ -18,7 +18,7 @@ export const initTestimonyUpdater = () => { } client.viewport.testimonyAudio.src = client.resources[testimony].sfx; - client.viewport.testimonyAudio.play(); + client.viewport.testimonyAudio.play().catch(() => {}); const testimonyOverlay = <HTMLImageElement>( document.getElementById("client_testimony") diff --git a/webAO/viewport/viewport.ts b/webAO/viewport/viewport.ts index c03d750..a7363a9 100644 --- a/webAO/viewport/viewport.ts +++ b/webAO/viewport/viewport.ts @@ -104,7 +104,7 @@ const viewport = (): Viewport => { sfxAudio.pause(); sfxAudio.loop = looping; sfxAudio.src = sfxname; - sfxAudio.play(); + sfxAudio.play().catch(() => {}); }; /** * Updates the testimony overaly @@ -150,7 +150,7 @@ const viewport = (): Viewport => { const charEmote = chatmsg.sprite.toLowerCase(); if (chatmsg.content.charAt(textnow.length) !== " ") { - blipChannels[currentBlipChannel].play(); + blipChannels[currentBlipChannel].play().catch(() => {}); currentBlipChannel++; currentBlipChannel %= blipChannels.length; } @@ -356,7 +356,7 @@ const viewport = (): Viewport => { eviBox.style.opacity = "1"; testimonyAudio.src = `${AO_HOST}sounds/general/sfx-evidenceshoop.opus`; - testimonyAudio.play(); + testimonyAudio.play().catch(() => {}); if (chatmsg.side === "def") { // Only def show evidence on right |
