From 34df9d734809cb9601563de0a5c7b071211fae4c Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 2 Apr 2026 23:54:53 +0200 Subject: [PATCH] Add import menu items and update entity placement logic --- src/app/App.tsx | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/src/app/App.tsx b/src/app/App.tsx index a647f68b..5905acd6 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -3598,6 +3598,31 @@ export function App({ store, initialStatusMessage }: AppProps) { }; const addMenuItems: HierarchicalMenuItem[] = [ + { + kind: "group", + label: "Import", + testId: "add-menu-import", + children: [ + { + kind: "action", + label: "3D Model (GLB/GLTF)", + testId: "import-menu-model", + onSelect: handleImportModelButtonClick + }, + { + kind: "action", + label: "Environment", + testId: "import-menu-environment", + onSelect: handleImportBackgroundImageButtonClick + }, + { + kind: "action", + label: "Audio", + testId: "import-menu-audio", + onSelect: handleImportAudioButtonClick + } + ] + }, { kind: "group", label: "Entities", @@ -3607,31 +3632,31 @@ export function App({ store, initialStatusMessage }: AppProps) { kind: "action", label: "Player Start", testId: "add-menu-player-start", - onSelect: () => handlePlaceEntity("playerStart") + onSelect: () => beginEntityPlacement("playerStart") }, { kind: "action", label: "Sound Emitter", testId: "add-menu-sound-emitter", - onSelect: () => handlePlaceEntity("soundEmitter") + onSelect: () => beginEntityPlacement("soundEmitter", { audioAssetId: audioAssetList[0]?.id ?? null }) }, { kind: "action", label: "Trigger Volume", testId: "add-menu-trigger-volume", - onSelect: () => handlePlaceEntity("triggerVolume") + onSelect: () => beginEntityPlacement("triggerVolume") }, { kind: "action", label: "Teleport Target", testId: "add-menu-teleport-target", - onSelect: () => handlePlaceEntity("teleportTarget") + onSelect: () => beginEntityPlacement("teleportTarget") }, { kind: "action", label: "Interactable", testId: "add-menu-interactable", - onSelect: () => handlePlaceEntity("interactable") + onSelect: () => beginEntityPlacement("interactable") } ] }, @@ -3644,13 +3669,13 @@ export function App({ store, initialStatusMessage }: AppProps) { kind: "action", label: "Point Light", testId: "add-menu-point-light", - onSelect: () => handlePlaceEntity("pointLight") + onSelect: () => beginEntityPlacement("pointLight") }, { kind: "action", label: "Spot Light", testId: "add-menu-spot-light", - onSelect: () => handlePlaceEntity("spotLight") + onSelect: () => beginEntityPlacement("spotLight") } ] }