mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-03-23 22:29:31 +00:00
new UI, unify map/demo/live architecture more, cleanup
This commit is contained in:
parent
d9b5e30831
commit
4741f59582
146 changed files with 5477 additions and 3005 deletions
|
|
@ -42,7 +42,10 @@ export interface EngineStoreState {
|
|||
playback: PlaybackSliceState;
|
||||
setRuntime(runtime: TorqueRuntime): void;
|
||||
clearRuntime(): void;
|
||||
applyRuntimeBatch(events: RuntimeMutationEvent[], tickInfo?: RuntimeTickInfo): void;
|
||||
applyRuntimeBatch(
|
||||
events: RuntimeMutationEvent[],
|
||||
tickInfo?: RuntimeTickInfo,
|
||||
): void;
|
||||
setRecording(recording: StreamRecording | null): void;
|
||||
setPlaybackTime(ms: number): void;
|
||||
setPlaybackStatus(status: PlaybackStatus): void;
|
||||
|
|
@ -65,7 +68,9 @@ function clamp(value: number, min: number, max: number): number {
|
|||
return value;
|
||||
}
|
||||
|
||||
function buildRuntimeIndexes(runtime: TorqueRuntime): Pick<
|
||||
function buildRuntimeIndexes(
|
||||
runtime: TorqueRuntime,
|
||||
): Pick<
|
||||
RuntimeSliceState,
|
||||
| "objectVersionById"
|
||||
| "globalVersionByName"
|
||||
|
|
@ -165,7 +170,10 @@ export const engineStore = createStore<EngineStoreState>()(
|
|||
}));
|
||||
},
|
||||
|
||||
applyRuntimeBatch(events: RuntimeMutationEvent[], tickInfo?: RuntimeTickInfo) {
|
||||
applyRuntimeBatch(
|
||||
events: RuntimeMutationEvent[],
|
||||
tickInfo?: RuntimeTickInfo,
|
||||
) {
|
||||
if (events.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -249,11 +257,14 @@ export const engineStore = createStore<EngineStoreState>()(
|
|||
...state,
|
||||
playback: {
|
||||
recording,
|
||||
status: "stopped",
|
||||
timeMs: 0,
|
||||
rate: 1,
|
||||
status: recording ? "stopped" : state.playback.status,
|
||||
timeMs: recording ? 0 : state.playback.timeMs,
|
||||
rate: recording ? 1 : state.playback.rate,
|
||||
durationMs,
|
||||
streamSnapshot: null,
|
||||
// Preserve the last snapshot so HUD/chat persist after unload.
|
||||
streamSnapshot: recording
|
||||
? null
|
||||
: state.playback.streamSnapshot,
|
||||
},
|
||||
}));
|
||||
},
|
||||
|
|
@ -301,7 +312,6 @@ export const engineStore = createStore<EngineStoreState>()(
|
|||
},
|
||||
}));
|
||||
},
|
||||
|
||||
})),
|
||||
);
|
||||
|
||||
|
|
@ -475,4 +485,3 @@ export function useRuntimeChildIds(
|
|||
|
||||
return parent._children.map((child) => child._id);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue