-- luafiler (c) 2006 mallchin, http://www.mallchin.com/luafm/
-- You are free to distribute this file without modifications.

function display_help()

  -- display background image
  screen:blit(0, 0, background, 0, 0, background:width(), background:height(), false)

  -- render help text
  local helptext = {}
  table.insert(helptext, "Welcome to Lua FileManager :)")
  table.insert(helptext, "")
  table.insert(helptext, "Quick help:")
  table.insert(helptext, "Up/Down         =  Navigation")
  table.insert(helptext, "Cross (on file) =  Run file")
  table.insert(helptext, "Cross (on dir)  =  Change directory")
  table.insert(helptext, "Circle          =  Cancel")
  table.insert(helptext, "Triangle        =  Highlight files")
  table.insert(helptext, "Square          =  Perform commands on highlighted files")
  table.insert(helptext, "Select          =  Help (this page)")
  table.insert(helptext, "Start           =  Credits")
  table.insert(helptext, "Home            =  Quit")
  table.insert(helptext, "")
  table.insert(helptext, "The controls are pretty simple, use the directional pad to")
  table.insert(helptext, "navigate around. Press CROSS to bring up available options")
  table.insert(helptext, "for a file, or change directories on a <dir>. You can also")
  table.insert(helptext, "perform item operations (cut/paste/delete) by highlighting")
  table.insert(helptext, "items using TRIANGLE (they turn yellow when selected) then")
  table.insert(helptext, "pressing SQUARE to bring up the available operations. You")
  table.insert(helptext, "should get the hang of it after a few minutes.")
  table.insert(helptext, "")
  table.insert(helptext, "For more information and latest updates visit the homepage")
  table.insert(helptext, "at http://www.mallchin.com/luafm/.")

  local xpos = 10
  local ypos = 10
  for k,v in pairs(helptext) do
    screen:print((xpos + shadow_xoffset), (ypos + shadow_yoffset), v, black)
    screen:print(xpos, ypos, v, white)
    ypos = ypos + 10
  end

    -- render version
    screen:print(10, 260, pad_string("left", 58, "Ver. " .. version), grey)

    -- render quit message
    screen:print(10, 260, "Press CIRCLE to quit Help.", grey)

end
