Update tests to use run sequence instead of start dialogue
This commit is contained in:
@@ -27,11 +27,12 @@ import {
|
|||||||
createTriggerVolumeEntity
|
createTriggerVolumeEntity
|
||||||
} from "../../src/entities/entity-instances";
|
} from "../../src/entities/entity-instances";
|
||||||
import {
|
import {
|
||||||
createStartDialogueInteractionLink,
|
createRunSequenceInteractionLink,
|
||||||
createTeleportPlayerInteractionLink,
|
createTeleportPlayerInteractionLink,
|
||||||
createToggleVisibilityInteractionLink
|
createToggleVisibilityInteractionLink
|
||||||
} from "../../src/interactions/interaction-links";
|
} from "../../src/interactions/interaction-links";
|
||||||
import { createProjectScheduleRoutine } from "../../src/scheduler/project-scheduler";
|
import { createProjectScheduleRoutine } from "../../src/scheduler/project-scheduler";
|
||||||
|
import { createProjectSequence } from "../../src/sequencer/project-sequences";
|
||||||
import { createModelInstance } from "../../src/assets/model-instances";
|
import { createModelInstance } from "../../src/assets/model-instances";
|
||||||
import { createProjectAssetStorageKey, type AudioAssetRecord } from "../../src/assets/project-assets";
|
import { createProjectAssetStorageKey, type AudioAssetRecord } from "../../src/assets/project-assets";
|
||||||
import { buildRuntimeSceneFromDocument } from "../../src/runtime-three/runtime-scene-build";
|
import { buildRuntimeSceneFromDocument } from "../../src/runtime-three/runtime-scene-build";
|
||||||
@@ -143,7 +144,21 @@ describe("buildRuntimeSceneFromDocument", () => {
|
|||||||
z: -2
|
z: -2
|
||||||
},
|
},
|
||||||
yawDegrees: 45,
|
yawDegrees: 45,
|
||||||
modelAssetId: "asset-model-triangle"
|
modelAssetId: "asset-model-triangle",
|
||||||
|
dialogues: [
|
||||||
|
{
|
||||||
|
id: "dialogue-warning",
|
||||||
|
title: "Warning",
|
||||||
|
lines: [
|
||||||
|
{
|
||||||
|
id: "dialogue-line-warning-1",
|
||||||
|
speakerName: "Operator",
|
||||||
|
text: "The generator is unstable."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
defaultDialogueId: "dialogue-warning"
|
||||||
});
|
});
|
||||||
const pointLight = createPointLightEntity({
|
const pointLight = createPointLightEntity({
|
||||||
id: "entity-point-light-main",
|
id: "entity-point-light-main",
|
||||||
@@ -329,31 +344,33 @@ describe("buildRuntimeSceneFromDocument", () => {
|
|||||||
trigger: "click",
|
trigger: "click",
|
||||||
targetEntityId: teleportTarget.id
|
targetEntityId: teleportTarget.id
|
||||||
}),
|
}),
|
||||||
"link-interactable-dialogue": createStartDialogueInteractionLink({
|
"link-interactable-dialogue": createRunSequenceInteractionLink({
|
||||||
id: "link-interactable-dialogue",
|
id: "link-interactable-dialogue",
|
||||||
sourceEntityId: interactable.id,
|
sourceEntityId: interactable.id,
|
||||||
trigger: "click",
|
trigger: "click",
|
||||||
dialogueId: "dialogue-warning"
|
sequenceId: "sequence-warning-dialogue"
|
||||||
}),
|
}),
|
||||||
"link-trigger-dialogue": createStartDialogueInteractionLink({
|
"link-trigger-dialogue": createRunSequenceInteractionLink({
|
||||||
id: "link-trigger-dialogue",
|
id: "link-trigger-dialogue",
|
||||||
sourceEntityId: triggerVolume.id,
|
sourceEntityId: triggerVolume.id,
|
||||||
trigger: "enter",
|
trigger: "enter",
|
||||||
dialogueId: "dialogue-warning"
|
sequenceId: "sequence-warning-dialogue"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
document.dialogues.dialogues["dialogue-warning"] = {
|
document.sequences.sequences["sequence-warning-dialogue"] =
|
||||||
id: "dialogue-warning",
|
createProjectSequence({
|
||||||
title: "Warning",
|
id: "sequence-warning-dialogue",
|
||||||
lines: [
|
title: "Warning Dialogue",
|
||||||
{
|
effects: [
|
||||||
id: "dialogue-line-warning-1",
|
{
|
||||||
speakerName: "Operator",
|
stepClass: "impulse",
|
||||||
text: "The generator is unstable."
|
type: "makeNpcTalk",
|
||||||
}
|
npcEntityId: npc.id,
|
||||||
]
|
dialogueId: "dialogue-warning"
|
||||||
};
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
document.world.background = {
|
document.world.background = {
|
||||||
mode: "image",
|
mode: "image",
|
||||||
assetId: imageAsset.id,
|
assetId: imageAsset.id,
|
||||||
@@ -728,8 +745,8 @@ describe("buildRuntimeSceneFromDocument", () => {
|
|||||||
sourceEntityId: "entity-interactable-console",
|
sourceEntityId: "entity-interactable-console",
|
||||||
trigger: "click",
|
trigger: "click",
|
||||||
action: {
|
action: {
|
||||||
type: "startDialogue",
|
type: "runSequence",
|
||||||
dialogueId: "dialogue-warning"
|
sequenceId: "sequence-warning-dialogue"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -746,8 +763,8 @@ describe("buildRuntimeSceneFromDocument", () => {
|
|||||||
sourceEntityId: "entity-trigger-door",
|
sourceEntityId: "entity-trigger-door",
|
||||||
trigger: "enter",
|
trigger: "enter",
|
||||||
action: {
|
action: {
|
||||||
type: "startDialogue",
|
type: "runSequence",
|
||||||
dialogueId: "dialogue-warning"
|
sequenceId: "sequence-warning-dialogue"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user