Bug fixing.

Fixes for "tab" in hacked buildings.
develop
Warmist 2014-08-03 16:00:13 +03:00
parent ee2424c895
commit f04b93210a
2 changed files with 18 additions and 11 deletions

@ -425,10 +425,15 @@ WorkshopOverlay.ATTRS={
function WorkshopOverlay:onInput(keys)
local allowedKeys={ --TODO add options: job management, profile, etc...
"CURSOR_RIGHT","CURSOR_LEFT","CURSOR_UP","CURSOR_DOWN",
"CURSOR_UPRIGHT","CURSOR_UPLEFT","CURSOR_DOWNRIGHT","CURSOR_DOWNLEFT","CURSOR_UP_Z","CURSOR_DOWN_Z","DESTROYBUILDING"}
"CURSOR_UPRIGHT","CURSOR_UPLEFT","CURSOR_DOWNRIGHT","CURSOR_DOWNLEFT",
"CURSOR_UP_Z","CURSOR_DOWN_Z","DESTROYBUILDING","CHANGETAB"}
if keys.LEAVESCREEN then
self:dismiss()
self:sendInputToParent('LEAVESCREEN')
elseif keys.CHANGETAB then
self:sendInputToParent("CHANGETAB")
self:inputToSubviews(keys)
self:updateLayout()
else
for _,name in ipairs(allowedKeys) do
if keys[name] then

@ -106,11 +106,13 @@ function registerSidebar(shop_name,callback)
else
local function drawSidebar( wshop )
local valid_focus="dwarfmode/QueryBuilding/Some"
if string.sub(dfhack.gui.getCurFocus(),1,#valid_focus)==valid_focus and
wshop:getMaxBuildStage()==wshop:getBuildStage()
then
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()
else
sidebar:show(dfhack.gui.getCurViewscreen(true).parent)
end
end
end
registerSidebar(shop_name,drawSidebar)