Make the Caves view a viewer only

The Caves view no longer edits cave files. It shows each cave at the
chosen size and variant, and redraws when a file is saved. The form,
creating caves from the studio and EditableSceneView.showsNodes() are
gone.
This commit is contained in:
piexel committed 2026-11-13 09:53:30 +01:00
1 parent 263f5baa3c
commit 22d69f362f
9 files changed
+14 -151

No files matched your search

-2
View File
@@ -40,8 +40,6 @@ export interface SceneEntry {
export interface SceneViewInfo extends ModuleViewInfo {
editable: boolean
creatable: boolean
/** Whether an editable view's files show as nodes under the scene; else as one node's settings beside it. */
nodes: boolean
baked: boolean
parts: boolean
/** The sizes the scenes can be built at, or null when each entry has its own. */
@@ -65,10 +65,8 @@ export function SceneStudio({ client, view, packRevision, onSummary, tell }: Sce
const bakeTiming = useBakeTiming(client, view.id, entry?.key ?? null, view.baked, packRevision, tell)
const editor = useNodeEditor(client, view.id, view.editable ? (entry?.key ?? null) : null, packRevision, tell)
const editsAsForm = view.editable && !view.nodes
const [selectedPath, setSelectedPath] = useState<JsonPath | null>(null)
const roots = editor.state?.roots ?? null
const selected = roots === null ? null : editsAsForm ? (roots[0] ?? null) : selectedPath !== null ? nodeWithPath(roots, selectedPath) : null
const selected = editor.state?.roots != null && selectedPath !== null ? nodeWithPath(editor.state.roots, selectedPath) : null
const values = useMemo(() => (editor.state === null ? undefined : parsedText(editor.state.text)), [editor.state])
const suggestions = useMemo(() => new SuggestionStore((of) => client.suggestions(of)), [client, packRevision])
@@ -133,7 +131,7 @@ export function SceneStudio({ client, view, packRevision, onSummary, tell }: Sce
onSize={(next) => setChosenSize({ viewId: view.id, size: next })}
onPick={view.parts ? pickPart : undefined}
/>
{view.editable && !editsAsForm && entry !== null && (
{view.editable && entry !== null && (
<NodePane
editor={editor}
entryKey={entry.key}