From 78654392715768991cb10fc7c1aca60859e58516 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 5 Sep 2017 02:03:35 +0200 Subject: Centered nauts selectors group --- config/menus/select.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'config/menus') diff --git a/config/menus/select.lua b/config/menus/select.lua index a3c379b..c4a9595 100644 --- a/config/menus/select.lua +++ b/config/menus/select.lua @@ -28,19 +28,17 @@ do end group = Group(menu) - local - function add (element) - table.insert(group.children, element) - return element - end for i,_ in pairs(Controller.getSets()) do - add(Selector(nauts, group, menu)) - :setPosition(10+48*(i-1), 10) + group:addChild(Selector(nauts, group, menu)) :set("icons_atlas", atlas) :set("icons_quads", icons) end + group:set("margin", 16) + local gw, gh = group:getSize() + group:setPosition((width - gw)/2, 10) + function get () local selection = group:callEach("getSelected") for i,naut in ipairs(selection) do -- cgit v1.1