Commit Graph

7 Commits

Author SHA1 Message Date
calic
35d9940d63 feat(map-editor): v0.2.0a — Rev 4 layout reorg + mode switch + cheatsheet
Layout (per design paper §11):
 - Top toolbar with Mode buttons (Auto-Tile / Direct), Save, Erase,
   Rotate, Help.
 - Right Layers side-panel (8 rows, top-down draw order) as single
   source of truth for visibility + active layer — replaces the old
   left-edge layer chips.
 - Bottom status bar.

State + actions:
 - mode = "auto-tile" | "direct" (Tab toggles).
 - cheatsheet_open modal toggle (I key, dimmed overlay + key/action
   table).
 - SPOREL_CI=1 auto-exits after 30 frames (matches vagrant pattern;
   ci_frames in manifest is not engine-enforced for kind:"module").

Paint behaviour itself is unchanged from 0.1.0 — bottom palette + the
real Auto-Tile / Direct paint loops land in 0.2.0b/c/d.

deps: lib-core.maps 0.5.1 -> 0.5.2 (consumes set_vertex / get_vertex).
2026-05-28 23:56:02 +02:00
Calic
8f5e59a9f7 Drop stale engine-binding-missing NOTE comments
The draw_rect_lines and draw_line bindings exist now; the inline
NOTE comments warning about missing bindings are stale.
2026-05-24 03:21:19 +02:00
Calic
e87948a3ca Wrap map draw in camera.begin/finish so world-space transforms apply
Without the camera scope, maps.draw_map() rendered the map at
screen coords starting at (0,0) regardless of camera.set_target,
and screen_to_world's inverse produced bogus cell coords (mouse
in screen-center mapped to top-left tile). Spine-prototype's
render() shows the right pattern: world-space draws inside
camera.begin/finish, screen-space overlays after.
2026-05-24 03:17:16 +02:00
Calic
2e25833a93 Rename draw() hook to render() so the engine actually calls it
The engine module-lifecycle looks up HOOK_RENDER by the global
name 'render' (engine_module_lifecycle.c:166). The previous draw()
function was a global with no caller, so the editor's UI never
rendered — the engine fell back to its 'no render hook defined'
placeholder.
2026-05-24 03:12:27 +02:00
Calic
66997be86b Inline state/actions/ui into init.lua
The engine's Lua sandbox rejects require() for non-declared-dep
module names like 'src.state'. Multi-file modules in this codebase
either inline everything (spine-prototype, vagrant-skeleton) or
use dofile (lib-sporel.launcher). For three modules that share a
state singleton, dofile would cause state divergence. Cleanest
fix is to inline all three into init.lua via IIFE-wrapped local
module tables, preserving the file-internal namespacing while
satisfying the sandbox.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 03:08:03 +02:00
Calic
6d2d3ea26d Wire up editor: input bindings, frame hooks, launcher script
init.lua loads the work map, binds hotkeys (E/R/S/Esc), tracks
mouse-cell per frame, dispatches clicks to the UI hit-tester
and falls through to paint-cell for unconsumed map-area clicks.
run-map-editor.sh handles copy-in/copy-out for a real target map
or runs in-place against the module's work slot.
2026-05-24 01:22:49 +02:00
Calic
9d41ba8890 Scaffold sporel-module-map-editor package
Empty launchable module with deps on lib-core.maps 0.4.0, render,
camera, input, and the fa_terrain_v1 asset alias. Renders the
default 4x4 empty work-map; interactive editing wired in
subsequent commits.
2026-05-24 01:04:44 +02:00