From 4bb25bb6c752efba17ffbc97bd4de9b3f33a190b Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 24 Aug 2016 05:46:11 +0200 Subject: it's alive! (almost) --- selector.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/selector.lua b/selector.lua index 38e7eb9..f07b9e7 100644 --- a/selector.lua +++ b/selector.lua @@ -152,6 +152,9 @@ function Selector:drawBlock(n, x, y, scale) else love.graphics.draw(sprite, quad.active, x*scale, y*scale, 0, scale, scale) end + if self:getSelection(n) ~= 1 then + love.graphics.printf(string.upper(name), (x-8)*scale, (y+33)*scale, 48, "center", 0, scale, scale) + end end -- Menu callbacks @@ -175,7 +178,12 @@ function Selector:update(dt) end -- Controller callbacks function Selector:controlpressed(set, action, key) - self:next(1) + if set and self.focused then + local n = self:checkNumber(set) + local locked = self:isLocked(n) + if action == "left" and not locked then self:previous(n) end + if action == "right" and not locked then self:next(n) end + end end function Selector:controlreleased(set, action, key) end -- cgit v1.1