Merge remote-tracking branches 'warmist/patch-7', 'warmist/patch-8' and 'warmist/patch-9' into develop

develop
lethosor 2016-04-10 11:58:48 -04:00
commit 2399539990
2 changed files with 12 additions and 10 deletions

@ -95,8 +95,8 @@ local function findGears( shop_def ) --finds positions of all gears and inverted
end end
return ret return ret
end end
local function lookup_color( shop_def,x,y,stage )--TODO: background and bright? local function lookup_color( shop_def,x,y,stage )
return shop_def.tile_color[stage][x][y] return shop_def.tile_color[0][stage][x][y],shop_def.tile_color[1][stage][x][y],shop_def.tile_color[2][stage][x][y]
end end
local function processFramesAuto( shop_def ,gears) --adds frames for all gear icons and inverted gear icons local function processFramesAuto( shop_def ,gears) --adds frames for all gear icons and inverted gear icons
local w,h=shop_def.dim_x,shop_def.dim_y local w,h=shop_def.dim_x,shop_def.dim_y
@ -114,8 +114,8 @@ local function processFramesAuto( shop_def ,gears) --adds frames for all gear ic
tile_inv=42 tile_inv=42
end end
table.insert(frames[1],{x=v.x,y=v.y,tile,lookup_color(shop_def,v.x,v.y),0,0}) table.insert(frames[1],{x=v.x,y=v.y,tile,lookup_color(shop_def,v.x,v.y,stage)})
table.insert(frames[2],{x=v.x,y=v.y,tile_inv,lookup_color(shop_def,v.x,v.y),0,0}) table.insert(frames[2],{x=v.x,y=v.y,tile_inv,lookup_color(shop_def,v.x,v.y,stage)})
end end
for frame_id,frame in ipairs(frames) do for frame_id,frame in ipairs(frames) do

@ -105,13 +105,15 @@ function registerSidebar(shop_name,callback)
dfhack.onStateChange.eventful=unregall dfhack.onStateChange.eventful=unregall
else else
local function drawSidebar( wshop ) local function drawSidebar( wshop )
local valid_focus="dwarfmode/QueryBuilding/Some" local valid_focus="dwarfmode/QueryBuilding"
local another_overlay="dfhack/lua/WorkshopOverlay"
if wshop:getMaxBuildStage()==wshop:getBuildStage() then if wshop:getMaxBuildStage()==wshop:getBuildStage() then
local sidebar=callback{workshop=wshop} local sidebar=callback{workshop=wshop}
if string.sub(dfhack.gui.getCurFocus(),1,#valid_focus)==valid_focus then if string.sub(dfhack.gui.getCurFocus(true),1,#another_overlay)==another_overlay then
sidebar:show() dfhack.screen.dismiss(dfhack.gui.getCurViewscreen(true))
else end
sidebar:show(dfhack.gui.getCurViewscreen(true).parent) if string.sub(dfhack.gui.getCurFocus(true),1,#valid_focus)==valid_focus then
sidebar:show(dfhack.gui.getCurViewscreen(true))
end end
end end
end end