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 KeyConfigScene = Scene:extend()
|
||||
local KeyConfigScene = SCENE:extend()
|
||||
|
||||
KeyConfigScene.title = "Key Config"
|
||||
|
||||
@@ -58,7 +58,7 @@ function KeyConfigScene:render()
|
||||
drawText(self.set_inputs[input], 240, 50 + i * 20, 300, "left")
|
||||
end
|
||||
end
|
||||
if self.input_state > table.getn(configurable_inputs) then
|
||||
if self.input_state > #configurable_inputs then
|
||||
drawText("Press enter to confirm, delete/backspace to retry" .. (config.input and ", escape to cancel" or ""),0,0,1000)
|
||||
else
|
||||
drawText("Press key input for " .. input_names[configurable_inputs[self.input_state]] .. ", tab to skip, escape to cancel",0,0,1000)
|
||||
@@ -70,12 +70,12 @@ function KeyConfigScene:onInputPress(e)
|
||||
if e.type == "key" then
|
||||
-- function keys, escape, and tab are reserved and can't be remapped
|
||||
if e.scancode == "escape" then
|
||||
scene = InputConfigScene()
|
||||
elseif self.input_state > table.getn(configurable_inputs) then
|
||||
SCENE = InputConfigScene()
|
||||
elseif self.input_state > #configurable_inputs then
|
||||
if e.scancode == "return" then
|
||||
config.input.keys = self.new_input
|
||||
saveConfig()
|
||||
scene = config.firstTime and TitleScene() or InputConfigScene()
|
||||
SCENE = config.firstTime and TitleScene() or InputConfigScene()
|
||||
config.firstTime = false
|
||||
elseif e.scancode == "delete" or e.scancode == "backspace" then
|
||||
-- retry
|
||||
|
||||
Reference in New Issue
Block a user