update: sync dialogue and cinematic

This commit is contained in:
Tom Boullay
2026-05-11 12:58:12 +02:00
parent 7a439d0879
commit 6a4d0f7eb1
7 changed files with 132 additions and 3 deletions
@@ -74,6 +74,16 @@ function getManifestErrors(manifest: CinematicManifest | null): string[] {
errors.push(`${label}: les temps des keyframes doivent augmenter.`);
}
});
cinematic.dialogueCues?.forEach((cue, cueIndex) => {
if (!Number.isFinite(cue.time) || cue.time < 0) {
errors.push(`${label}: dialogue cue ${cueIndex + 1} time invalide.`);
}
if (!cue.dialogueId.trim()) {
errors.push(`${label}: dialogue cue ${cueIndex + 1} id obligatoire.`);
}
});
});
return errors;
@@ -105,6 +115,11 @@ function getPatchedCinematic(
cameraKeyframes: patch.cameraKeyframes ?? cinematic.cameraKeyframes,
};
const dialogueCues = patch.dialogueCues ?? cinematic.dialogueCues;
if (dialogueCues) {
nextCinematic.dialogueCues = dialogueCues;
}
if ("timecode" in patch) {
if (patch.timecode !== undefined) nextCinematic.timecode = patch.timecode;
} else if (cinematic.timecode !== undefined) {