Add the Variable node and show the variable name in node titles

Get/Set variable nodes now title themselves "Get <name>" / "Set <name>", and
the new Variable node just "<name>"; the title is the same folded or open,
and a collapsed node shrinks to it. The redundant "Variable: <name>" row is
gone unless the variable was deleted ("<name>?" is the only hint then).

The Variable node sets its value when an exec flow arrives and exposes the
value at any time. Its output is read when a downstream node pulls it, not
frozen at the write, so count = count + 1 is one Variable node plus an Add.
Get variable keeps reading once per pulse: switching it would change the
behaviour of existing games.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rootandClaude Opus 5 committed 2026-09-11 13:34:09 +02:00
1 parent 5f8a308d62
commit e9fa592078
19 files changed
+354 -38

No files matched your search

+5
View File
@@ -21,6 +21,11 @@ export function foldMarkKey(
return `${side.node}\0${collapsed ? '' : side.port}\0${isOutput ? 'out' : 'in'}`;
}
/** A collapsed node is as wide as its title needs, but never wider than an open one. */
export function collapsedNodeWidth(titleWidth: number, chrome: number, openWidth: number): number {
return Math.min(openWidth, Math.ceil(titleWidth + chrome));
}
/** One name plus a count: three names do not fit, and the count is what says "there is more here". */
export function foldMarkLabel(names: readonly string[]): string {
if (names.length === 0) return '';