summaryrefslogtreecommitdiffhomepage
path: root/config/menuhost.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-12-20 06:05:56 +0100
committerGitHub <noreply@github.com>2016-12-20 06:05:56 +0100
commit493a89fb354ee6ce667d29a7b96bb4fdd0f6697f (patch)
treed862856d4b62a6c996ea16211ebd321206e236b4 /config/menuhost.lua
parented6ad6687aeb5359af48bc97c1dbf5dd66842c9c (diff)
parent73bcd524906c51d43b22b3ea68c64b38f130bea6 (diff)
downloadroflnauts-493a89fb354ee6ce667d29a7b96bb4fdd0f6697f.zip
roflnauts-493a89fb354ee6ce667d29a7b96bb4fdd0f6697f.tar.gz
roflnauts-493a89fb354ee6ce667d29a7b96bb4fdd0f6697f.tar.bz2
Merge pull request #16 from nthirtyone/menuv1.0-pre.4
Menu
Diffstat (limited to 'config/menuhost.lua')
-rw-r--r--config/menuhost.lua42
1 files changed, 42 insertions, 0 deletions
diff --git a/config/menuhost.lua b/config/menuhost.lua
new file mode 100644
index 0000000..710839d
--- /dev/null
+++ b/config/menuhost.lua
@@ -0,0 +1,42 @@
+local menu = ...
+
+local button = require "button"
+local selector = require "selector"
+
+local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale()
+local bx = width/2-29
+
+local map_selector = selector:new(menu)
+
+return {
+ map_selector
+ :setPosition(width/2, 40)
+ :setSize(80, 42)
+ :setMargin(0)
+ :set("global", true)
+ :set("first", true)
+ :set("list", require "maplist")
+ :set("icons_i", love.graphics.newImage("assets/placeholder-map-icon.png"))
+ :set("icons_q", require "mapicons")
+ :set("shape", "panorama")
+ :init()
+ ,
+ button:new(menu)
+ :setText("Next")
+ :setPosition(bx,101)
+ :set("isEnabled", function ()
+ return map_selector:isLocked()
+ end)
+ :set("active", function (self)
+ MAP = map_selector:getFullSelection(true)[1][1] -- please, don't kill me for this, kek
+ self.parent:load("menuselect")
+ end)
+ ,
+ button:new(menu)
+ :setText("Go back")
+ :setPosition(bx,117)
+ :set("active", function (self)
+ self.parent:load("menumain")
+ end)
+ ,
+} \ No newline at end of file