A struct used to declare its fields wherever it stood. The same shape in two variables meant typing it twice, and Pack/Expand copied it once without staying in sync. A Struct asset now holds the shape in one place, and every struct that picks it as its type follows it. - New asset type "Struct" (not placeable, group Structs, own icon). The inspector shows its fields with name, kind and default value, and "Open" shows them in the variables tab. - Struct variables and struct fields get a Type row: own fields, any Struct asset, or "Make struct type". With a type the fields come from the asset and cannot be added, renamed or removed there. The values stay per variable, overrides on placed objects still work. - Pack and Expand get the setting Type. With a type their ports are the fields of the asset and read-only in the inspector. - A change to the asset reaches every typed place in one undo step (syncStructTypes). A new field arrives with its default. A removed field goes along with its port, edge and typed value. A renamed field keeps its value in variables, overrides and on ports with edges, also through nested types. - Undo for these edits records plain assignments (Recorder), because the reach of a change is not known in advance. - Cycles such as Loot in Loot, also through another type, are refused and not offered in the picker. - Deleting the asset names how many places use it. Afterwards each place keeps its fields as its own. - Loading reshapes a stale copy in a project file to its type. - "Make struct type" creates an asset from an existing struct and links the place to it. Differs from the plan: - A changed default value applies to new fields and newly typed places only. Existing values stay. - Removing a single field shows no warning. Undo brings it back. Typed lists are left for #254. Lists stay dynamic for now. Found by e2e: after deleting or renaming the type the inspector did not rebuild and kept showing the old name. Fixed, the check was red before. Tests: - ./check.sh: 182 files, 2661 tests, CHECK EXIT 0 - GM_STEPS=1,4,21,22,54: ALL PASSED, 176 checks - 14 unit tests in tests/core/struct-types.test.ts - New e2e module 54 with 14 checks, real mouse. Module 04 counts 23 asset types. - Counter-probes: without the rename pass 4 unit tests fail, without reshaping values 8, without the cycle rule 1. In the browser, without spreading changes and with + Field despite a type, 3 checks fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
117 lines
3.4 KiB
JavaScript
117 lines
3.4 KiB
JavaScript
/**
|
|
* The e2e steps in the order they run. Each step is `async (t) => {}` over the harness
|
|
* toolbox; later steps rely on the scene state earlier ones leave behind (names given in
|
|
* the parenting step, the container created in the container step, …).
|
|
*/
|
|
import { hierarchy } from './01-hierarchy.mjs';
|
|
import { inspector } from './02-inspector.mjs';
|
|
import { play } from './03-play.mjs';
|
|
import { assets } from './04-assets.mjs';
|
|
import { drawing } from './05-drawing.mjs';
|
|
import { graph } from './06-graph.mjs';
|
|
import { parenting } from './07-parenting.mjs';
|
|
import { colliders } from './08-colliders.mjs';
|
|
import { containers } from './09-containers.mjs';
|
|
import { textAndEnabled } from './10-text-and-enabled.mjs';
|
|
import { menus } from './11-menus.mjs';
|
|
import { textures } from './12-textures.mjs';
|
|
import { frames } from './13-frames.mjs';
|
|
import { overflow } from './14-overflow.mjs';
|
|
import { aspect } from './15-aspect.mjs';
|
|
import { containerTab } from './16-container.mjs';
|
|
import { editorRun } from './17-editor-run.mjs';
|
|
import { pause } from './18-pause.mjs';
|
|
import { nestedBehavior } from './19-nested-behavior.mjs';
|
|
import { keyRepeat } from './20-key-repeat.mjs';
|
|
import { listTab } from './21-list.mjs';
|
|
import { structVariable } from './22-struct.mjs';
|
|
import { variableNodes } from './23-variable-nodes.mjs';
|
|
import { propertyNodes } from './24-property-nodes.mjs';
|
|
import { animation } from './25-animation.mjs';
|
|
import { stateMachine } from './26-state-machine.mjs';
|
|
import { consolePanel } from './27-console.mjs';
|
|
import { shader } from './28-shader.mjs';
|
|
import { transform } from './29-transform.mjs';
|
|
import { font } from './30-font.mjs';
|
|
import { particles } from './31-particles.mjs';
|
|
import { scope } from './32-scope.mjs';
|
|
import { renderOnChange } from './33-render-on-change.mjs';
|
|
import { sound } from './34-sound.mjs';
|
|
import { loadScene } from './35-load-scene.mjs';
|
|
import { graphGroups } from './36-graph-groups.mjs';
|
|
import { nineSlice } from './37-nine-slice.mjs';
|
|
import { plugins } from './38-plugins.mjs';
|
|
import { tile } from './39-tile.mjs';
|
|
import { tilemap } from './40-tilemap.mjs';
|
|
import { physics } from './41-physics.mjs';
|
|
import { shapes } from './42-shapes.mjs';
|
|
import { queries } from './43-queries.mjs';
|
|
import { documents } from './44-documents.mjs';
|
|
import { login } from './45-login.mjs';
|
|
import { topbar } from './46-topbar.mjs';
|
|
import { vectorArt } from './47-vectorart.mjs';
|
|
import { pixelArt } from './48-pixelart.mjs';
|
|
import { users } from './49-users.mjs';
|
|
import { snapshots } from './50-snapshots.mjs';
|
|
import { clipboard } from './51-clipboard.mjs';
|
|
import { hierarchyGroups } from './52-hierarchy-groups.mjs';
|
|
import { curves } from './53-curves.mjs';
|
|
import { structTypes } from './54-struct-types.mjs';
|
|
|
|
export const STEPS = [
|
|
hierarchy,
|
|
inspector,
|
|
play,
|
|
assets,
|
|
drawing,
|
|
graph,
|
|
parenting,
|
|
colliders,
|
|
containers,
|
|
textAndEnabled,
|
|
menus,
|
|
textures,
|
|
frames,
|
|
overflow,
|
|
aspect,
|
|
containerTab,
|
|
editorRun,
|
|
pause,
|
|
nestedBehavior,
|
|
keyRepeat,
|
|
listTab,
|
|
structVariable,
|
|
variableNodes,
|
|
propertyNodes,
|
|
animation,
|
|
stateMachine,
|
|
consolePanel,
|
|
shader,
|
|
transform,
|
|
font,
|
|
particles,
|
|
scope,
|
|
renderOnChange,
|
|
sound,
|
|
loadScene,
|
|
graphGroups,
|
|
nineSlice,
|
|
plugins,
|
|
tile,
|
|
tilemap,
|
|
physics,
|
|
shapes,
|
|
queries,
|
|
documents,
|
|
login,
|
|
topbar,
|
|
vectorArt,
|
|
pixelArt,
|
|
users,
|
|
snapshots,
|
|
clipboard,
|
|
hierarchyGroups,
|
|
curves,
|
|
structTypes,
|
|
];
|