------------------------------------------------------------------------------
-- Imports
------------------------------------------------------------------------------

local make_class = require 'src.utils.classes'
local constants  = require 'src.gstates.menus.const'
local BaseMenu   = require 'src.gstates.menus.base'
local Color      = require 'src.utils.color'
local Label      = require 'src.ui.label'
local TextButton = require 'src.ui.textbtn'


------------------------------------------------------------------------------
-- Class definitions
------------------------------------------------------------------------------

local MainMenu = make_class(BaseMenu)


------------------------------------------------------------------------------
-- Main Menu Class methods
------------------------------------------------------------------------------

function MainMenu:_init(parent, title_font, button_font)
    BaseMenu._init(self, parent, "Main Menu", constants.MAIN_MENU, 'imgs/concb03.png')

    -- Create UI elements of the main menu.
    self.container:add(Label(nil, nil, 'LoveDOS', title_font, Color(215, 0, 0), true))
    self.container:add(TextButton('New Game', button_font))
    self.container:add(TextButton('Load Game', button_font))
    self.container:add(TextButton('Options', button_font, nil, nil, function() parent.next_menu = constants.OPTIONS_MENU end))
    self.container:add(TextButton('Help & Story', button_font))
    self.container:add(TextButton('Quit', button_font, nil, nil, function() parent.next_state = -1 end))
end


------------------------------------------------------------------------------
-- Module return
------------------------------------------------------------------------------

return MainMenu
