feat(map-editor): wire Window toggles to hide side panel + palette
Both render and click handlers are now gated by the is_layers_panel_shown / is_palette_shown predicates, so the new Window menu toggles produce visible effects in the editor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
8
init.lua
8
init.lua
@@ -1280,8 +1280,12 @@ local ui = (function()
|
||||
end
|
||||
draw_top_toolbar(mx, my)
|
||||
draw_mode_pill()
|
||||
if state.is_layers_panel_shown() then
|
||||
draw_side_panel(mx, my)
|
||||
end
|
||||
if state.is_palette_shown() then
|
||||
draw_palette(mx, my)
|
||||
end
|
||||
draw_status(mx, my)
|
||||
local mid = state.get_modal_open()
|
||||
if mid and MODALS[mid] then
|
||||
@@ -1490,6 +1494,7 @@ local ui = (function()
|
||||
end
|
||||
|
||||
-- Bottom palette swatches: left = select slot
|
||||
if state.is_palette_shown() then
|
||||
for _, sw in ipairs(palette_swatches_layout()) do
|
||||
if in_rect(mx, my, sw.x, sw.y, sw.w, sw.h) then
|
||||
if button == "left" then
|
||||
@@ -1498,8 +1503,10 @@ local ui = (function()
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Side-panel layer rows: left = set active; right = toggle visibility
|
||||
if state.is_layers_panel_shown() then
|
||||
for _, row in ipairs(side_panel_rows_layout()) do
|
||||
if in_rect(mx, my, row.eye_x, row.eye_y, row.eye_w, row.eye_h) then
|
||||
if button == "left" then
|
||||
@@ -1516,6 +1523,7 @@ local ui = (function()
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Status chip — no-op fallback to claim the click area
|
||||
local s = status_layout()
|
||||
|
||||
Reference in New Issue
Block a user