From 9cce99b7dbd2f46e3a62737dff246069c956fe72 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 15 Apr 2026 10:58:46 +0200 Subject: [PATCH] Add NPC support in interaction source entity handling --- src/app/App.tsx | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/app/App.tsx b/src/app/App.tsx index cf845f3f..aa9e8b0f 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -481,9 +481,22 @@ type WorldNightEnvironmentNumericField = type InteractionSourceEntity = Extract< EntityInstance, - { kind: "triggerVolume" | "interactable" } + { kind: "triggerVolume" | "interactable" | "npc" } >; +function getInteractionSourceEntityLabel( + entity: InteractionSourceEntity +): string { + switch (entity.kind) { + case "triggerVolume": + return "Trigger Volume"; + case "interactable": + return "Interactable"; + case "npc": + return "NPC"; + } +} + function getModelInstanceCollisionModeDescription( mode: ModelInstanceCollisionMode ): string { @@ -1495,7 +1508,9 @@ function isInteractionSourceEntity( ): entity is InteractionSourceEntity { return ( entity !== null && - (entity.kind === "triggerVolume" || entity.kind === "interactable") + (entity.kind === "triggerVolume" || + entity.kind === "interactable" || + entity.kind === "npc") ); } @@ -2133,6 +2148,13 @@ export function App({ store, initialStatusMessage }: AppProps) { editorState.document.interactionLinks, selectedInteractable.id ); + const selectedNpcLinks = + selectedNpc === null + ? [] + : getInteractionLinksForSource( + editorState.document.interactionLinks, + selectedNpc.id + ); const sceneTargetOptions = sceneList.map((scene) => ({ id: scene.id, name: scene.name