From a57c35bec944d46b660cdbd17c6204dadd4e105b Mon Sep 17 00:00:00 2001 From: "Squishy (C6H12O6+NaCl+H2O)" <106439598+SweetSea-ButImNotSweet@users.noreply.github.com> Date: Tue, 21 May 2024 22:11:19 +0700 Subject: [PATCH] TEST --- scene/title.lua | 55 +++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/scene/title.lua b/scene/title.lua index b02211f..14e2351 100644 --- a/scene/title.lua +++ b/scene/title.lua @@ -93,31 +93,7 @@ end function TitleScene:onInputPress(e) if e.type == "touch" then - local selecting = math.floor((e.y - 198) / 20) - if - (e.x >= 20 and e.x <= 260) and - (selecting > 0 and selecting <= #main_menu_screens) - then - if self.main_menu_state ~= selecting then - self.main_menu_state = selecting - else - VCTRL.toggle(true) - SCENE = main_menu_screens[selecting]() - end - elseif - e.x >= 14 and - e.y >= 40 and - e.x <= 274 and - e.y <= 160 - then - if e.x >= 137 then -- Right - table.remove(self.code, 8) - table.insert(self.code, 1, 1) - else -- Left - table.remove(self.code, 8) - table.insert(self.code, 1, -1) - end - end + else if e.input == "menu_decide" or e.input == "rotate_left" or e.scancode == "return" then SCENE = main_menu_screens[self.main_menu_state]() @@ -135,4 +111,33 @@ function TitleScene:onInputPress(e) end end +function TitleScene:onInputRelease(e) + if e.type ~= "touch" then return end + local selecting = math.floor((e.y - 198) / 20) + if + (e.x >= 20 and e.x <= 260) and + (selecting > 0 and selecting <= #main_menu_screens) + then + if self.main_menu_state ~= selecting then + self.main_menu_state = selecting + else + VCTRL.toggle(true) + SCENE = main_menu_screens[selecting]() + end + elseif + e.x >= 14 and + e.y >= 40 and + e.x <= 274 and + e.y <= 160 + then + if e.x >= 137 then -- Right + table.remove(self.code, 8) + table.insert(self.code, 1, 1) + else -- Left + table.remove(self.code, 8) + table.insert(self.code, 1, -1) + end + end +end + return TitleScene