feat(map-editor): world-overlay variant for Cell-Tile mode

draw_world_overlay gains a cell-tile branch that renders a faint
render-cell grid and a 1-px hover-cell outline around the cursor
cell. The existing G-toggle continues to gate the entire overlay.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Calic
2026-06-01 23:05:22 +02:00
parent 51138e257f
commit 46d1e78758

View File

@@ -1305,6 +1305,22 @@ local ui = (function()
engine.render.draw_rect_lines(px - 6, py - 6, 12, 12,
rgba(COL_VERTEX_SNAP, 0xFF))
end
elseif mode == "cell-tile" then
-- Cell-tile mode: faint render-cell grid (same density as Direct).
local grid_col = rgba(COL_VERTEX_GRID, 0x40)
for x = 0, map_w do
engine.render.draw_line(x * t_size, 0, x * t_size, map_h * t_size, grid_col)
end
for y = 0, map_h do
engine.render.draw_line(0, y * t_size, map_w * t_size, y * t_size, grid_col)
end
-- Hover-cell highlight: 1-px outline around the cursor cell.
local c = state.get_mouse_cell()
if c then
engine.render.draw_rect_lines(
c.x * t_size, c.y * t_size, t_size, t_size,
rgba(COL_VERTEX_SNAP, 0xFF))
end
else
-- Direct mode: subtle render-cell grid only — that's the
-- grid LMB strokes write to.