From 5bbdae01b4289e56ce1bb4e2d2187ee67dcd18fc Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 2 Apr 2026 19:42:22 +0200 Subject: [PATCH] Simplify sound emitter selection and add play/stop sound buttons --- src/app/App.tsx | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/app/App.tsx b/src/app/App.tsx index 0d8a321b..40bffda6 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -1858,14 +1858,7 @@ export function App({ store, initialStatusMessage }: AppProps) { const targetSoundEmitter = (link.action.type === "playSound" || link.action.type === "stopSound" ? editorState.document.entities[link.action.targetSoundEmitterId] - : undefined) ?? soundEmitterOptions.find(({ entity }) => { - if (entity.audioAssetId === null) { - return false; - } - - const asset = editorState.document.assets[entity.audioAssetId]; - return asset?.kind === "audio"; - })?.entity; + : undefined) ?? playableSoundEmitterOptions[0]?.entity; if (targetSoundEmitter === undefined || targetSoundEmitter.kind !== "soundEmitter") { setStatusMessage("Author a Sound Emitter with an audio asset before switching this link to sound playback."); @@ -2374,6 +2367,24 @@ export function App({ store, initialStatusMessage }: AppProps) { > Add Stop Anim Link + + );