require "rendertext" require "keys" require "graphics" require "font" require "inputbox" require "selectmenu" require "commands" HelpPage = { -- Other Class vars: -- spacing between lines spacing = 25, -- state buffer commands = nil, items = 0, page = 1, -- font for displaying keys fsize = 20, face = Font:getFace("hpkfont", 20), -- font for displaying help messages hfsize = 20, hface = Font:getFace("hfont", 20), -- font for paging display ffsize = 15, fface = Font:getFace("pgfont", 15) } -- Other Class vars: function HelpPage:show(ypos, height, commands) self.commands = {} self.items = 0 local keys = {} for k,v in pairs(commands.map) do local key = v.keygroup or v.keydef:display() --print("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 pagedirty = true end elseif ev.code == KEY_BACK or ev.code == KEY_HOME then return nil end end end end