Add sequences and related logic to ProjectSequencerPane

This commit is contained in:
2026-04-14 23:42:08 +02:00
parent 88fc495bfa
commit 1f2cff3075

View File

@@ -204,6 +204,7 @@ function groupTargetOptions(
export function ProjectSequencerPane({ export function ProjectSequencerPane({
targetOptions, targetOptions,
scheduler, scheduler,
sequences,
selectedRoutineId, selectedRoutineId,
onSelectRoutine, onSelectRoutine,
onAddRoutine, onAddRoutine,
@@ -215,6 +216,7 @@ export function ProjectSequencerPane({
onSetRoutineStartHour, onSetRoutineStartHour,
onSetRoutineEndHour, onSetRoutineEndHour,
onSetRoutinePriority, onSetRoutinePriority,
onSetRoutineSequenceId,
onSetRoutineEffectOption, onSetRoutineEffectOption,
onSetRoutineNumericValue, onSetRoutineNumericValue,
onSetRoutineColorValue, onSetRoutineColorValue,
@@ -229,6 +231,10 @@ export function ProjectSequencerPane({
}: ProjectSequencerPaneProps) { }: ProjectSequencerPaneProps) {
const selectedRoutine = const selectedRoutine =
selectedRoutineId === null ? null : scheduler.routines[selectedRoutineId] ?? null; selectedRoutineId === null ? null : scheduler.routines[selectedRoutineId] ?? null;
const selectedRoutineHeldSteps =
selectedRoutine === null
? []
: getProjectScheduleRoutineHeldSteps(selectedRoutine, sequences);
const selectedTargetOption = const selectedTargetOption =
selectedRoutine === null selectedRoutine === null
? null ? null
@@ -237,7 +243,9 @@ export function ProjectSequencerPane({
selectedRoutine.target selectedRoutine.target
); );
const selectedEffectOptionId = const selectedEffectOptionId =
selectedRoutine === null || selectedRoutine.target.kind === "actor" selectedRoutine === null ||
selectedRoutine.target.kind === "actor" ||
selectedRoutine.sequenceId !== null
? null ? null
: getProjectScheduleEffectOptionId(selectedRoutine.effects[0]!); : getProjectScheduleEffectOptionId(selectedRoutine.effects[0]!);
const selectedEffectOptions = const selectedEffectOptions =
@@ -247,24 +255,32 @@ export function ProjectSequencerPane({
const selectedActorPresenceEffect = const selectedActorPresenceEffect =
selectedRoutine === null || selectedRoutine.target.kind !== "actor" selectedRoutine === null || selectedRoutine.target.kind !== "actor"
? null ? null
: findHeldSequenceControlEffect( : findHeldSequenceControlEffect(selectedRoutineHeldSteps, "setActorPresence");
getProjectScheduleRoutineHeldSteps(selectedRoutine),
"setActorPresence"
);
const selectedActorAnimationEffect = const selectedActorAnimationEffect =
selectedRoutine === null || selectedRoutine.target.kind !== "actor" selectedRoutine === null || selectedRoutine.target.kind !== "actor"
? null ? null
: findHeldSequenceControlEffect( : findHeldSequenceControlEffect(selectedRoutineHeldSteps, "playActorAnimation");
getProjectScheduleRoutineHeldSteps(selectedRoutine),
"playActorAnimation"
);
const selectedActorPathEffect = const selectedActorPathEffect =
selectedRoutine === null || selectedRoutine.target.kind !== "actor" selectedRoutine === null || selectedRoutine.target.kind !== "actor"
? null ? null
: findHeldSequenceControlEffect( : findHeldSequenceControlEffect(selectedRoutineHeldSteps, "followActorPath");
getProjectScheduleRoutineHeldSteps(selectedRoutine), const compatibleHeldSequences =
"followActorPath" selectedRoutine === null
); ? []
: getProjectSequences(sequences).filter((sequence) => {
const heldSteps = getProjectSequenceHeldSteps(sequence);
if (heldSteps.length === 0) {
return false;
}
return heldSteps.every(
(step) =>
step.type === "controlEffect" &&
getControlTargetRefKey(step.effect.target) ===
getControlTargetRefKey(selectedRoutine.target)
);
});
const hourTicks = Array.from({ length: HOURS_PER_DAY }, (_, hour) => hour); const hourTicks = Array.from({ length: HOURS_PER_DAY }, (_, hour) => hour);
return ( return (