require "rendertext" require "keys" require "graphics" require "font" require "inputbox" require "selectmenu" require "commands" HelpPage = { -- Other Class vars: title_H = 40, -- title height margin_H = 10, -- horisontal margin foot_H = 28, -- foot height bg_color = 3, -- background color spacing = 25, -- spacing between lines -- state buffer commands = nil, items = 0, page = 1, } function HelpPage:show(ypos, height, commands, title) local face = Font:getFace("hpkfont", 20) local hface = Font:getFace("hfont", 20) local fface = Font:getFace("ffont", 16) local tface = Font:getFace("tfont", 25) self.commands = {} self.items = 0 local keys = {} for k,v in pairs(commands.map) do local key = v.keygroup or v.keydef:display() --Debug("order: "..v.order.." command: "..tostring(v.keydef).." - keygroup:"..(v.keygroup or "nil").." -keys[key]:"..(keys[key] or "nil")) if keys[key] == nil then keys[key] = 1 table.insert(self.commands,{shortcut=key,help=v.help,order=v.order}) self.items = self.items + 1 end end table.sort(self.commands,function(w1,w2) return w1.order 1 then self.page = self.page - 1 is_pagedirty = true end elseif ev.code == KEY_BACK or ev.code == KEY_HOME then return nil end end end end