Add Get/Set properties nodes and a breadcrumb for opened sub-behaviors
Get properties / Set properties work like their variable counterparts:
one port per chosen property, an unconnected input writes its inline
value. A port chosen from the built-in list keeps that property's field
and default (height starts at 100, color is a colour field). "object" is
reserved for the fixed input, checked by the command and on load.
The property picker names the owning type ("Sprite width"), and text
fields can now carry a suggestion list; Get/Set property use it.
Double-clicking a call node shows the path of opened behaviors under the
graph header. Clicking an entry jumps back and trims the path; choosing
a behavior any other way hides it. Reopening a behavior already on the
path steps back to it instead of repeating it. The bar shows before the
graph switches, otherwise it clips the graph that was just fitted.
The "Add node..." header button is gone; nodes come from the context menu.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e9fa592078
commit
854ae2e756
35 files changed
+1044
-101
No files matched your search
@@ -49,6 +49,7 @@ const run = (type: string, c: Case): { result: RunResult; ctx: FakeContext } =>
|
||||
};
|
||||
|
||||
const at = (name: string, x: number, y: number) => ({ ...fakeEntity(name), x, y });
|
||||
const painted = fakeHandle({ width: 100, text: '' });
|
||||
|
||||
const pointer = (overrides: Partial<NodeContext['pointer']>): Partial<NodeContext> => ({
|
||||
pointer: { ...NO_POINTER, ...overrides },
|
||||
@@ -221,6 +222,29 @@ const CASES: Record<string, Case[]> = {
|
||||
},
|
||||
{ name: 'no object is off', inputs: { object: null }, outputs: { result: false, own: false } },
|
||||
],
|
||||
GetProperties: [
|
||||
{
|
||||
name: 'reads one output per property it names',
|
||||
ports: [
|
||||
{ key: 'width', kind: 'number' },
|
||||
{ key: 'speed', kind: 'number' },
|
||||
],
|
||||
inputs: { object: fakeHandle({ width: 42, speed: 3 }) },
|
||||
outputs: { width: 42, speed: 3 },
|
||||
},
|
||||
{
|
||||
name: 'an absent property reads as null',
|
||||
ports: [{ key: 'radius', kind: 'number' }],
|
||||
inputs: { object: fakeHandle({}) },
|
||||
outputs: { radius: null },
|
||||
},
|
||||
{
|
||||
name: 'no object reads null for every port',
|
||||
ports: [{ key: 'width', kind: 'number' }],
|
||||
inputs: { object: null },
|
||||
outputs: { width: null },
|
||||
},
|
||||
],
|
||||
GetProperty: [
|
||||
{
|
||||
name: 'reads a property',
|
||||
@@ -617,6 +641,24 @@ const CASES: Record<string, Case[]> = {
|
||||
outputs: { blockedX: false, blockedY: false },
|
||||
},
|
||||
],
|
||||
SetProperties: [
|
||||
{
|
||||
name: 'writes every property it names, each keeping the type it already had',
|
||||
ports: [
|
||||
{ key: 'width', kind: 'number' },
|
||||
{ key: 'text', kind: 'text' },
|
||||
],
|
||||
inputs: { object: painted, width: '250', text: 7 },
|
||||
next: 'exec',
|
||||
after: () => expect(painted.props).toEqual({ width: 250, text: '7' }),
|
||||
},
|
||||
{
|
||||
name: 'no object is a no-op',
|
||||
ports: [{ key: 'width', kind: 'number' }],
|
||||
inputs: { object: null, width: 5 },
|
||||
next: 'exec',
|
||||
},
|
||||
],
|
||||
SetPosition: [
|
||||
{
|
||||
name: 'places the object and continues',
|
||||
|
||||
Reference in new issue
Block a user