summaryrefslogtreecommitdiffhomepage
path: root/config/menus/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'config/menus/main.lua')
-rw-r--r--config/menus/main.lua35
1 files changed, 23 insertions, 12 deletions
diff --git a/config/menus/main.lua b/config/menus/main.lua
index 236c011..ae2cef2 100644
--- a/config/menus/main.lua
+++ b/config/menus/main.lua
@@ -1,49 +1,60 @@
-local menu = ...
+local menu, background = ...
-local button = require "not.Button"
-local header = require "not.Header"
-local element = require "not.Element"
+local Button = require "not.Button"
+local Header = require "not.Header"
+local Element = require "not.Element"
local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale()
local bx = width/2-29
local awesometwo = love.graphics.newImage("assets/two.png")
+if background == nil or not background:is(require "not.MenuBackground") then
+ background = require "not.MenuBackground"(menu)
+end
+
+-- Wait, only here?
+if musicPlayer:getCurrentTrack() ~= "menu.ogg" then
+ musicPlayer:setTrack("menu.ogg")
+ musicPlayer:play()
+end
+
return {
- button:new(menu)
+ background,
+ Button(menu)
:setText("Start")
:setPosition(bx, 80)
:set("active", function (self)
self.parent:open("host")
end)
,
- button:new(menu)
+ Button(menu)
:setText("Join")
:setPosition(bx, 96)
:set("isEnabled", function (self)
return false
end)
,
- button:new(menu)
+ Button(menu)
:setText("Settings")
:setPosition(bx, 112)
:set("active", function (self)
self.parent:open("settings")
end)
,
- button:new(menu)
+ Button(menu)
:setText("Credits")
:setPosition(bx, 128)
:set("active", function (self)
self.parent:open("credits")
end)
,
- button:new(menu)
+ Button(menu)
:setText("Exit")
:setPosition(bx, 144)
:set("active", love.event.quit)
,
- element:new(menu)
+ Element(menu)
:setPosition(width/2, 15)
:set("draw", function (self, scale)
local x,y = self:getPosition()
@@ -52,8 +63,8 @@ return {
love.graphics.draw(awesometwo, x*scale, y*scale, 0, scale, scale, 35)
end)
,
- header:new(menu)
+ Header(menu)
:setText("Roflnauts")
:setPosition(width/2,40)
,
-} \ No newline at end of file
+}