Compare commits
30 Commits
5a3f633ab2
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c9e481a6c | ||
|
|
f1cddc3948 | ||
|
|
75655be72d | ||
|
|
4b8abc8502 | ||
|
|
176305e35b | ||
|
|
a150dd8dc5 | ||
|
|
61e7d5192f | ||
|
|
451da04cbd | ||
|
|
bde1f7acfa | ||
|
|
2734efa1a9 | ||
|
|
340dd5f700 | ||
|
|
46d1e78758 | ||
|
|
51138e257f | ||
|
|
6eacde3eaa | ||
|
|
e745be8d07 | ||
|
|
f06ef5e2cb | ||
|
|
398d3b4dd9 | ||
|
|
1945e91441 | ||
|
|
107eade2fa | ||
|
|
f2123ba79c | ||
|
|
9213d3f91b | ||
|
|
211056ac8c | ||
|
|
b5afe35df8 | ||
|
|
2c3015685c | ||
|
|
2eebd3d2d5 | ||
|
|
1a9daa8ce1 | ||
|
|
6956919414 | ||
|
|
15159d7fd5 | ||
|
|
e373aa8a1f | ||
|
|
1bf5f46924 |
86
README.md
86
README.md
@@ -1,11 +1,19 @@
|
||||
# sporel-module-map-editor
|
||||
|
||||
Interactive map editor for Sporel `.map.json` files. v0.2 series ships
|
||||
the Rev 4 UX architecture (see design paper
|
||||
Interactive map editor for Sporel `.map.json` files. Aufsetzend auf der
|
||||
Rev-4-UX-Architektur (siehe Design-Paper
|
||||
`design/2026-05-28-autotile-blob-styles-design.md` §11 in `sporel-meta`):
|
||||
top toolbar with mode-switch + actions, right Layers side-panel, bottom
|
||||
palette strip of material slot thumbnails, mouse drag-paint, and two
|
||||
mutually-exclusive paint modes (Auto-Tile vs Direct).
|
||||
Top-Toolbar mit Mode-Switch + Actions, rechtes Layers-Side-Panel, untere
|
||||
Palette-Strip mit Material-Slot-Thumbnails, Maus-Drag-Paint und drei
|
||||
Paint-Modi (Auto-Tile / Direct / Cell-Tile, mit Tab umschaltbar). Die
|
||||
v0.3.0- bis v0.4.0-Iterationen sind eingeflossen: v0.3.0 ersetzte die
|
||||
Toolbar durch eine Menu-Bar, v0.3.1 ergänzte den Cell-Tile-Modus, und
|
||||
v0.4.0 migrierte Toolbar, Layers-Panel und Palette auf
|
||||
`lib-core.panel`-Persistent-Widgets (Details siehe unten).
|
||||
|
||||
**Version:** 0.4.0
|
||||
**Module-ID:** map-editor
|
||||
**Requires:** lib-core.maps v0.5.7, lib-core.render v0.2.0, lib-core.composition v0.4.0, lib-core.camera v0.3.0, lib-core.input v0.4.0, lib-core.panel v0.4.0, lib-asset.prototype-blob-geom v0.1.0
|
||||
|
||||
## Run
|
||||
|
||||
@@ -113,3 +121,71 @@ SPOREL_CI=1 ./Sporel.exe --module=map-editor # exits with rc=0 after ~0.5 s
|
||||
- Design paper: `docs/design/2026-05-28-autotile-blob-styles-design.md`
|
||||
§11 in `sporel-meta`
|
||||
- Plan: `docs/superpowers/plans/2026-05-28-map-editor-blob-v2.md`
|
||||
|
||||
## Menu UI (v0.3.0)
|
||||
|
||||
Top toolbar replaced with a seven-category menu bar (File, Edit, View,
|
||||
Map, Tools, Window, Help) plus a sticky two-segment Mode-pill on the
|
||||
right end. Item types: action, modal, toggle, submenu, separator;
|
||||
items can be conditionally disabled. A single-stack modal framework
|
||||
hosts the existing Cheatsheet (I) and three new modals: Save As, Map
|
||||
Properties (read-only), About. The Esc key cascades modal -> menu ->
|
||||
quit.
|
||||
|
||||
New Map and Open Map appear in the File menu as disabled placeholders
|
||||
pending a v3-aware maps.create and an engine.asset.list_dir in a
|
||||
future engine + lib slice.
|
||||
|
||||
All previous hotkeys (Tab, S, E, R, H, 0, D, G, I, Esc) continue to
|
||||
work; their bindings are documented in the items where applicable
|
||||
and in the in-editor Cheatsheet modal.
|
||||
|
||||
## Cell-Tile Mode (v0.3.1)
|
||||
|
||||
Third painting mechanic alongside Auto-Tile and Direct. LMB paints a
|
||||
per-cell material flag at the cursor cell; RMB clears it. The
|
||||
renderer uses the classical 47-blob 8-neighbour bitmask for
|
||||
cell-tile cells, unlocking the 9 atlas slots that Auto-Tile's
|
||||
dual-grid 4-corner rule structurally cannot reach (isolated, end,
|
||||
corner_open, straight, tee_open, tee_half, cross_open, cross_q1,
|
||||
cross_q2adj).
|
||||
|
||||
Auto-Tile (vertex-paint, 5 reachable slots, dual-grid look) and
|
||||
Direct (manual override placement, all 14 slots via explicit pick)
|
||||
are unchanged. Tab cycles through all three modes.
|
||||
|
||||
For clean visuals, use a single painting mode per layer. Mixing
|
||||
Vertex-Tile and Cell-Tile material in the same layer is allowed but
|
||||
produces an asymmetric seam at the boundary because vertex-tile
|
||||
cells are structurally blind to their cell-tile neighbours.
|
||||
|
||||
See `sporel-meta/docs/superpowers/specs/2026-06-01-map-editor-cell-tile-mode-design.md`
|
||||
for the full design rationale and the Boris-taxonomy background.
|
||||
|
||||
## Panel-Lib Migration (v0.4.0)
|
||||
|
||||
The top toolbar, right-side Layers panel, and bottom palette strip
|
||||
have been migrated to `lib-core.panel` v0.3.0 persistent widgets
|
||||
(W.2 of the panel-window-manager plan):
|
||||
|
||||
| Widget ID | Layout slot | Role |
|
||||
|-----------|-------------|------|
|
||||
| `map-editor.toolbar` | top strip (full width, 290 px) | Menu bar + mode-pill + open-dropdown |
|
||||
| `map-editor.layers` | right side-panel (160 px wide) | Layer rows + roof toggle |
|
||||
| `map-editor.palette` | bottom strip (full width, 64 px) | Tile-thumbnail swatches |
|
||||
|
||||
All three are registered as `persistent=true` (open from module-init,
|
||||
not dismissed by ESC), `input_block="self"` (hit-test claims clicks
|
||||
within own bounds; misses fall through to canvas), and `chromeless=true`
|
||||
(panel-lib skips its title-bar / border / close-X — the widgets paint
|
||||
their own existing style). The map-canvas is NOT a panel widget — it
|
||||
remains module-rendered between `camera.begin/finish`. Canvas drag-paint
|
||||
is gated on `panel.point_in_any_panel(mx, my)` so widget clicks no
|
||||
longer bleed through into the underlying map cells.
|
||||
|
||||
The Window menu's `Layers Panel` / `Palette` toggles now flip the
|
||||
persistent widgets' open-state via `panel.toggle(id)` directly.
|
||||
|
||||
Modals (cheatsheet, save-as, map-properties, about) and the bottom-left
|
||||
status chip stay module-rendered (drawn AFTER `panel.render()` so they
|
||||
appear on top of widget panels).
|
||||
|
||||
21
manifest.launcher.md
Normal file
21
manifest.launcher.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
{"summary":"Map editor — menu-bar toolbar, three paint modes, Layers-Panel + Palette","author":"calic","tags":["tool","map-editor"],"teaser_images":[]}
|
||||
---
|
||||
|
||||
# Map Editor
|
||||
|
||||
Click-to-paint tile editor with a top menu-bar (File / Edit / View / Map / Tools / Window / Help) plus Mode-pill, a right-side Layers-Panel and a bottom Palette-Strip with atlas-tile thumbnails. Three paint modes — Auto-Tile, Direct and Cell-Tile — cycle with Tab.
|
||||
|
||||
## Controls
|
||||
|
||||
- Mouse-left on canvas: paint (mode-dependent)
|
||||
- Mouse-right on canvas: clear/erase
|
||||
- Mouse-left on layer row: switch active layer
|
||||
- Mouse-right on layer row: toggle visibility
|
||||
- Mouse-left on palette swatch: select active slot
|
||||
- Tab: cycle paint mode (Auto-Tile / Direct / Cell-Tile)
|
||||
- E: erase tile at cursor
|
||||
- R: rotate · H: flip · 0: reset transform
|
||||
- S: save
|
||||
- I: cheatsheet
|
||||
- ESC: close modal / menu, else quit to launcher
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"id": "map-editor",
|
||||
"version": "0.2.0c.4",
|
||||
"version": "0.4.0",
|
||||
"kind": "module",
|
||||
"api": "^0.1",
|
||||
"ci_frames": 30,
|
||||
@@ -9,10 +9,12 @@
|
||||
"blob_rect_stone": "lib-asset.prototype-blob-geom"
|
||||
},
|
||||
"deps": [
|
||||
{"id":"lib-core.maps","version":"0.5.6"},
|
||||
{"id":"lib-core.render","version":"0.1.0"},
|
||||
{"id":"lib-core.maps","version":"0.5.7"},
|
||||
{"id":"lib-core.render","version":"0.3.0"},
|
||||
{"id":"lib-core.composition","version":"0.4.0"},
|
||||
{"id":"lib-core.camera","version":"0.3.0"},
|
||||
{"id":"lib-core.input","version":"0.4.0"},
|
||||
{"id":"lib-core.panel","version":"0.4.0"},
|
||||
{"id":"lib-asset.prototype-blob-geom","version":"0.1.0"}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user