diff options
-rw-r--r-- | assets/placeholder-map-icon.png | bin | 0 -> 1220 bytes | |||
-rw-r--r-- | config/menuhost.lua | 13 | ||||
-rw-r--r-- | config/menuselect.lua | 2 | ||||
-rw-r--r-- | selector.lua | 5 |
4 files changed, 18 insertions, 2 deletions
diff --git a/assets/placeholder-map-icon.png b/assets/placeholder-map-icon.png Binary files differnew file mode 100644 index 0000000..cab79f1 --- /dev/null +++ b/assets/placeholder-map-icon.png 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 diff --git a/selector.lua b/selector.lua index a0e19f8..f2d7b16 100644 --- a/selector.lua +++ b/selector.lua @@ -82,6 +82,7 @@ function Selector:init() end -- Initialize global Selector if self.global then + self.sets = {} self.locks = {false} self.selections = {1} -- Initialize Selector for Controllers @@ -162,7 +163,9 @@ function Selector:getFullSelection(allowed) local name = self:getListValue(self:getSelection(n)) local locked = self:isLocked(n) if locked or allowed then - table.insert(t, {name, self.sets[n]}) + local a = {name} + if self.sets[n] then table.insert(a, self.sets[n]) end + table.insert(t, a) end end return t |