From 2b33497121abec53d1fcbce68c9c0d8224079032 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 2 Sep 2017 21:08:42 +0200 Subject: Map selector no longer use pre-written maps list or iconsList functions --- config/menus/host.lua | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'config') 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 -- cgit v1.1