Refactor and update project schedule routines and options
This commit is contained in:
@@ -348,8 +348,7 @@ import {
|
|||||||
getProjectScheduleEffectOptionId,
|
getProjectScheduleEffectOptionId,
|
||||||
getProjectScheduleTargetOptionByKey,
|
getProjectScheduleTargetOptionByKey,
|
||||||
listProjectScheduleEffectOptions,
|
listProjectScheduleEffectOptions,
|
||||||
listProjectScheduleTargetOptions,
|
listProjectScheduleTargetOptions
|
||||||
type ProjectScheduleEffectOptionId
|
|
||||||
} from "../scheduler/project-schedule-control-options";
|
} from "../scheduler/project-schedule-control-options";
|
||||||
import {
|
import {
|
||||||
loadProjectPackage,
|
loadProjectPackage,
|
||||||
|
|||||||
@@ -20,6 +20,14 @@ import {
|
|||||||
type ProjectScheduleRoutine
|
type ProjectScheduleRoutine
|
||||||
} from "../scheduler/project-scheduler";
|
} from "../scheduler/project-scheduler";
|
||||||
|
|
||||||
|
type ActorPresenceScheduleRoutine = ProjectScheduleRoutine & {
|
||||||
|
target: {
|
||||||
|
kind: "actor";
|
||||||
|
actorId: string;
|
||||||
|
};
|
||||||
|
effect: SetActorPresenceControlEffect;
|
||||||
|
};
|
||||||
|
|
||||||
export interface RuntimeResolvedActorScheduleState {
|
export interface RuntimeResolvedActorScheduleState {
|
||||||
actorId: string;
|
actorId: string;
|
||||||
hasRules: boolean;
|
hasRules: boolean;
|
||||||
@@ -97,10 +105,10 @@ export function createRuntimeProjectSchedulerState(options: {
|
|||||||
function resolveActorScheduleRules(
|
function resolveActorScheduleRules(
|
||||||
scheduler: ProjectScheduler,
|
scheduler: ProjectScheduler,
|
||||||
actorId: string
|
actorId: string
|
||||||
): ProjectScheduleRoutine[] {
|
): ActorPresenceScheduleRoutine[] {
|
||||||
return Object.values(scheduler.routines)
|
return Object.values(scheduler.routines)
|
||||||
.filter(
|
.filter(
|
||||||
(routine) =>
|
(routine): routine is ActorPresenceScheduleRoutine =>
|
||||||
routine.enabled &&
|
routine.enabled &&
|
||||||
routine.target.kind === "actor" &&
|
routine.target.kind === "actor" &&
|
||||||
routine.target.actorId === actorId &&
|
routine.target.actorId === actorId &&
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import {
|
|||||||
} from "../controls/control-surface";
|
} from "../controls/control-surface";
|
||||||
import { getModelInstances } from "../assets/model-instances";
|
import { getModelInstances } from "../assets/model-instances";
|
||||||
import { getModelInstanceDisplayLabel } from "../assets/model-instance-labels";
|
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";
|
import { listProjectNpcActors } from "../entities/npc-actor-registry";
|
||||||
|
|
||||||
export const PROJECT_SCHEDULE_EFFECT_OPTION_IDS = [
|
export const PROJECT_SCHEDULE_EFFECT_OPTION_IDS = [
|
||||||
@@ -311,7 +311,7 @@ export function listProjectScheduleTargetOptions(
|
|||||||
groupLabel: "Model Instances",
|
groupLabel: "Model Instances",
|
||||||
defaults: {
|
defaults: {
|
||||||
animationClipNames,
|
animationClipNames,
|
||||||
animationLoop: modelInstance.animationLoop ?? true
|
animationLoop: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -690,4 +690,3 @@ export function createProjectScheduleEffectFromOption(options: {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user