diff options
Diffstat (limited to 'Gamestates/Menu.lua')
-rw-r--r-- | Gamestates/Menu.lua | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/Gamestates/Menu.lua b/Gamestates/Menu.lua index cf612bd..37e69a4 100644 --- a/Gamestates/Menu.lua +++ b/Gamestates/Menu.lua @@ -1,13 +1,57 @@ +--[[ + Gamestates/Menu.lua + Main menu + by piernov + + Comment: might not be a good idea to immediately load both Solo and Multiplayer mode. +]]-- + local Menu = {} local Gui = require "Quickie" local Utils = require "Utils" local GUI = { Menu = require("GUI/Menu")} -local Gamestates = require "Gamestates/Init" +local Gamestates = { + Solo = require("Gamestates/Solo"), + Multiplayer = require("Gamestates/Multiplayer"), + About = require("Gamestates/About") +} +Gamestates.Options = Config + + +function Menu:enter() + Previous = nil -- Menu's root + +-- Redefine Quickie's colors + Gui.core.style.color.normal.fg[1] = 0 + Gui.core.style.color.normal.fg[2] = 0 + Gui.core.style.color.normal.fg[3] = 255 + + Gui.core.style.color.normal.bg[1] = 0 + Gui.core.style.color.normal.bg[2] = 0 + Gui.core.style.color.normal.bg[3] = 0 + + Gui.core.style.color.hot.fg[1] = 0 + Gui.core.style.color.hot.fg[2] = 0 + Gui.core.style.color.hot.fg[3] = 255 + + Gui.core.style.color.hot.bg[1] = 48 + Gui.core.style.color.hot.bg[2] = 48 + Gui.core.style.color.hot.bg[3] = 48 + + Gui.core.style.color.active.fg[1] = 0 + Gui.core.style.color.active.fg[2] = 0 + Gui.core.style.color.active.fg[3] = 255 + + Gui.core.style.color.active.bg[1] = 24 + Gui.core.style.color.active.bg[2] = 24 + Gui.core.style.color.active.bg[3] = 24 +-- End +end function Menu:update(dt) Gui.group{grow = "down", pos = {Utils.percentCoordinates(10, 10)}, function() for _, name in ipairs(GUI.Menu.Buttons) do - if Gui.Button{text = name, size = {Utils.percentCoordinates(80, 20)}} then + if Gui.Button{text = name, size = {Utils.percentCoordinates(80, 20)}} then -- Display main menu buttons and switch gamestate if clicked Gamestate.switch(Gamestates[name]) end end |