mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Replace `table.getn with # and scene with SCENE`
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
local ConfigScene = Scene:extend()
|
||||
local ConfigScene = SCENE:extend()
|
||||
|
||||
ConfigScene.title = "Input Config"
|
||||
|
||||
@@ -39,13 +39,13 @@ function ConfigScene:render()
|
||||
end
|
||||
|
||||
function ConfigScene:changeOption(rel)
|
||||
local len = table.getn(menu_screens)
|
||||
local len = #menu_screens
|
||||
self.menu_state = (self.menu_state + len + rel - 1) % len + 1
|
||||
end
|
||||
|
||||
function ConfigScene:onInputPress(e)
|
||||
if e.input == "menu_decide" or e.input == "rotate_left" or e.scancode == "return" then
|
||||
scene = menu_screens[self.menu_state]()
|
||||
SCENE = menu_screens[self.menu_state]()
|
||||
elseif e.input == "up" or e.scancode == "up" then
|
||||
self:changeOption(-1)
|
||||
elseif e.input == "down" or e.scancode == "down" then
|
||||
@@ -53,7 +53,7 @@ function ConfigScene:onInputPress(e)
|
||||
elseif config.input and (
|
||||
e.input == "menu_back" or e.input == "rotate_right" or e.scancode == "backspace" or e.scancode == "delete"
|
||||
) then
|
||||
scene = TitleScene()
|
||||
SCENE = TitleScene()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user