Refactor and update project schedule routines and options

This commit is contained in:
2026-04-14 03:06:48 +02:00
parent 90acccb10c
commit 915ff68aff
3 changed files with 13 additions and 7 deletions

View File

@@ -348,8 +348,7 @@ import {
getProjectScheduleEffectOptionId,
getProjectScheduleTargetOptionByKey,
listProjectScheduleEffectOptions,
listProjectScheduleTargetOptions,
type ProjectScheduleEffectOptionId
listProjectScheduleTargetOptions
} from "../scheduler/project-schedule-control-options";
import {
loadProjectPackage,

View File

@@ -20,6 +20,14 @@ import {
type ProjectScheduleRoutine
} from "../scheduler/project-scheduler";
type ActorPresenceScheduleRoutine = ProjectScheduleRoutine & {
target: {
kind: "actor";
actorId: string;
};
effect: SetActorPresenceControlEffect;
};
export interface RuntimeResolvedActorScheduleState {
actorId: string;
hasRules: boolean;
@@ -97,10 +105,10 @@ export function createRuntimeProjectSchedulerState(options: {
function resolveActorScheduleRules(
scheduler: ProjectScheduler,
actorId: string
): ProjectScheduleRoutine[] {
): ActorPresenceScheduleRoutine[] {
return Object.values(scheduler.routines)
.filter(
(routine) =>
(routine): routine is ActorPresenceScheduleRoutine =>
routine.enabled &&
routine.target.kind === "actor" &&
routine.target.actorId === actorId &&

View File

@@ -28,7 +28,7 @@ import {
} from "../controls/control-surface";
import { getModelInstances } from "../assets/model-instances";
import { getModelInstanceDisplayLabel } from "../assets/model-instance-labels";
import { getEntityDisplayLabel, getSortedEntityDisplayLabels } from "../entities/entity-labels";
import { getSortedEntityDisplayLabels } from "../entities/entity-labels";
import { listProjectNpcActors } from "../entities/npc-actor-registry";
export const PROJECT_SCHEDULE_EFFECT_OPTION_IDS = [
@@ -311,7 +311,7 @@ export function listProjectScheduleTargetOptions(
groupLabel: "Model Instances",
defaults: {
animationClipNames,
animationLoop: modelInstance.animationLoop ?? true
animationLoop: true
}
});
}
@@ -690,4 +690,3 @@ export function createProjectScheduleEffectFromOption(options: {
});
}
}