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.
Other module manifests (spine-prototype, vagrant-skeleton, etc.) use
the short directory name as the id, not the long 'sporel-module-X'
form which is reserved for the Gitea slug. The mismatch caused the
launcher script (which exports SPOREL_MODULE=map-editor) to fail
with ENGINE_ERR_MODULE_NOT_FOUND.
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>
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.
Vertical layer-chip column on the left edge (Roof up top with
divider, entity-slot dashed line between Lw and Ts), collapsible
atlas+tile picker bottom-left, status chip bottom-right. Each
frame redraws everything and dispatches mouse clicks via priority
hit-tests. Tile thumbnails are placeholder gray rects in v0.1.0
because lib-core.maps does not yet expose per-tile UVs to Lua.
paint_cell_at, erase_cell_at, cycle_rotation, save plus thin
wrappers for the UI hit-tests (set_active_layer/_atlas/_tile,
toggle_layer_visible/_roof_mode/_picker). Each action updates
state and delegates the actual map mutation to lib-core.maps.
Singleton table covering map id+path, active layer/atlas/tile/rot,
roof-mode flag, per-layer visibility flags, dirty flag, and picker
open/close state. Mutations go through setters so the test module
can verify state transitions without poking the internal table.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.