Create and delete procedural objects from the studio's entry list

A view's entries can now be created from a starter tree in a chosen folder and deleted from the browser. Deleting lists the pack files that still name the entry, then moves it to the desktop trash, or the pack's .iris/trash where there is none. An EditableSceneView opts in with SceneCreation; the host does the writing.

v3: d6e6fc3ef
This commit is contained in:
piexel committed 2026-11-10 13:42:30 +01:00
1 parent 7eb45cebf6
commit 3c03bba7e7
19 files changed
+760 -32

No files matched your search

@@ -20,4 +20,9 @@ public interface EditableSceneView extends SceneView {
* @throws IllegalArgumentException when {@code text} does not hold what this view edits
*/
NodeGraph graph(PackWorld world, String key, JsonText text);
/** How the studio creates and removes entries of this view; empty when it may not, which is the default. */
default Optional<SceneCreation> creation() {
return Optional.empty();
}
}
@@ -0,0 +1,18 @@
package com.volmit.tooling;
import com.volmit.resource.ResourceKind;
import java.util.Objects;
/**
* How the studio creates and removes the entries of an editable scene view: each entry is a file of {@code kind}, a new
* one starts as the JSON text {@code starter}, and other files of the pack name an entry {@code key} as
* {@code referencePrefix + key}, which is how the studio finds what still uses an entry before it is removed.
*/
public record SceneCreation(ResourceKind<?> kind, String starter, String referencePrefix) {
public SceneCreation {
Objects.requireNonNull(kind, "kind");
Objects.requireNonNull(starter, "starter");
Objects.requireNonNull(referencePrefix, "referencePrefix");
}
}