summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-08-24 05:46:11 +0200
committerAki <nthirtyone@gmail.com>2016-08-24 05:46:11 +0200
commit4bb25bb6c752efba17ffbc97bd4de9b3f33a190b (patch)
tree267153386944712064d3d0fbb0cf946ec84f5e21
parentbf9ad0478e6b72f0e19af9cb7e65337521721e77 (diff)
downloadroflnauts-4bb25bb6c752efba17ffbc97bd4de9b3f33a190b.zip
roflnauts-4bb25bb6c752efba17ffbc97bd4de9b3f33a190b.tar.gz
roflnauts-4bb25bb6c752efba17ffbc97bd4de9b3f33a190b.tar.bz2
it's alive! (almost)
-rw-r--r--selector.lua10
1 files changed, 9 insertions, 1 deletions
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