From dd9245c6b22f756bc439960afabf5793634c45f5 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 22 Sep 2017 01:32:45 +0200 Subject: Split nauts.lua into several files now used by Hero and Menu --- config/menus/select.lua | 32 ++++++++++++++++++++++++------- config/nauts.lua | 46 --------------------------------------------- config/nauts/biker.lua | 8 ++++++++ config/nauts/bison.lua | 8 ++++++++ config/nauts/blblal.lua | 8 ++++++++ config/nauts/bobito.lua | 8 ++++++++ config/nauts/brainos.lua | 8 ++++++++ config/nauts/bug.lua | 8 ++++++++ config/nauts/calamari.lua | 8 ++++++++ config/nauts/capone.lua | 8 ++++++++ config/nauts/cowboy.lua | 8 ++++++++ config/nauts/cowman.lua | 8 ++++++++ config/nauts/disco.lua | 8 ++++++++ config/nauts/dundee.lua | 8 ++++++++ config/nauts/froggirl.lua | 8 ++++++++ config/nauts/froggo.lua | 8 ++++++++ config/nauts/gelato.lua | 8 ++++++++ config/nauts/girl.lua | 8 ++++++++ config/nauts/gramps.lua | 8 ++++++++ config/nauts/gummybear.lua | 8 ++++++++ config/nauts/honic.lua | 8 ++++++++ config/nauts/joystick.lua | 8 ++++++++ config/nauts/kong.lua | 8 ++++++++ config/nauts/lady.lua | 8 ++++++++ config/nauts/link.lua | 8 ++++++++ config/nauts/marine.lua | 8 ++++++++ config/nauts/megoman.lua | 8 ++++++++ config/nauts/missile.lua | 8 ++++++++ config/nauts/nemo.lua | 8 ++++++++ config/nauts/phonebooth.lua | 8 ++++++++ config/nauts/quack.lua | 8 ++++++++ config/nauts/rock.lua | 8 ++++++++ config/nauts/scissors.lua | 8 ++++++++ config/nauts/scooter.lua | 8 ++++++++ config/nauts/shutter.lua | 8 ++++++++ config/nauts/slugzor.lua | 8 ++++++++ config/nauts/swarm.lua | 8 ++++++++ config/nauts/veno.lua | 8 ++++++++ config/nauts/vrooom.lua | 8 ++++++++ config/nauts/weed.lua | 8 ++++++++ config/nauts/woman.lua | 8 ++++++++ config/nauts/yarr.lua | 8 ++++++++ 42 files changed, 345 insertions(+), 53 deletions(-) delete mode 100644 config/nauts.lua create mode 100644 config/nauts/biker.lua create mode 100644 config/nauts/bison.lua create mode 100644 config/nauts/blblal.lua create mode 100644 config/nauts/bobito.lua create mode 100644 config/nauts/brainos.lua create mode 100644 config/nauts/bug.lua create mode 100644 config/nauts/calamari.lua create mode 100644 config/nauts/capone.lua create mode 100644 config/nauts/cowboy.lua create mode 100644 config/nauts/cowman.lua create mode 100644 config/nauts/disco.lua create mode 100644 config/nauts/dundee.lua create mode 100644 config/nauts/froggirl.lua create mode 100644 config/nauts/froggo.lua create mode 100644 config/nauts/gelato.lua create mode 100644 config/nauts/girl.lua create mode 100644 config/nauts/gramps.lua create mode 100644 config/nauts/gummybear.lua create mode 100644 config/nauts/honic.lua create mode 100644 config/nauts/joystick.lua create mode 100644 config/nauts/kong.lua create mode 100644 config/nauts/lady.lua create mode 100644 config/nauts/link.lua create mode 100644 config/nauts/marine.lua create mode 100644 config/nauts/megoman.lua create mode 100644 config/nauts/missile.lua create mode 100644 config/nauts/nemo.lua create mode 100644 config/nauts/phonebooth.lua create mode 100644 config/nauts/quack.lua create mode 100644 config/nauts/rock.lua create mode 100644 config/nauts/scissors.lua create mode 100644 config/nauts/scooter.lua create mode 100644 config/nauts/shutter.lua create mode 100644 config/nauts/slugzor.lua create mode 100644 config/nauts/swarm.lua create mode 100644 config/nauts/veno.lua create mode 100644 config/nauts/vrooom.lua create mode 100644 config/nauts/weed.lua create mode 100644 config/nauts/woman.lua create mode 100644 config/nauts/yarr.lua (limited to 'config') diff --git a/config/menus/select.lua b/config/menus/select.lua index fee7c94..0d8bef9 100644 --- a/config/menus/select.lua +++ b/config/menus/select.lua @@ -14,25 +14,40 @@ if background == nil or not background:is(require "not.MenuBackground") then background = require "not.MenuBackground"(menu) end --- TODO: Temporary group for naut selectors. This isn't production code at any means! +-- TODO: Icons for nauts and maps are still waiting to get their assets split. local group, get do local atlas = love.graphics.newImage("assets/portraits.png") - local nauts = require("config.nauts") - local icons = {} - for i=0,#nauts-1 do - table.insert(icons, love.graphics.newQuad(i*28, 0, 28, 27, 1176, 27)) + local nauts, icons = {}, {} + local files = love.filesystem.getDirectoryItems("config/nauts") + for _,filename in pairs(files) do + local path = string.format("config/nauts/%s", filename) + if love.filesystem.isFile(path) and filename ~= "readme.md" then + local naut = love.filesystem.load(path)() + local i, name = naut.portrait, naut.name + if naut.available then + table.insert(icons, love.graphics.newQuad((i-1)*28, 0, 28, 27, 1176, 27)) + table.insert(nauts, naut) + end + end end + -- TODO: Find a better way to add empty and random entries to naut Selector. + table.insert(icons, 1, love.graphics.newQuad((1-1)*28, 0, 28, 27, 1176, 27)) + table.insert(nauts, 1, {name = "empty"}) + table.insert(icons, 2, love.graphics.newQuad((2-1)*28, 0, 28, 27, 1176, 27)) + table.insert(nauts, 2, {name = "random"}) + group = Group(menu) local function attack (self) if not self.lock then - if self.index == 1 then + local selected = self:getSelected() + if selected.name == "empty" then return end - if self.index == 2 then + if selected.name == "random" then self.index = self:rollRandom({1, 2}) end if self:isUnique() then @@ -46,6 +61,9 @@ do :set("icons_atlas", atlas) :set("icons_quads", icons) :set("attack", attack) + :set("getText", function (self) + return string.upper(self:getSelected().name) + end) end group:set("margin", 16) diff --git a/config/nauts.lua b/config/nauts.lua deleted file mode 100644 index aa351b9..0000000 --- a/config/nauts.lua +++ /dev/null @@ -1,46 +0,0 @@ --- List of characters with empty character included --- icons list is generated from this file -return { - "empty", -- empty - "random", --random - "froggo", -- froggy - "cowboy", -- lonestar - "honic", -- leon - "gelato", -- scoop - "veno", -- gnaw - "lady", -- raelynn - "girl", -- ayla - "megoman", -- clunk - "brainos", -- voltar - "woman", -- coco - "bison", -- skolldir - "bobito", -- yuri - "slugzor", -- derpl - "capone", -- vinnie - "nemo", -- spike - "bug", -- genji - "calamari", -- swiggins - "quack", -- rocco - "scissors", -- ksenia - "link", -- ix - "cowman", -- deadlift - "marine", -- ted - "scooter", -- penny - "phonebooth", -- sentry - "weed", -- skree - "gummybear", -- nibbs - "gramps", -- yoolip - "biker", -- chucho - "vrooom", -- lux - "shutter", -- max - "froggirl", -- dizzy - "dundee", -- smiles - "missile", -- commander rocket - "swarm", -- qi'tara - "disco", -- esc rocco - "joystick", -- 8-bit yoolip - "yarr", -- ted pirate - "blblal", -- blabl zork - "kong", -- ronimo - "rock", -- rock -} diff --git a/config/nauts/biker.lua b/config/nauts/biker.lua new file mode 100644 index 0000000..c139e87 --- /dev/null +++ b/config/nauts/biker.lua @@ -0,0 +1,8 @@ +--- chucho +return +{ + name = "biker", + image = "assets/nauts/biker.png", + portrait = 30, + available = true +} diff --git a/config/nauts/bison.lua b/config/nauts/bison.lua new file mode 100644 index 0000000..35c08ca --- /dev/null +++ b/config/nauts/bison.lua @@ -0,0 +1,8 @@ +--- skolldir +return +{ + name = "bison", + image = "assets/nauts/bison.png", + portrait = 13, + available = true +} diff --git a/config/nauts/blblal.lua b/config/nauts/blblal.lua new file mode 100644 index 0000000..4bc9884 --- /dev/null +++ b/config/nauts/blblal.lua @@ -0,0 +1,8 @@ +--- blabl zork +return +{ + name = "blblal", + image = "assets/nauts/blblal.png", + portrait = 40, + available = false +} diff --git a/config/nauts/bobito.lua b/config/nauts/bobito.lua new file mode 100644 index 0000000..f00fa7f --- /dev/null +++ b/config/nauts/bobito.lua @@ -0,0 +1,8 @@ +--- yuri +return +{ + name = "bobito", + image = "assets/nauts/bobito.png", + portrait = 14, + available = true +} diff --git a/config/nauts/brainos.lua b/config/nauts/brainos.lua new file mode 100644 index 0000000..908f57a --- /dev/null +++ b/config/nauts/brainos.lua @@ -0,0 +1,8 @@ +--- voltar +return +{ + name = "brainos", + image = "assets/nauts/brainos.png", + portrait = 11, + available = true +} diff --git a/config/nauts/bug.lua b/config/nauts/bug.lua new file mode 100644 index 0000000..3989ade --- /dev/null +++ b/config/nauts/bug.lua @@ -0,0 +1,8 @@ +--- genji +return +{ + name = "bug", + image = "assets/nauts/bug.png", + portrait = 18, + available = true +} diff --git a/config/nauts/calamari.lua b/config/nauts/calamari.lua new file mode 100644 index 0000000..3168023 --- /dev/null +++ b/config/nauts/calamari.lua @@ -0,0 +1,8 @@ +--- swiggins +return +{ + name = "calamari", + image = "assets/nauts/calamari.png", + portrait = 19, + available = true +} diff --git a/config/nauts/capone.lua b/config/nauts/capone.lua new file mode 100644 index 0000000..edd5f35 --- /dev/null +++ b/config/nauts/capone.lua @@ -0,0 +1,8 @@ +--- vinnie +return +{ + name = "capone", + image = "assets/nauts/capone.png", + portrait = 16, + available = true +} diff --git a/config/nauts/cowboy.lua b/config/nauts/cowboy.lua new file mode 100644 index 0000000..d7ac120 --- /dev/null +++ b/config/nauts/cowboy.lua @@ -0,0 +1,8 @@ +--- lonestar +return +{ + name = "cowboy", + image = "assets/nauts/cowboy.png", + portrait = 4, + available = true +} diff --git a/config/nauts/cowman.lua b/config/nauts/cowman.lua new file mode 100644 index 0000000..5bbde57 --- /dev/null +++ b/config/nauts/cowman.lua @@ -0,0 +1,8 @@ +--- deadlift +return +{ + name = "cowman", + image = "assets/nauts/cowman.png", + portrait = 23, + available = true +} diff --git a/config/nauts/disco.lua b/config/nauts/disco.lua new file mode 100644 index 0000000..e579257 --- /dev/null +++ b/config/nauts/disco.lua @@ -0,0 +1,8 @@ +--- esc rocco +return +{ + name = "disco", + image = "assets/nauts/disco.png", + portrait = 37, + available = false +} diff --git a/config/nauts/dundee.lua b/config/nauts/dundee.lua new file mode 100644 index 0000000..3299db8 --- /dev/null +++ b/config/nauts/dundee.lua @@ -0,0 +1,8 @@ +--- smiles +return +{ + name = "dundee", + image = "assets/nauts/dundee.png", + portrait = 34, + available = true +} diff --git a/config/nauts/froggirl.lua b/config/nauts/froggirl.lua new file mode 100644 index 0000000..b587043 --- /dev/null +++ b/config/nauts/froggirl.lua @@ -0,0 +1,8 @@ +--- dizzy +return +{ + name = "froggirl", + image = "assets/nauts/froggirl.png", + portrait = 33, + available = true +} diff --git a/config/nauts/froggo.lua b/config/nauts/froggo.lua new file mode 100644 index 0000000..e1c7d85 --- /dev/null +++ b/config/nauts/froggo.lua @@ -0,0 +1,8 @@ +--- froggy +return +{ + name = "froggo", + image = "assets/nauts/froggo.png", + portrait = 3, + available = true +} diff --git a/config/nauts/gelato.lua b/config/nauts/gelato.lua new file mode 100644 index 0000000..f3f4ed5 --- /dev/null +++ b/config/nauts/gelato.lua @@ -0,0 +1,8 @@ +--- scoop +return +{ + name = "gelato", + image = "assets/nauts/gelato.png", + portrait = 6, + available = true +} diff --git a/config/nauts/girl.lua b/config/nauts/girl.lua new file mode 100644 index 0000000..b1d9d8a --- /dev/null +++ b/config/nauts/girl.lua @@ -0,0 +1,8 @@ +--- ayla +return +{ + name = "girl", + image = "assets/nauts/girl.png", + portrait = 9, + available = true +} diff --git a/config/nauts/gramps.lua b/config/nauts/gramps.lua new file mode 100644 index 0000000..51aa672 --- /dev/null +++ b/config/nauts/gramps.lua @@ -0,0 +1,8 @@ +--- yoolip +return +{ + name = "gramps", + image = "assets/nauts/gramps.png", + portrait = 29, + available = true +} diff --git a/config/nauts/gummybear.lua b/config/nauts/gummybear.lua new file mode 100644 index 0000000..a39287f --- /dev/null +++ b/config/nauts/gummybear.lua @@ -0,0 +1,8 @@ +--- nibbs +return +{ + name = "gummybear", + image = "assets/nauts/gummybear.png", + portrait = 28, + available = true +} diff --git a/config/nauts/honic.lua b/config/nauts/honic.lua new file mode 100644 index 0000000..2ff6584 --- /dev/null +++ b/config/nauts/honic.lua @@ -0,0 +1,8 @@ +--- leon +return +{ + name = "honic", + image = "assets/nauts/honic.png", + portrait = 5, + available = true +} diff --git a/config/nauts/joystick.lua b/config/nauts/joystick.lua new file mode 100644 index 0000000..44e8adb --- /dev/null +++ b/config/nauts/joystick.lua @@ -0,0 +1,8 @@ +--- retro yoolip +return +{ + name = "joystick", + image = "assets/nauts/joystick.png", + portrait = 38, + available = false +} diff --git a/config/nauts/kong.lua b/config/nauts/kong.lua new file mode 100644 index 0000000..731f7f1 --- /dev/null +++ b/config/nauts/kong.lua @@ -0,0 +1,8 @@ +--- ronimo +return +{ + name = "kong", + image = "assets/nauts/kong.png", + portrait = 41, + available = false +} diff --git a/config/nauts/lady.lua b/config/nauts/lady.lua new file mode 100644 index 0000000..77ef7a3 --- /dev/null +++ b/config/nauts/lady.lua @@ -0,0 +1,8 @@ +--- raelynn +return +{ + name = "lady", + image = "assets/nauts/lady.png", + portrait = 8, + available = true +} diff --git a/config/nauts/link.lua b/config/nauts/link.lua new file mode 100644 index 0000000..1f6b430 --- /dev/null +++ b/config/nauts/link.lua @@ -0,0 +1,8 @@ +--- ix +return +{ + name = "link", + image = "assets/nauts/link.png", + portrait = 22, + available = true +} diff --git a/config/nauts/marine.lua b/config/nauts/marine.lua new file mode 100644 index 0000000..a0c0647 --- /dev/null +++ b/config/nauts/marine.lua @@ -0,0 +1,8 @@ +--- ted +return +{ + name = "marine", + image = "assets/nauts/marine.png", + portrait = 24, + available = true +} diff --git a/config/nauts/megoman.lua b/config/nauts/megoman.lua new file mode 100644 index 0000000..119e0fc --- /dev/null +++ b/config/nauts/megoman.lua @@ -0,0 +1,8 @@ +--- clunk +return +{ + name = "megoman", + image = "assets/nauts/megoman.png", + portrait = 10, + available = true +} diff --git a/config/nauts/missile.lua b/config/nauts/missile.lua new file mode 100644 index 0000000..5fb4d49 --- /dev/null +++ b/config/nauts/missile.lua @@ -0,0 +1,8 @@ +--- commander rocket +return +{ + name = "missile", + image = "assets/nauts/missile.png", + portrait = 35, + available = true +} diff --git a/config/nauts/nemo.lua b/config/nauts/nemo.lua new file mode 100644 index 0000000..fabcae6 --- /dev/null +++ b/config/nauts/nemo.lua @@ -0,0 +1,8 @@ +--- spike +return +{ + name = "nemo", + image = "assets/nauts/nemo.png", + portrait = 17, + available = true +} diff --git a/config/nauts/phonebooth.lua b/config/nauts/phonebooth.lua new file mode 100644 index 0000000..3c1ad10 --- /dev/null +++ b/config/nauts/phonebooth.lua @@ -0,0 +1,8 @@ +--- sentry +return +{ + name = "phonebooth", + image = "assets/nauts/phonebooth.png", + portrait = 26, + available = true +} diff --git a/config/nauts/quack.lua b/config/nauts/quack.lua new file mode 100644 index 0000000..e4a0d7a --- /dev/null +++ b/config/nauts/quack.lua @@ -0,0 +1,8 @@ +--- rocco +return +{ + name = "quack", + image = "assets/nauts/quack.png", + portrait = 20, + available = true +} diff --git a/config/nauts/rock.lua b/config/nauts/rock.lua new file mode 100644 index 0000000..758e62a --- /dev/null +++ b/config/nauts/rock.lua @@ -0,0 +1,8 @@ +--- rock +return +{ + name = "rock", + image = "assets/nauts/rock.png", + portrait = 42, + available = false +} diff --git a/config/nauts/scissors.lua b/config/nauts/scissors.lua new file mode 100644 index 0000000..7526e47 --- /dev/null +++ b/config/nauts/scissors.lua @@ -0,0 +1,8 @@ +--- ksenia +return +{ + name = "scissors", + image = "assets/nauts/scissors.png", + portrait = 21, + available = true +} diff --git a/config/nauts/scooter.lua b/config/nauts/scooter.lua new file mode 100644 index 0000000..7b1a2aa --- /dev/null +++ b/config/nauts/scooter.lua @@ -0,0 +1,8 @@ +--- penny +return +{ + name = "scooter", + image = "assets/nauts/scooter.png", + portrait = 25, + available = true +} diff --git a/config/nauts/shutter.lua b/config/nauts/shutter.lua new file mode 100644 index 0000000..d0e7787 --- /dev/null +++ b/config/nauts/shutter.lua @@ -0,0 +1,8 @@ +--- max +return +{ + name = "shutter", + image = "assets/nauts/shutter.png", + portrait = 32, + available = true +} diff --git a/config/nauts/slugzor.lua b/config/nauts/slugzor.lua new file mode 100644 index 0000000..f51c5d3 --- /dev/null +++ b/config/nauts/slugzor.lua @@ -0,0 +1,8 @@ +--- derpl +return +{ + name = "slugzor", + image = "assets/nauts/slugzor.png", + portrait = 15, + available = true +} diff --git a/config/nauts/swarm.lua b/config/nauts/swarm.lua new file mode 100644 index 0000000..575478b --- /dev/null +++ b/config/nauts/swarm.lua @@ -0,0 +1,8 @@ +--- qitara +return +{ + name = "swarm", + image = "assets/nauts/swarm.png", + portrait = 36, + available = false +} diff --git a/config/nauts/veno.lua b/config/nauts/veno.lua new file mode 100644 index 0000000..8973173 --- /dev/null +++ b/config/nauts/veno.lua @@ -0,0 +1,8 @@ +--- gnaw +return +{ + name = "veno", + image = "assets/nauts/veno.png", + portrait = 7, + available = true +} diff --git a/config/nauts/vrooom.lua b/config/nauts/vrooom.lua new file mode 100644 index 0000000..fa02a68 --- /dev/null +++ b/config/nauts/vrooom.lua @@ -0,0 +1,8 @@ +--- lux +return +{ + name = "vrooom", + image = "assets/nauts/vrooom.png", + portrait = 31, + available = true +} diff --git a/config/nauts/weed.lua b/config/nauts/weed.lua new file mode 100644 index 0000000..4c2216e --- /dev/null +++ b/config/nauts/weed.lua @@ -0,0 +1,8 @@ +--- skree +return +{ + name = "weed", + image = "assets/nauts/weed.png", + portrait = 27, + available = true +} diff --git a/config/nauts/woman.lua b/config/nauts/woman.lua new file mode 100644 index 0000000..88ac22e --- /dev/null +++ b/config/nauts/woman.lua @@ -0,0 +1,8 @@ +--- coco +return +{ + name = "woman", + image = "assets/nauts/woman.png", + portrait = 12, + available = true +} diff --git a/config/nauts/yarr.lua b/config/nauts/yarr.lua new file mode 100644 index 0000000..cd8e724 --- /dev/null +++ b/config/nauts/yarr.lua @@ -0,0 +1,8 @@ +--- ted pirate +return +{ + name = "yarr", + image = "assets/nauts/yarr.png", + portrait = 39, + available = false +} -- cgit v1.1 From 118c64c62bb19239a28da08f928c2f8e74655f08 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 22 Sep 2017 18:01:09 +0200 Subject: Split map icons, menu now uses them --- config/maps/205.lua | 2 +- config/maps/404.lua | 4 ++-- config/maps/aiguillon.lua | 2 +- config/maps/alpha.lua | 2 +- config/maps/default.lua | 2 +- config/maps/ribbit.lua | 2 +- config/maps/rill.lua | 2 +- config/maps/sorona.lua | 2 +- config/maps/starstorm.lua | 2 +- config/menus/host.lua | 5 ++--- 10 files changed, 12 insertions(+), 13 deletions(-) (limited to 'config') diff --git a/config/maps/205.lua b/config/maps/205.lua index d0aa1f8..a20fe0a 100644 --- a/config/maps/205.lua +++ b/config/maps/205.lua @@ -2,7 +2,7 @@ return { name = "AI Station 205", theme = "sorona.ogg", - portrait = 1, -- TODO: See `maps/ribbit`. + portrait = "assets/maps/205.png", center = {x = 0, y = 0}, width = 360, height = 240, diff --git a/config/maps/404.lua b/config/maps/404.lua index 44b6c93..6a5b218 100644 --- a/config/maps/404.lua +++ b/config/maps/404.lua @@ -2,7 +2,7 @@ return { name = "AI Station 404", theme = "404.ogg", - portrait = 8, -- TODO: See `maps/ribbit`. + portrait = "assets/maps/404.png", center = {x = 0, y = 0}, width = 360, height = 240, @@ -48,4 +48,4 @@ return platform = "404-small" } } -} \ No newline at end of file +} diff --git a/config/maps/aiguillon.lua b/config/maps/aiguillon.lua index c4f0ee3..e79449f 100644 --- a/config/maps/aiguillon.lua +++ b/config/maps/aiguillon.lua @@ -2,7 +2,7 @@ return { name = "Aiguillon", theme = "aiguillon.ogg", - portrait = 5, -- TODO: See `maps/ribbit`. + portrait = "assets/maps/aiguillon.png", center = {x = 0, y = 10}, width = 370, height = 290, diff --git a/config/maps/alpha.lua b/config/maps/alpha.lua index 795b6cf..3942dde 100644 --- a/config/maps/alpha.lua +++ b/config/maps/alpha.lua @@ -2,7 +2,7 @@ return { name = "Alpha Abyss", theme = "alpha.ogg", - portrait = 7, -- TODO: See `maps/ribbit`. + portrait = "assets/maps/alpha.png", center = {x = 0, y = -80}, width = 360, height = 240, diff --git a/config/maps/default.lua b/config/maps/default.lua index 22c03f6..76cd9d3 100644 --- a/config/maps/default.lua +++ b/config/maps/default.lua @@ -2,7 +2,7 @@ return { name = "default", theme = "default.ogg", - portrait = 1, -- TODO: See `maps/ribbit`. + portrait = "assets/maps/default.png", center = {x = 0, y = 0}, width = 360, height = 240, diff --git a/config/maps/ribbit.lua b/config/maps/ribbit.lua index 08683ac..f5e267e 100644 --- a/config/maps/ribbit.lua +++ b/config/maps/ribbit.lua @@ -2,7 +2,7 @@ return { name = "Ribbit IV", theme = "ribbit.ogg", - portrait = 3, -- TODO: Either separate portraits now or change `iconsList` and `menu/host`. See also both mentioned files. + portrait = "assets/maps/ribbit.png", center = {x = 0, y = 50}, width = 360, height = 240, diff --git a/config/maps/rill.lua b/config/maps/rill.lua index b027923..4644ecc 100644 --- a/config/maps/rill.lua +++ b/config/maps/rill.lua @@ -2,7 +2,7 @@ return { name = "Rill", theme = "rill.ogg", - portrait = 2, -- TODO: See `maps/ribbit`. + portrait = "assets/maps/rill.png", center = {x = 0, y = 75}, width = 400, height = 260, diff --git a/config/maps/sorona.lua b/config/maps/sorona.lua index 4cc87cd..54543c2 100644 --- a/config/maps/sorona.lua +++ b/config/maps/sorona.lua @@ -2,7 +2,7 @@ return { name = "Sorona", theme = "sorona.ogg", - portrait = 6, -- TODO: See `maps/ribbit`. + portrait = "assets/maps/sorona.png", center = {x = 0, y = 0}, width = 360, height = 240, diff --git a/config/maps/starstorm.lua b/config/maps/starstorm.lua index b4fabcd..bb35a08 100644 --- a/config/maps/starstorm.lua +++ b/config/maps/starstorm.lua @@ -2,7 +2,7 @@ return { name = "Starstorm", theme = "starstorm.ogg", - portrait = 4, -- TODO: See `maps/ribbit`. + portrait = "assets/maps/starstorm.png", center = {x = 0, y = -20}, width = 400, height = 260, diff --git a/config/menus/host.lua b/config/menus/host.lua index c8ef4d8..571fc50 100644 --- a/config/menus/host.lua +++ b/config/menus/host.lua @@ -21,7 +21,7 @@ do local i, name = map.portrait, map.name map.filename = path if i then - table.insert(icons, love.graphics.newQuad((i-1)*76, 0, 76, 37, 608, 37)) + table.insert(icons, love.graphics.newImage(map.portrait)) table.insert(maps, map) end end @@ -35,8 +35,7 @@ return { mapSelector :setPosition(width/2-40, 40) :set("shape", Selector.SHAPE_PANORAMA) - :set("icons_quads", icons) - :set("icons_atlas", love.graphics.newImage("assets/maps.png")) + :set("icons", icons) :set("getText", function (self) return self:getSelected().name end) -- cgit v1.1 From e5ad6ac474423176f13a70ae30904aaa48365eda Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 22 Sep 2017 18:02:03 +0200 Subject: Split portraits, menu now should use them --- config/menus/select.lua | 10 +++++----- config/nauts/biker.lua | 2 +- config/nauts/bison.lua | 2 +- config/nauts/blblal.lua | 2 +- config/nauts/bobito.lua | 2 +- config/nauts/brainos.lua | 2 +- config/nauts/bug.lua | 2 +- config/nauts/calamari.lua | 2 +- config/nauts/capone.lua | 2 +- config/nauts/cowboy.lua | 2 +- config/nauts/cowman.lua | 2 +- config/nauts/disco.lua | 2 +- config/nauts/dundee.lua | 2 +- config/nauts/froggirl.lua | 2 +- config/nauts/froggo.lua | 2 +- config/nauts/gelato.lua | 2 +- config/nauts/girl.lua | 2 +- config/nauts/gramps.lua | 2 +- config/nauts/gummybear.lua | 2 +- config/nauts/honic.lua | 2 +- config/nauts/kong.lua | 2 +- config/nauts/lady.lua | 2 +- config/nauts/link.lua | 2 +- config/nauts/marine.lua | 2 +- config/nauts/megoman.lua | 2 +- config/nauts/missile.lua | 2 +- config/nauts/nemo.lua | 2 +- config/nauts/phonebooth.lua | 2 +- config/nauts/quack.lua | 2 +- config/nauts/rock.lua | 2 +- config/nauts/scissors.lua | 2 +- config/nauts/scooter.lua | 2 +- config/nauts/shutter.lua | 2 +- config/nauts/slugzor.lua | 2 +- config/nauts/veno.lua | 2 +- config/nauts/vrooom.lua | 2 +- config/nauts/weed.lua | 2 +- config/nauts/woman.lua | 2 +- config/nauts/yarr.lua | 2 +- 39 files changed, 43 insertions(+), 43 deletions(-) (limited to 'config') diff --git a/config/menus/select.lua b/config/menus/select.lua index 0d8bef9..fb99780 100644 --- a/config/menus/select.lua +++ b/config/menus/select.lua @@ -14,7 +14,7 @@ if background == nil or not background:is(require "not.MenuBackground") then background = require "not.MenuBackground"(menu) end --- TODO: Icons for nauts and maps are still waiting to get their assets split. +-- TODO: Clean-up menus/select, menus/host and Hero after portraits split. local group, get do local atlas = love.graphics.newImage("assets/portraits.png") @@ -26,16 +26,16 @@ do local naut = love.filesystem.load(path)() local i, name = naut.portrait, naut.name if naut.available then - table.insert(icons, love.graphics.newQuad((i-1)*28, 0, 28, 27, 1176, 27)) + table.insert(icons, love.graphics.newImage(naut.portrait)) table.insert(nauts, naut) end end end -- TODO: Find a better way to add empty and random entries to naut Selector. - table.insert(icons, 1, love.graphics.newQuad((1-1)*28, 0, 28, 27, 1176, 27)) + table.insert(icons, 1, false) table.insert(nauts, 1, {name = "empty"}) - table.insert(icons, 2, love.graphics.newQuad((2-1)*28, 0, 28, 27, 1176, 27)) + table.insert(icons, 2, love.graphics.newImage("assets/portraits/random.png")) table.insert(nauts, 2, {name = "random"}) group = Group(menu) @@ -59,7 +59,7 @@ do for i,_ in pairs(Controller.getSets()) do group:addChild(Selector(nauts, group, menu)) :set("icons_atlas", atlas) - :set("icons_quads", icons) + :set("icons", icons) :set("attack", attack) :set("getText", function (self) return string.upper(self:getSelected().name) diff --git a/config/nauts/biker.lua b/config/nauts/biker.lua index c139e87..2a9fb2b 100644 --- a/config/nauts/biker.lua +++ b/config/nauts/biker.lua @@ -3,6 +3,6 @@ return { name = "biker", image = "assets/nauts/biker.png", - portrait = 30, + portrait = "assets/portraits/biker.png", available = true } diff --git a/config/nauts/bison.lua b/config/nauts/bison.lua index 35c08ca..023d9f8 100644 --- a/config/nauts/bison.lua +++ b/config/nauts/bison.lua @@ -3,6 +3,6 @@ return { name = "bison", image = "assets/nauts/bison.png", - portrait = 13, + portrait = "assets/portraits/bison.png", available = true } diff --git a/config/nauts/blblal.lua b/config/nauts/blblal.lua index 4bc9884..7be25ef 100644 --- a/config/nauts/blblal.lua +++ b/config/nauts/blblal.lua @@ -3,6 +3,6 @@ return { name = "blblal", image = "assets/nauts/blblal.png", - portrait = 40, + portrait = "assets/portraits/blblal.png", available = false } diff --git a/config/nauts/bobito.lua b/config/nauts/bobito.lua index f00fa7f..fde84ae 100644 --- a/config/nauts/bobito.lua +++ b/config/nauts/bobito.lua @@ -3,6 +3,6 @@ return { name = "bobito", image = "assets/nauts/bobito.png", - portrait = 14, + portrait = "assets/portraits/bobito.png", available = true } diff --git a/config/nauts/brainos.lua b/config/nauts/brainos.lua index 908f57a..64a94b2 100644 --- a/config/nauts/brainos.lua +++ b/config/nauts/brainos.lua @@ -3,6 +3,6 @@ return { name = "brainos", image = "assets/nauts/brainos.png", - portrait = 11, + portrait = "assets/portraits/brainos.png", available = true } diff --git a/config/nauts/bug.lua b/config/nauts/bug.lua index 3989ade..676d2fa 100644 --- a/config/nauts/bug.lua +++ b/config/nauts/bug.lua @@ -3,6 +3,6 @@ return { name = "bug", image = "assets/nauts/bug.png", - portrait = 18, + portrait = "assets/portraits/bug.png", available = true } diff --git a/config/nauts/calamari.lua b/config/nauts/calamari.lua index 3168023..ef41720 100644 --- a/config/nauts/calamari.lua +++ b/config/nauts/calamari.lua @@ -3,6 +3,6 @@ return { name = "calamari", image = "assets/nauts/calamari.png", - portrait = 19, + portrait = "assets/portraits/calamari.png", available = true } diff --git a/config/nauts/capone.lua b/config/nauts/capone.lua index edd5f35..459760f 100644 --- a/config/nauts/capone.lua +++ b/config/nauts/capone.lua @@ -3,6 +3,6 @@ return { name = "capone", image = "assets/nauts/capone.png", - portrait = 16, + portrait = "assets/portraits/capone.png", available = true } diff --git a/config/nauts/cowboy.lua b/config/nauts/cowboy.lua index d7ac120..e3e9c19 100644 --- a/config/nauts/cowboy.lua +++ b/config/nauts/cowboy.lua @@ -3,6 +3,6 @@ return { name = "cowboy", image = "assets/nauts/cowboy.png", - portrait = 4, + portrait = "assets/portraits/cowboy.png", available = true } diff --git a/config/nauts/cowman.lua b/config/nauts/cowman.lua index 5bbde57..6e2c4aa 100644 --- a/config/nauts/cowman.lua +++ b/config/nauts/cowman.lua @@ -3,6 +3,6 @@ return { name = "cowman", image = "assets/nauts/cowman.png", - portrait = 23, + portrait = "assets/portraits/cowman.png", available = true } diff --git a/config/nauts/disco.lua b/config/nauts/disco.lua index e579257..fb21110 100644 --- a/config/nauts/disco.lua +++ b/config/nauts/disco.lua @@ -3,6 +3,6 @@ return { name = "disco", image = "assets/nauts/disco.png", - portrait = 37, + portrait = "assets/portraits/disco.png", available = false } diff --git a/config/nauts/dundee.lua b/config/nauts/dundee.lua index 3299db8..e9f7c5d 100644 --- a/config/nauts/dundee.lua +++ b/config/nauts/dundee.lua @@ -3,6 +3,6 @@ return { name = "dundee", image = "assets/nauts/dundee.png", - portrait = 34, + portrait = "assets/portraits/dundee.png", available = true } diff --git a/config/nauts/froggirl.lua b/config/nauts/froggirl.lua index b587043..9734f1d 100644 --- a/config/nauts/froggirl.lua +++ b/config/nauts/froggirl.lua @@ -3,6 +3,6 @@ return { name = "froggirl", image = "assets/nauts/froggirl.png", - portrait = 33, + portrait = "assets/portraits/froggirl.png", available = true } diff --git a/config/nauts/froggo.lua b/config/nauts/froggo.lua index e1c7d85..03fc9a2 100644 --- a/config/nauts/froggo.lua +++ b/config/nauts/froggo.lua @@ -3,6 +3,6 @@ return { name = "froggo", image = "assets/nauts/froggo.png", - portrait = 3, + portrait = "assets/portraits/froggo.png", available = true } diff --git a/config/nauts/gelato.lua b/config/nauts/gelato.lua index f3f4ed5..4313fef 100644 --- a/config/nauts/gelato.lua +++ b/config/nauts/gelato.lua @@ -3,6 +3,6 @@ return { name = "gelato", image = "assets/nauts/gelato.png", - portrait = 6, + portrait = "assets/portraits/gelato.png", available = true } diff --git a/config/nauts/girl.lua b/config/nauts/girl.lua index b1d9d8a..32c7f11 100644 --- a/config/nauts/girl.lua +++ b/config/nauts/girl.lua @@ -3,6 +3,6 @@ return { name = "girl", image = "assets/nauts/girl.png", - portrait = 9, + portrait = "assets/portraits/girl.png", available = true } diff --git a/config/nauts/gramps.lua b/config/nauts/gramps.lua index 51aa672..7bf7b29 100644 --- a/config/nauts/gramps.lua +++ b/config/nauts/gramps.lua @@ -3,6 +3,6 @@ return { name = "gramps", image = "assets/nauts/gramps.png", - portrait = 29, + portrait = "assets/portraits/gramps.png", available = true } diff --git a/config/nauts/gummybear.lua b/config/nauts/gummybear.lua index a39287f..83294ed 100644 --- a/config/nauts/gummybear.lua +++ b/config/nauts/gummybear.lua @@ -3,6 +3,6 @@ return { name = "gummybear", image = "assets/nauts/gummybear.png", - portrait = 28, + portrait = "assets/portraits/gummybear.png", available = true } diff --git a/config/nauts/honic.lua b/config/nauts/honic.lua index 2ff6584..463409f 100644 --- a/config/nauts/honic.lua +++ b/config/nauts/honic.lua @@ -3,6 +3,6 @@ return { name = "honic", image = "assets/nauts/honic.png", - portrait = 5, + portrait = "assets/portraits/honic.png", available = true } diff --git a/config/nauts/kong.lua b/config/nauts/kong.lua index 731f7f1..28bcc70 100644 --- a/config/nauts/kong.lua +++ b/config/nauts/kong.lua @@ -3,6 +3,6 @@ return { name = "kong", image = "assets/nauts/kong.png", - portrait = 41, + portrait = "assets/portraits/kong.png", available = false } diff --git a/config/nauts/lady.lua b/config/nauts/lady.lua index 77ef7a3..1faf330 100644 --- a/config/nauts/lady.lua +++ b/config/nauts/lady.lua @@ -3,6 +3,6 @@ return { name = "lady", image = "assets/nauts/lady.png", - portrait = 8, + portrait = "assets/portraits/lady.png", available = true } diff --git a/config/nauts/link.lua b/config/nauts/link.lua index 1f6b430..105d543 100644 --- a/config/nauts/link.lua +++ b/config/nauts/link.lua @@ -3,6 +3,6 @@ return { name = "link", image = "assets/nauts/link.png", - portrait = 22, + portrait = "assets/portraits/link.png", available = true } diff --git a/config/nauts/marine.lua b/config/nauts/marine.lua index a0c0647..88ecbcc 100644 --- a/config/nauts/marine.lua +++ b/config/nauts/marine.lua @@ -3,6 +3,6 @@ return { name = "marine", image = "assets/nauts/marine.png", - portrait = 24, + portrait = "assets/portraits/marine.png", available = true } diff --git a/config/nauts/megoman.lua b/config/nauts/megoman.lua index 119e0fc..28e6744 100644 --- a/config/nauts/megoman.lua +++ b/config/nauts/megoman.lua @@ -3,6 +3,6 @@ return { name = "megoman", image = "assets/nauts/megoman.png", - portrait = 10, + portrait = "assets/portraits/megoman.png", available = true } diff --git a/config/nauts/missile.lua b/config/nauts/missile.lua index 5fb4d49..7c65822 100644 --- a/config/nauts/missile.lua +++ b/config/nauts/missile.lua @@ -3,6 +3,6 @@ return { name = "missile", image = "assets/nauts/missile.png", - portrait = 35, + portrait = "assets/portraits/missile.png", available = true } diff --git a/config/nauts/nemo.lua b/config/nauts/nemo.lua index fabcae6..e1d5048 100644 --- a/config/nauts/nemo.lua +++ b/config/nauts/nemo.lua @@ -3,6 +3,6 @@ return { name = "nemo", image = "assets/nauts/nemo.png", - portrait = 17, + portrait = "assets/portraits/nemo.png", available = true } diff --git a/config/nauts/phonebooth.lua b/config/nauts/phonebooth.lua index 3c1ad10..d0577ff 100644 --- a/config/nauts/phonebooth.lua +++ b/config/nauts/phonebooth.lua @@ -3,6 +3,6 @@ return { name = "phonebooth", image = "assets/nauts/phonebooth.png", - portrait = 26, + portrait = "assets/portraits/phonebooth.png", available = true } diff --git a/config/nauts/quack.lua b/config/nauts/quack.lua index e4a0d7a..6fb11ab 100644 --- a/config/nauts/quack.lua +++ b/config/nauts/quack.lua @@ -3,6 +3,6 @@ return { name = "quack", image = "assets/nauts/quack.png", - portrait = 20, + portrait = "assets/portraits/quack.png", available = true } diff --git a/config/nauts/rock.lua b/config/nauts/rock.lua index 758e62a..9a7efe4 100644 --- a/config/nauts/rock.lua +++ b/config/nauts/rock.lua @@ -3,6 +3,6 @@ return { name = "rock", image = "assets/nauts/rock.png", - portrait = 42, + portrait = "assets/portraits/rock.png", available = false } diff --git a/config/nauts/scissors.lua b/config/nauts/scissors.lua index 7526e47..0fd4e28 100644 --- a/config/nauts/scissors.lua +++ b/config/nauts/scissors.lua @@ -3,6 +3,6 @@ return { name = "scissors", image = "assets/nauts/scissors.png", - portrait = 21, + portrait = "assets/portraits/scissors.png", available = true } diff --git a/config/nauts/scooter.lua b/config/nauts/scooter.lua index 7b1a2aa..321563c 100644 --- a/config/nauts/scooter.lua +++ b/config/nauts/scooter.lua @@ -3,6 +3,6 @@ return { name = "scooter", image = "assets/nauts/scooter.png", - portrait = 25, + portrait = "assets/portraits/scooter.png", available = true } diff --git a/config/nauts/shutter.lua b/config/nauts/shutter.lua index d0e7787..40ab49b 100644 --- a/config/nauts/shutter.lua +++ b/config/nauts/shutter.lua @@ -3,6 +3,6 @@ return { name = "shutter", image = "assets/nauts/shutter.png", - portrait = 32, + portrait = "assets/portraits/shutter.png", available = true } diff --git a/config/nauts/slugzor.lua b/config/nauts/slugzor.lua index f51c5d3..7dead62 100644 --- a/config/nauts/slugzor.lua +++ b/config/nauts/slugzor.lua @@ -3,6 +3,6 @@ return { name = "slugzor", image = "assets/nauts/slugzor.png", - portrait = 15, + portrait = "assets/portraits/slugzor.png", available = true } diff --git a/config/nauts/veno.lua b/config/nauts/veno.lua index 8973173..6663a37 100644 --- a/config/nauts/veno.lua +++ b/config/nauts/veno.lua @@ -3,6 +3,6 @@ return { name = "veno", image = "assets/nauts/veno.png", - portrait = 7, + portrait = "assets/portraits/veno.png", available = true } diff --git a/config/nauts/vrooom.lua b/config/nauts/vrooom.lua index fa02a68..5d6e17f 100644 --- a/config/nauts/vrooom.lua +++ b/config/nauts/vrooom.lua @@ -3,6 +3,6 @@ return { name = "vrooom", image = "assets/nauts/vrooom.png", - portrait = 31, + portrait = "assets/portraits/vrooom.png", available = true } diff --git a/config/nauts/weed.lua b/config/nauts/weed.lua index 4c2216e..767a118 100644 --- a/config/nauts/weed.lua +++ b/config/nauts/weed.lua @@ -3,6 +3,6 @@ return { name = "weed", image = "assets/nauts/weed.png", - portrait = 27, + portrait = "assets/portraits/weed.png", available = true } diff --git a/config/nauts/woman.lua b/config/nauts/woman.lua index 88ac22e..9c12d8a 100644 --- a/config/nauts/woman.lua +++ b/config/nauts/woman.lua @@ -3,6 +3,6 @@ return { name = "woman", image = "assets/nauts/woman.png", - portrait = 12, + portrait = "assets/portraits/woman.png", available = true } diff --git a/config/nauts/yarr.lua b/config/nauts/yarr.lua index cd8e724..b471d4b 100644 --- a/config/nauts/yarr.lua +++ b/config/nauts/yarr.lua @@ -3,6 +3,6 @@ return { name = "yarr", image = "assets/nauts/yarr.png", - portrait = 39, + portrait = "assets/portraits/yarr.png", available = false } -- cgit v1.1 From b29adf54e26d16ec7f78e9dd865bc1ce807d3f14 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 22 Sep 2017 18:04:52 +0200 Subject: Removed obsolete attempts to load portraits atlas --- config/menus/select.lua | 2 -- 1 file changed, 2 deletions(-) (limited to 'config') diff --git a/config/menus/select.lua b/config/menus/select.lua index fb99780..a803295 100644 --- a/config/menus/select.lua +++ b/config/menus/select.lua @@ -17,7 +17,6 @@ end -- TODO: Clean-up menus/select, menus/host and Hero after portraits split. local group, get do - local atlas = love.graphics.newImage("assets/portraits.png") local nauts, icons = {}, {} local files = love.filesystem.getDirectoryItems("config/nauts") for _,filename in pairs(files) do @@ -58,7 +57,6 @@ do for i,_ in pairs(Controller.getSets()) do group:addChild(Selector(nauts, group, menu)) - :set("icons_atlas", atlas) :set("icons", icons) :set("attack", attack) :set("getText", function (self) -- cgit v1.1 From 704fa62d2f75e9fca66d94bb809d14785178abed Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 22 Sep 2017 18:18:18 +0200 Subject: Removed obsolete icons functions --- config/menus/host.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/menus/host.lua b/config/menus/host.lua index 571fc50..d586388 100644 --- a/config/menus/host.lua +++ b/config/menus/host.lua @@ -10,7 +10,7 @@ if background == nil or not background:is(require "not.MenuBackground") then background = require "not.MenuBackground"(menu) end --- TODO: This is temporary solution for generating available maps list and portraits for them to pass to Selector. See also: `iconsList`. +-- TODO: This is temporary solution for generating available maps list and portraits for them to pass to Selector. local icons, maps = {}, {} do local files = love.filesystem.getDirectoryItems("config/maps") -- cgit v1.1 From b9f8a7bf85c88a3955d28824627a65efa193e8ad Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 22 Sep 2017 19:20:30 +0200 Subject: Cleaned-up icons and items population for selectors in menu --- config/menus/host.lua | 27 ++++++++++++++------------- config/menus/select.lua | 31 ++++++++++++++++++------------- 2 files changed, 32 insertions(+), 26 deletions(-) (limited to 'config') diff --git a/config/menus/host.lua b/config/menus/host.lua index d586388..ce67047 100644 --- a/config/menus/host.lua +++ b/config/menus/host.lua @@ -10,24 +10,25 @@ if background == nil or not background:is(require "not.MenuBackground") then background = require "not.MenuBackground"(menu) end --- TODO: This is temporary solution for generating available maps list and portraits for them to pass to Selector. -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 - map.filename = path - if i then - table.insert(icons, love.graphics.newImage(map.portrait)) - table.insert(maps, map) +-- TODO: loadConfigs is duplicated in menus/select and menus/host. +local +function loadConfigs (dir, process) + local items, icons = {}, {} + for _,file in pairs(love.filesystem.getDirectoryItems(dir)) do + local path = string.format("%s/%s", dir, file) + if love.filesystem.isFile(path) and file ~= "readme.md" then + local item = love.filesystem.load(path)() + if item and process(item, file, path) then + table.insert(icons, love.graphics.newImage(item.portrait)) + table.insert(items, item) end end end + return items, icons end +-- TODO: This is temporary solution for generating available maps list and portraits for them to pass to Selector. +local maps, icons = loadConfigs("config/maps", function (map, _, path) map.filename = path; return true end) local mapSelector = Selector(maps, nil, menu) return { diff --git a/config/menus/select.lua b/config/menus/select.lua index a803295..91da7c9 100644 --- a/config/menus/select.lua +++ b/config/menus/select.lua @@ -14,22 +14,27 @@ if background == nil or not background:is(require "not.MenuBackground") then background = require "not.MenuBackground"(menu) end --- TODO: Clean-up menus/select, menus/host and Hero after portraits split. -local group, get -do - local nauts, icons = {}, {} - local files = love.filesystem.getDirectoryItems("config/nauts") - for _,filename in pairs(files) do - local path = string.format("config/nauts/%s", filename) - if love.filesystem.isFile(path) and filename ~= "readme.md" then - local naut = love.filesystem.load(path)() - local i, name = naut.portrait, naut.name - if naut.available then - table.insert(icons, love.graphics.newImage(naut.portrait)) - table.insert(nauts, naut) +-- TODO: loadConfigs is duplicated in menus/select and menus/host. +local +function loadConfigs (dir, process) + local items, icons = {}, {} + for _,file in pairs(love.filesystem.getDirectoryItems(dir)) do + local path = string.format("%s/%s", dir, file) + if love.filesystem.isFile(path) and file ~= "readme.md" then + local item = love.filesystem.load(path)() + if item and process(item) then + table.insert(icons, love.graphics.newImage(item.portrait)) + table.insert(items, item) end end end + return items, icons +end + +-- TODO: Clean-up menus/select, menus/host and Hero after portraits split. +local group, get +do + local nauts, icons = loadConfigs("config/nauts", function (naut) return naut.available end) -- TODO: Find a better way to add empty and random entries to naut Selector. table.insert(icons, 1, false) -- cgit v1.1 From eabad160152f5bf6e7dd442de46b135a1a59f75e Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 22 Sep 2017 19:38:01 +0200 Subject: Changed name of local button --- config/menus/select.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/menus/select.lua b/config/menus/select.lua index 91da7c9..6dc9d01 100644 --- a/config/menus/select.lua +++ b/config/menus/select.lua @@ -8,7 +8,7 @@ local Group = require "not.Group" local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() local bx = width/2-29 -local start_Button = Button(menu) +local startButton = Button(menu) if background == nil or not background:is(require "not.MenuBackground") then background = require "not.MenuBackground"(menu) @@ -85,7 +85,7 @@ end return { background, group, - start_Button + startButton :setText("Force start") :setPosition(bx,134) :set("isEnabled", function () @@ -123,7 +123,7 @@ return { self.the_final_countdown = 9 end if self.the_final_countdown < 0 then - start_Button:active() + startButton:active() end end) , -- cgit v1.1