initial demo support

This commit is contained in:
Brian Beck 2026-02-28 17:58:09 -08:00
parent 0f2e103294
commit 359a036558
406 changed files with 10513 additions and 1158 deletions

View file

@ -1,18 +1,9 @@
import type { TorqueObject } from "../torqueScript";
import { useRuntime } from "./RuntimeProvider";
import { useDatablockByName } from "../state";
/**
* Look up a datablock by name from the runtime. Use with getProperty/getInt/getFloat.
*
* FIXME: This is not currently reactive! If new datablocks are defined, this
* won't find them. We'd need to add an event/subscription system to the runtime
* that fires when new datablocks are defined. Technically we should do the same
* for the scene graph.
*/
/** Look up a datablock by name from runtime state (reactive). */
export function useDatablock(
name: string | undefined,
): TorqueObject | undefined {
const runtime = useRuntime();
if (!name) return undefined;
return runtime.state.datablocks.get(name);
return useDatablockByName(name);
}