summaryrefslogtreecommitdiffhomepage
path: root/menu.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-12-20 06:02:05 +0100
committerAki <nthirtyone@gmail.com>2016-12-20 06:02:05 +0100
commit73bcd524906c51d43b22b3ea68c64b38f130bea6 (patch)
tree998fe4fd04f901e411e366f4acdf142afe302a88 /menu.lua
parent941d0214a4a1b499190f4f3c6133b5e512d897fe (diff)
downloadroflnauts-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.lua19
1 files changed, 13 insertions, 6 deletions
diff --git a/menu.lua b/menu.lua
index e24bc64..b72ea09 100644
--- a/menu.lua
+++ b/menu.lua
@@ -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