From cc518b9216379464ccce1f903686451e428d1479 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 15 Aug 2016 00:24:09 +0200 Subject: This is so funny, kek --- menu.lua | 38 ++++++++------------------------------ selector.lua | 2 -- 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/menu.lua b/menu.lua index 28776f8..c281d8c 100644 --- a/menu.lua +++ b/menu.lua @@ -78,29 +78,6 @@ function Menu:getSelectorsInactive() return t end --- Selectors numbers getters -function Menu:getSelectorsNumberAll() - return #self.selectors -end -function Menu:getSelectorsNumberActive() - local n = 0 - for _,selector in pairs(self.selectors) do - if selector:getController() ~= nil then - n = n + 1 - end - end - return n -end -function Menu:getSelectorsNumberInactive() - local n = 0 - for _,selector in pairs(self.selectors) do - if selector:getController() == nil then - n = n + 1 - end - end - return n -end - -- Header get bounce move function Menu:getBounce(f) local f = f or 1 @@ -133,7 +110,7 @@ end -- Update function Menu:update(dt) local state = true - if self:getSelectorsNumberActive() > 1 then + if #self:getSelectorsActive() > 1 then for _,selector in pairs(self:getSelectorsActive()) do state = state and selector.state end @@ -184,12 +161,9 @@ end -- Controller callbacks function Menu:controlpressed(set, action, key) - -- assign to character selection - if control == "attack" then - local selector = self:getSelectorsInactive()[1] - if selector ~= nil then - selector:assignController(controller) - end + -- pass to selectors + for k,selector in pairs(Menu:getSelectorsAll()) do + selector:controlpressed(set, action, key) end -- map selection chaos! if action == "left" then @@ -206,6 +180,10 @@ function Menu:controlpressed(set, action, key) self.map = 1 end end + -- speed up the countdown + if action ~= "jump" then + self:countdownJump() + end end function Menu:controlreleased(set, action, key) end \ No newline at end of file diff --git a/selector.lua b/selector.lua index 23939b6..ae62e13 100644 --- a/selector.lua +++ b/selector.lua @@ -93,8 +93,6 @@ function Selector:controlpressed(set, action, key) self.parent:unselectSelector(self) end end - -- Speed up countdown - self.parent:countdownJump() end function Selector:controlreleased(set, action, key) end \ No newline at end of file -- cgit v1.1