From b3198c88a0aa6885c6ca09f8fea5d63b4e0de615 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 16 Feb 2023 18:43:06 -0800 Subject: [PATCH] only block mouse clicks over exactly the panel area --- plugins/lua/buildingplan.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/lua/buildingplan.lua b/plugins/lua/buildingplan.lua index 82172613d..b7ed789e4 100644 --- a/plugins/lua/buildingplan.lua +++ b/plugins/lua/buildingplan.lua @@ -266,6 +266,7 @@ PlannerOverlay.ATTRS{ function PlannerOverlay:init() local main_panel = widgets.Panel{ + view_id='main', frame={t=0, l=0, r=0, h=14}, frame_style=gui.MEDIUM_FRAME, frame_background=gui.CLEAR_PEN, @@ -396,7 +397,14 @@ function PlannerOverlay:onInput(keys) end if keys._MOUSE_L_DOWN then if is_over_options_panel() then return false end - if self:getMouseFramePos() then return true end + local detect_rect = copyall(self.frame_rect) + detect_rect.height = self.subviews.main.frame_rect.height + + self.subviews.errors.frame_rect.height + detect_rect.y2 = detect_rect.y1 + detect_rect.height - 1 + if self.subviews.main:getMousePos(gui.ViewRect{rect=detect_rect}) + or self.subviews.errors:getMousePos() then + return true + end if #uibs.errors > 0 then return true end local pos = dfhack.gui.getMousePos() if pos then