pick and place editing working, saving and loading working

This commit is contained in:
2025-02-09 02:54:17 -07:00
parent 8dc0af650f
commit 3d4596f8fb
13 changed files with 879 additions and 309 deletions

View File

@@ -37,6 +37,13 @@ export function getContext() {
export function getContextItem<T>(prop: string): T {
return ctx[prop] as T;
}
export function getContextItemOrDefault<T>(prop: string, defaultValue: T): T {
try {
return ctx[prop] as T;
} catch {
return defaultValue;
}
}
export function setContextItem<T>(prop: string, value: T) {
Object.assign(contextStack[contextStack.length - 1] ?? defaultContext, {
[prop]: value,