From 46d1e78758f59321b6211fa079a55421082cb332 Mon Sep 17 00:00:00 2001 From: Calic Date: Mon, 1 Jun 2026 23:05:22 +0200 Subject: [PATCH] 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) --- init.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/init.lua b/init.lua index 12d67e0..b1b89ab 100644 --- a/init.lua +++ b/init.lua @@ -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.