Commit Graph

8 Commits

Author SHA1 Message Date
Calic
b5fee40406 Match module id to directory name convention
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.
2026-05-24 03:08:31 +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
f8ce43784f Add immediate-mode overlay UI module
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.
2026-05-24 01:16:14 +02:00
Calic
9fefe7619a Add editor actions module composing maps write APIs
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.
2026-05-24 01:11:35 +02:00
Calic
0b2eb20199 Add editor state module with accessor API
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>
2026-05-24 01:09:08 +02:00
Calic
45992065a1 Add manifest.core for engine bootstrap
Engine requires both manifest.core (lib metadata) and manifest.module
(module metadata) for proper package discovery and loading.
2026-05-24 01:06:04 +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