diff options
author | Aki <nthirtyone@gmail.com> | 2016-12-20 06:02:05 +0100 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-12-20 06:02:05 +0100 |
commit | 73bcd524906c51d43b22b3ea68c64b38f130bea6 (patch) | |
tree | 998fe4fd04f901e411e366f4acdf142afe302a88 /menu.lua | |
parent | 941d0214a4a1b499190f4f3c6133b5e512d897fe (diff) | |
download | roflnauts-73bcd524906c51d43b22b3ea68c64b38f130bea6.zip roflnauts-73bcd524906c51d43b22b3ea68c64b38f130bea6.tar.gz roflnauts-73bcd524906c51d43b22b3ea68c64b38f130bea6.tar.bz2 |
I have no idea why I have put everything in one commit
Diffstat (limited to 'menu.lua')
-rw-r--r-- | menu.lua | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -12,6 +12,7 @@ Menu = { music, sprite, background, + allowMove = true, quads = { button = { normal = love.graphics.newQuad(0, 0, 58,15, 80,130), @@ -95,14 +96,20 @@ end -- Controller callbacks function Menu:controlpressed(set, action, key) - if action == "down" then - self:next() - end - if action == "up" then - self:previous() + if self.allowMove then + if action == "down" then + self:next() + end + if action == "up" then + self:previous() + end end for _,element in pairs(self.elements) do element:controlpressed(set, action, key) end end -function Menu:controlreleased(set, action, key) end
\ No newline at end of file +function Menu:controlreleased(set, action, key) + for _,element in pairs(self.elements) do + element:controlreleased(set, action, key) + end +end
\ No newline at end of file |