Update runtime global state to include clock state and modify scene build to use project time settings

This commit is contained in:
2026-04-12 04:30:49 +02:00
parent 40b3ed560a
commit ff5df14ac6
2 changed files with 18 additions and 2 deletions

View File

@@ -1,3 +1,10 @@
import { createDefaultProjectTimeSettings } from "../document/project-time-settings";
import {
createRuntimeClockState,
type RuntimeClockState
} from "./runtime-project-time";
export interface RuntimeSceneTransitionRecord {
fromSceneId: string;
fromSceneName: string;
@@ -12,13 +19,17 @@ export interface RuntimeGlobalState {
activeMusicCueId: string | null;
transitionCount: number;
lastSceneTransition: RuntimeSceneTransitionRecord | null;
clock: RuntimeClockState;
}
export function createDefaultRuntimeGlobalState(): RuntimeGlobalState {
export function createDefaultRuntimeGlobalState(
timeSettings = createDefaultProjectTimeSettings()
): RuntimeGlobalState {
return {
flags: {},
activeMusicCueId: null,
transitionCount: 0,
lastSceneTransition: null
lastSceneTransition: null,
clock: createRuntimeClockState(timeSettings)
};
}