|
|
@ -7,10 +7,9 @@ local utils = require('utils')
|
|
|
|
|
|
|
|
|
|
|
|
local dscreen = dfhack.screen
|
|
|
|
local dscreen = dfhack.screen
|
|
|
|
|
|
|
|
|
|
|
|
local function show_view(view,vis,act)
|
|
|
|
local function show_view(view,vis)
|
|
|
|
if view then
|
|
|
|
if view then
|
|
|
|
view.visible = vis
|
|
|
|
view.visible = vis
|
|
|
|
view.active = act
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -79,7 +78,7 @@ Pages = defclass(Pages, Panel)
|
|
|
|
|
|
|
|
|
|
|
|
function Pages:init(args)
|
|
|
|
function Pages:init(args)
|
|
|
|
for _,v in ipairs(self.subviews) do
|
|
|
|
for _,v in ipairs(self.subviews) do
|
|
|
|
show_view(v, false, false)
|
|
|
|
v.visible = false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
self:setSelected(args.selected or 1)
|
|
|
|
self:setSelected(args.selected or 1)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -96,9 +95,9 @@ function Pages:setSelected(idx)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
show_view(self.subviews[self.selected], false, false)
|
|
|
|
show_view(self.subviews[self.selected], false)
|
|
|
|
self.selected = math.min(math.max(1, idx), #self.subviews)
|
|
|
|
self.selected = math.min(math.max(1, idx), #self.subviews)
|
|
|
|
show_view(self.subviews[self.selected], true, true)
|
|
|
|
show_view(self.subviews[self.selected], true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function Pages:getSelected()
|
|
|
|
function Pages:getSelected()
|
|
|
@ -583,7 +582,7 @@ function FilteredList:init(info)
|
|
|
|
text_pen = COLOR_LIGHTRED,
|
|
|
|
text_pen = COLOR_LIGHTRED,
|
|
|
|
frame = { l = info.icon_width, t = 2 },
|
|
|
|
frame = { l = info.icon_width, t = 2 },
|
|
|
|
}
|
|
|
|
}
|
|
|
|
self:addviews{ self.list, self.edit, self.not_found }
|
|
|
|
self:addviews{ self.edit, self.list, self.not_found }
|
|
|
|
self:setChoices(info.choices, info.selected)
|
|
|
|
self:setChoices(info.choices, info.selected)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|