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:
16
init.lua
16
init.lua
@@ -1305,6 +1305,22 @@ local ui = (function()
|
|||||||
engine.render.draw_rect_lines(px - 6, py - 6, 12, 12,
|
engine.render.draw_rect_lines(px - 6, py - 6, 12, 12,
|
||||||
rgba(COL_VERTEX_SNAP, 0xFF))
|
rgba(COL_VERTEX_SNAP, 0xFF))
|
||||||
end
|
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
|
else
|
||||||
-- Direct mode: subtle render-cell grid only — that's the
|
-- Direct mode: subtle render-cell grid only — that's the
|
||||||
-- grid LMB strokes write to.
|
-- grid LMB strokes write to.
|
||||||
|
|||||||
Reference in New Issue
Block a user