mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
Add JsonText, JsonPath and EditableSceneView for the studio node editor
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.
This commit is contained in:
1 parent
2befcb9487
commit
d0b57a4886
7 files changed
+742
No files matched your search
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
Reference in new issue
Block a user