Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3770 +/- ##
==========================================
+ Coverage 59.95% 60.07% +0.12%
==========================================
Files 772 772
Lines 27728 27732 +4
Branches 5231 5235 +4
==========================================
+ Hits 16625 16661 +36
+ Misses 9590 9555 -35
- Partials 1513 1516 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Review: directory-format tilemap loading
The change to DumbTilemap.load is focused and well-covered by tests (both formats, the no-decorator directory variant, and the missing-file error path). A couple of points in the resource-collection logic are worth a look before merge, plus two minor nits.
Main point — others unconditionally scans assets/tilemaps/. See the inline comment on the others construction. For a directory-format tilemap that lives outside assets/tilemaps/ (the worlds/river case in the new test), every file under assets/tilemaps/ is still pulled into this tilemap's file set — the test's unrelated assets/tilemaps/other/map.json ends up in the exported files, which expect(exported).toEqual(files) happens to accept only because that stray file is in the fixture. If that cross-tree sweep is intended for back-compat, a one-line comment would help; if not, scanning only resourcesPath removes both this and the double enumeration.
Minor nits (not blocking):
gui/src/models/spx/tilemap.ts:328—decoratorFileis cast toRawTilemapConfig, but for directory format it isdecorator.json({ version, decorators }), which has notilemap/sprites. Only.decoratorsis read, so this is harmless, but a narrower type (e.g.Pick<RawTilemapConfig, 'decorators'>) would describe the shape honestly and avoid conflatingdecorator.jsonwith the full tilemap config.- The user-facing
tilemapPathfield (project.ts:73) now accepts a directory, but that isn't documented anywhere outside the tests. A short note on the field (requiredtilemap.json, optionaldecorator.json) would prevent future drift.
Directory-format SPX maps use a directory as
tilemapPath(for example,tilemaps/river), but Builder currently looks up that path as a file and rejects the project. Resolve the directory'stilemap.json, load optionaldecorator.jsonwith directory-relative image paths, and retain the original directory path and map/resource files for export.Legacy JSON-file maps keep their existing loading behavior. Resource collection enumerates the file set once, preserving all maps under
assets/tilemaps/for runtimeloadTilemapcalls as well as resources in a selected directory outside that tree. Format selection follows SPX 4.0.1's.jsonsubstring rule, documented with a pinned source link. This change adds no tilemap editing UI, course migration, or engine dependency upgrade.Validation:
git diff --checkpass.Refs #3747.