Refactor sequence step handling to use clips

This commit is contained in:
2026-04-15 00:18:24 +02:00
parent 10e0c52fee
commit f13188bf32
4 changed files with 39 additions and 32 deletions

View File

@@ -4805,40 +4805,40 @@ function validateProjectSequence(
);
}
if (sequence.steps.length === 0) {
if (sequence.clips.length === 0) {
diagnostics.push(
createDiagnostic(
"error",
"invalid-project-sequence-steps-empty",
"Project sequences must contain at least one step.",
`${path}.steps`
"invalid-project-sequence-clips-empty",
"Project sequences must contain at least one clip.",
`${path}.clips`
)
);
return;
}
for (const [stepIndex, step] of sequence.steps.entries()) {
const stepPath = `${path}.steps.${stepIndex}`;
for (const [clipIndex, clip] of sequence.clips.entries()) {
const clipPath = `${path}.clips.${clipIndex}`;
switch (step.type) {
switch (clip.type) {
case "controlEffect":
validateProjectSchedulerEffect(
step.effect,
`${stepPath}.effect`,
clip.effect,
`${clipPath}.effect`,
context,
diagnostics
);
break;
case "startDialogue":
if (
projectResources.dialogues.dialogues[step.dialogueId] === undefined
projectResources.dialogues.dialogues[clip.dialogueId] === undefined
) {
diagnostics.push(
createDiagnostic(
"error",
"missing-sequence-dialogue-resource",
`Dialogue ${step.dialogueId} does not exist in the project dialogue library.`,
`${stepPath}.dialogueId`
`Dialogue ${clip.dialogueId} does not exist in the project dialogue library.`,
`${clipPath}.dialogueId`
)
);
}