summaryrefslogtreecommitdiffhomepage
path: root/config/menus
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-09-02 21:08:42 +0200
committerAki <nthirtyone@gmail.com>2017-09-02 21:08:42 +0200
commit2b33497121abec53d1fcbce68c9c0d8224079032 (patch)
tree90f3d743b5f8e8ae490f4fdb23d46551d356104f /config/menus
parentd480978edd91e0b096c57fb151780a957587e06d (diff)
downloadroflnauts-2b33497121abec53d1fcbce68c9c0d8224079032.zip
roflnauts-2b33497121abec53d1fcbce68c9c0d8224079032.tar.gz
roflnauts-2b33497121abec53d1fcbce68c9c0d8224079032.tar.bz2
Map selector no longer use pre-written maps list or iconsList functions
Diffstat (limited to 'config/menus')
-rw-r--r--config/menus/host.lua20
1 files changed, 17 insertions, 3 deletions
diff --git a/config/menus/host.lua b/config/menus/host.lua
index a180736..2166360 100644
--- a/config/menus/host.lua
+++ b/config/menus/host.lua
@@ -8,13 +8,27 @@ local bx = width/2-29
local map_Selector = Selector(menu)
-require "iconsList"
-local icons, maps = getMapsIconsList()
-
if background == nil or not background:is(require "not.MenuBackground") then
background = require "not.MenuBackground"(menu)
end
+-- TODO: Temporary fun stuff for maps, will be changed along `iconsList`.
+local icons, maps = {}, {}
+do
+ local files = love.filesystem.getDirectoryItems("config/maps")
+ for _,filename in pairs(files) do
+ local path = string.format("config/maps/%s", filename)
+ if love.filesystem.isFile(path) and filename ~= "readme.md" then
+ local map = love.filesystem.load(path)()
+ local i, name = map.portrait, map.name
+ if i then
+ icons[name] = love.graphics.newQuad((i-1)*76, 0, 76, 37, 532, 37)
+ table.insert(maps, name)
+ end
+ end
+ end
+end
+
return {
background,
map_Selector