Show sidebar when moving from screen to screen

When both are from lua the old logic failed.
develop
Warmist 2016-04-10 16:51:58 +03:00
parent 29f08cd20d
commit c4c452c288
1 changed files with 6 additions and 2 deletions

@ -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