mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Update virtual control stuff
This commit is contained in:
@@ -31,7 +31,7 @@ local input_names = {
|
||||
rotate_right='Rotate Clockwise',
|
||||
rotate_right2='Rotate Clockwise (2)'
|
||||
}
|
||||
|
||||
|
||||
|
||||
local function newSetInputs()
|
||||
local set_inputs = {}
|
||||
@@ -73,12 +73,10 @@ function KeyConfigScene:onInputPress(e)
|
||||
scene = InputConfigScene()
|
||||
elseif self.input_state > table.getn(configurable_inputs) then
|
||||
if e.scancode == "return" then
|
||||
-- save new input, then load next scene
|
||||
local had_config = config.input ~= nil
|
||||
if not config.input then config.input = {} end
|
||||
config.input.keys = self.new_input
|
||||
saveConfig()
|
||||
scene = had_config and InputConfigScene() or TitleScene()
|
||||
scene = config.firstTime and TitleScene() or InputConfigScene()
|
||||
config.firstTime = false
|
||||
elseif e.scancode == "delete" or e.scancode == "backspace" then
|
||||
-- retry
|
||||
self.input_state = 1
|
||||
@@ -88,7 +86,7 @@ function KeyConfigScene:onInputPress(e)
|
||||
elseif e.scancode == "tab" then
|
||||
self.set_inputs[configurable_inputs[self.input_state]] = "skipped"
|
||||
self.input_state = self.input_state + 1
|
||||
elseif e.scancode ~= "escape" and not self.new_input[e.scancode] then
|
||||
elseif not self.new_input[e.scancode] then
|
||||
-- all other keys can be configured
|
||||
self.set_inputs[configurable_inputs[self.input_state]] = "key " .. love.keyboard.getKeyFromScancode(e.scancode) .. " (" .. e.scancode .. ")"
|
||||
self.new_input[e.scancode] = configurable_inputs[self.input_state]
|
||||
|
||||
Reference in New Issue
Block a user