mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
JsonText parses a pack file and splices it while keeping its formatting (v3e's JsonSource). EditableSceneView tells the studio which file an entry is written in and reads that file as a NodeGraph: nodes at JSON paths with their part id, roles, settings types and what can be added.
24 lines
959 B
Java
24 lines
959 B
Java
package com.volmit.tooling;
|
|
|
|
import com.volmit.world.PackWorld;
|
|
|
|
import java.util.Optional;
|
|
|
|
/**
|
|
* A scene view whose entries are each written in one file of the pack, which the studio shows as a graph of nodes and
|
|
* rewrites as they are edited. The studio reads and writes the file; the view only tells it which file an entry is and
|
|
* how that file's text reads as nodes.
|
|
*/
|
|
public interface EditableSceneView extends SceneView {
|
|
/** The file entry {@code key} is written in; empty when it has none of its own. */
|
|
Optional<SceneFile> fileOf(PackWorld world, String key);
|
|
|
|
/**
|
|
* {@code text}, the file of entry {@code key}, as nodes. The pack may not have read this text yet, so a node whose
|
|
* part the scene does not show yet has {@link GraphNode#NO_PART}.
|
|
*
|
|
* @throws IllegalArgumentException when {@code text} does not hold what this view edits
|
|
*/
|
|
NodeGraph graph(PackWorld world, String key, JsonText text);
|
|
}
|