Skip to content

Commit

Permalink
Show sidebar when moving from screen to screen
Browse files Browse the repository at this point in the history
When both are from lua the old logic failed.
  • Loading branch information
warmist committed Apr 10, 2016
1 parent 29f08cd commit c4c452c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/lua/eventful.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c4c452c

Please sign in to comment.