From 65e2f701a6c0cfbf53506678771839f7f6d12cbf Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 24 Aug 2016 22:14:10 +0200 Subject: map selection --- config/menuhost.lua | 13 +++++++++++++ config/menuselect.lua | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/menuhost.lua b/config/menuhost.lua index 3ad10db..53972b3 100644 --- a/config/menuhost.lua +++ b/config/menuhost.lua @@ -6,11 +6,24 @@ local selector = require "selector" local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() local bx = width/2-29 +local map_selector = selector:new(menu) + return { + map_selector + :setPosition(width/2, 10) + :setSize(80, 42) + :setMargin(0) + :set("global", true) + :set("list", require "maplist") + :set("sprite", love.graphics.newImage("assets/placeholder-map-icon.png")) + :set("quads", require "mapicons") + :init() + , button:new(menu) :setText("Select") :setPosition(bx,101) :set("active", function (self) + MAP = map_selector:getFullSelection(true)[1][1] self.parent:load("menuselect") end) , diff --git a/config/menuselect.lua b/config/menuselect.lua index af71b5f..20ea607 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -27,7 +27,7 @@ return { :set("active", function (self) local nauts = naut_selector:getFullSelection(false) if #nauts > 1 then - changeScene(World:new(nil, nauts)) + changeScene(World:new(MAP, nauts)) else self:blink() end -- cgit v1.1