diff --git a/plugins/lua/eventful.lua b/plugins/lua/eventful.lua index 0035c3a53..3fc192505 100644 --- a/plugins/lua/eventful.lua +++ b/plugins/lua/eventful.lua @@ -106,10 +106,14 @@ function registerSidebar(shop_name,callback) else local function drawSidebar( wshop ) local valid_focus="dwarfmode/QueryBuilding" + local another_overlay="dfhack/lua/WorkshopOverlay" if wshop:getMaxBuildStage()==wshop:getBuildStage() then local sidebar=callback{workshop=wshop} - if string.sub(dfhack.gui.getCurFocus(),1,#valid_focus)==valid_focus then - sidebar:show() + if string.sub(dfhack.gui.getCurFocus(true),1,#another_overlay)==another_overlay then + dfhack.screen.dismiss(dfhack.gui.getCurViewscreen(true)) + end + if string.sub(dfhack.gui.getCurFocus(true),1,#valid_focus)==valid_focus then + sidebar:show(dfhack.gui.getCurViewscreen(true)) end end end