Replace the five variable nodes with one Variables node
A single node now lists any number of variables. Every entry is an output that reads the current value whenever it is pulled; an entry switched to Set is also an input and is written when the flow arrives. Exec pins only exist while at least one entry writes, and all inputs are read before any write, so one node can swap two variables. Get/Set variable, Get/Set variables and Variable are gone. Old project files are converted on load: each old node becomes a Variables node with the same variables, edges and typed values. A written port without a typed value now shows the zero of its kind on the node body, matching what the inspector shows and what the run writes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
854ae2e756
commit
7c63c884ef
40 files changed
+895
-590
No files matched your search
@@ -42,9 +42,12 @@ export const node = (id, type, x, y, params = {}, ports) => ({
|
||||
...(ports ? { ports } : {}),
|
||||
});
|
||||
|
||||
/** A port a behavior's start or end node declares. */
|
||||
/** A port a node declares: an input of a start node, a field of a struct, a variable read by `Variables`. */
|
||||
export const port = (key, kind) => ({ key, kind });
|
||||
|
||||
/** A variable a `Variables` node writes as well as reads. */
|
||||
export const written = (key, kind) => ({ key, kind, write: true });
|
||||
|
||||
/**
|
||||
* A behavior variable declaration. `items` is the item kind of a `list`, `fields` the shape of a
|
||||
* `struct` – or of the items of a `list` whose items are structs.
|
||||
|
||||
Reference in new issue
Block a user