A list of structs used to let every item carry its own fields. Adding an item meant typing the same fields again, and nothing kept the items in step with the struct asset from #253. A list can now name a struct type for its items, and the asset keeps them in shape. - A list variable and a list field get the row Items with Mixed, every struct asset and Make struct type. Make struct type collects every field any item has, so no item loses a field. - A typed item carries its type under the key `$struct` (ITEM_TYPE_KEY). listItems does not count it as a field. - A list that holds anything but structs refuses a type, also when the offending item sits in an override. The console names the list and the count, and the list stays as it was. - In a typed list `+ Item` adds an item with the defaults, without the kind menu. Field names are locked, values stay editable. - The rows of a typed item take their kind from the struct asset (declaredKind in InlineList.ts). An asset field shows the asset picker instead of a text field, as reported in the issue. - A struct item in a mixed list gets its own Type row. Switching a list back to Mixed keeps the type on each item. - syncStructTypes brings marked items into shape and carries renames into them, also inside overrides and nested lists. One undo step. - The delete dialog of a struct asset also counts typed lists. - The game never sees the key. World and sharedState strip it with withoutItemTypes and bagWithoutItemTypes, so a struct stays a plain object at runtime. - Add item and Set item get the setting Type. With a type they only accept a struct with exactly its field names (fitsType in SetItem.ts). Anything else is left out and logged. - The item indent from #252 is back to its old width, the narrow one squeezed the value fields. Not done: writing a variable does not check the type, and the List node offers no type. Found on the way: a test helper in list-of-structs.test.ts called nodes without params. It now passes the same arguments as the interpreter. Tests: - ./check.sh: 183 files, 2679 tests, CHECK EXIT 0 - e2e GM_STEPS=1,21,22,32,54,55: ALL PASSED, 150 checks - e2e GM_STEPS=1-6,21,22,32,54,55 before the follow-up: 404 checks - New: tests/core/typed-lists.test.ts, e2e module 55 with 13 checks - Counter-checks bite in unit and browser, originals restored by cmp Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
119 lines
3.5 KiB
JavaScript
119 lines
3.5 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';
|
|
import { typedLists } from './55-typed-lists.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,
|
|
typedLists,
|
|
];
|