diff options
author | Aki <nthirtyone@gmail.com> | 2017-01-15 14:07:20 +0100 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-01-15 14:07:20 +0100 |
commit | 7e3c59eb7d0c7affca6d3bdc2702faba93fe9705 (patch) | |
tree | 1a3a55c97bff9a804b384eba26c4971ad8914841 | |
parent | 7a37f5f6430a6d063e197283ce979394f55e1c68 (diff) | |
download | roflnauts-7e3c59eb7d0c7affca6d3bdc2702faba93fe9705.zip roflnauts-7e3c59eb7d0c7affca6d3bdc2702faba93fe9705.tar.gz roflnauts-7e3c59eb7d0c7affca6d3bdc2702faba93fe9705.tar.bz2 |
Map icons list generated rather than static
-rw-r--r-- | assets/maps.png | bin | 0 -> 9305 bytes | |||
-rw-r--r-- | assets/placeholder-map-icon.png | bin | 8833 -> 0 bytes | |||
-rw-r--r-- | config/menuhost.lua | 2 | ||||
-rw-r--r-- | mapicons.lua | 21 |
4 files changed, 13 insertions, 10 deletions
diff --git a/assets/maps.png b/assets/maps.png Binary files differnew file mode 100644 index 0000000..a6b442c --- /dev/null +++ b/assets/maps.png diff --git a/assets/placeholder-map-icon.png b/assets/placeholder-map-icon.png Binary files differdeleted file mode 100644 index 85b6727..0000000 --- a/assets/placeholder-map-icon.png +++ /dev/null diff --git a/config/menuhost.lua b/config/menuhost.lua index 710839d..64ce0e7 100644 --- a/config/menuhost.lua +++ b/config/menuhost.lua @@ -16,7 +16,7 @@ return { :set("global", true) :set("first", true) :set("list", require "maplist") - :set("icons_i", love.graphics.newImage("assets/placeholder-map-icon.png")) + :set("icons_i", love.graphics.newImage("assets/maps.png")) :set("icons_q", require "mapicons") :set("shape", "panorama") :init() diff --git a/mapicons.lua b/mapicons.lua index 3251e2a..6827840 100644 --- a/mapicons.lua +++ b/mapicons.lua @@ -1,9 +1,12 @@ -local w, h = 80, 252 -return { - default = love.graphics.newQuad(2, 3,76,37,w,h), - rill = love.graphics.newQuad(2, 45,76,37,w,h), - ribbit = love.graphics.newQuad(2, 87,76,37,w,h), - starstorm = love.graphics.newQuad(2,129,76,37,w,h), - aiguillon = love.graphics.newQuad(2,171,76,37,w,h), - sorona = love.graphics.newQuad(2,213,76,37,w,h), -} +-- Maps icons list generation file +-- REWORK NEEDED, it is so similar to `nautsicons.lua` they could be merged together into one function that returns icon quad sequences. +local maps = require "maplist" +local w, h = 456, 37 +local icons = {} + +local i = 0 +for _,map in pairs(maps) do + icons[map] = love.graphics.newQuad(i*76, 0, 76, 37, w, h) + i = i + 1 +end +return icons |