Refactor and update project schedule routines and options
This commit is contained in:
@@ -348,8 +348,7 @@ import {
|
||||
getProjectScheduleEffectOptionId,
|
||||
getProjectScheduleTargetOptionByKey,
|
||||
listProjectScheduleEffectOptions,
|
||||
listProjectScheduleTargetOptions,
|
||||
type ProjectScheduleEffectOptionId
|
||||
listProjectScheduleTargetOptions
|
||||
} from "../scheduler/project-schedule-control-options";
|
||||
import {
|
||||
loadProjectPackage,
|
||||
|
||||
@@ -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 &&
|
||||
|
||||
@@ -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: {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user