Add support for startDialogue action in runtime scene build and tests
This commit is contained in:
@@ -27,7 +27,11 @@ import {
|
||||
createTeleportTargetEntity,
|
||||
createTriggerVolumeEntity
|
||||
} from "../../src/entities/entity-instances";
|
||||
import { createTeleportPlayerInteractionLink, createToggleVisibilityInteractionLink } from "../../src/interactions/interaction-links";
|
||||
import {
|
||||
createStartDialogueInteractionLink,
|
||||
createTeleportPlayerInteractionLink,
|
||||
createToggleVisibilityInteractionLink
|
||||
} from "../../src/interactions/interaction-links";
|
||||
import { createProjectScheduleRoutine } from "../../src/scheduler/project-scheduler";
|
||||
import { createModelInstance } from "../../src/assets/model-instances";
|
||||
import { createProjectAssetStorageKey, type AudioAssetRecord } from "../../src/assets/project-assets";
|
||||
@@ -339,9 +343,32 @@ describe("buildRuntimeSceneFromDocument", () => {
|
||||
sourceEntityId: interactable.id,
|
||||
trigger: "click",
|
||||
targetEntityId: teleportTarget.id
|
||||
}),
|
||||
"link-interactable-dialogue": createStartDialogueInteractionLink({
|
||||
id: "link-interactable-dialogue",
|
||||
sourceEntityId: interactable.id,
|
||||
trigger: "click",
|
||||
dialogueId: "dialogue-warning"
|
||||
}),
|
||||
"link-trigger-dialogue": createStartDialogueInteractionLink({
|
||||
id: "link-trigger-dialogue",
|
||||
sourceEntityId: triggerVolume.id,
|
||||
trigger: "enter",
|
||||
dialogueId: "dialogue-warning"
|
||||
})
|
||||
}
|
||||
};
|
||||
document.dialogues.dialogues["dialogue-warning"] = {
|
||||
id: "dialogue-warning",
|
||||
title: "Warning",
|
||||
lines: [
|
||||
{
|
||||
id: "dialogue-line-warning-1",
|
||||
speakerName: "Operator",
|
||||
text: "The generator is unstable."
|
||||
}
|
||||
]
|
||||
};
|
||||
document.world.background = {
|
||||
mode: "image",
|
||||
assetId: imageAsset.id,
|
||||
@@ -725,6 +752,15 @@ describe("buildRuntimeSceneFromDocument", () => {
|
||||
targetEntityId: "entity-teleport-target-main"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "link-interactable-dialogue",
|
||||
sourceEntityId: "entity-interactable-console",
|
||||
trigger: "click",
|
||||
action: {
|
||||
type: "startDialogue",
|
||||
dialogueId: "dialogue-warning"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "link-teleport",
|
||||
sourceEntityId: "entity-trigger-door",
|
||||
@@ -743,6 +779,15 @@ describe("buildRuntimeSceneFromDocument", () => {
|
||||
targetBrushId: "brush-room-floor",
|
||||
visible: false
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "link-trigger-dialogue",
|
||||
sourceEntityId: "entity-trigger-door",
|
||||
trigger: "enter",
|
||||
action: {
|
||||
type: "startDialogue",
|
||||
dialogueId: "dialogue-warning"
|
||||
}
|
||||
}
|
||||
]);
|
||||
expect(runtimeScene.playerStart).toEqual({
|
||||
|
||||
Reference in New Issue
Block a user