Fix various bugs

- Sometimes keyboard suddenly closed while a key is being pressed on mobile (TEST)
- Fix navigation issue in replay scene
- Fix Confirm key is not usable as Restart in 20G Training
This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-06-14 15:20:36 +07:00
parent a5b72ef286
commit 52f0e5323f
4 changed files with 17 additions and 8 deletions

View File

@@ -170,14 +170,12 @@ function NameEntryScene:onInputPress(e)
BUTTON.release(buttonList, e.x, e.y, e.id)
SETTINGS['last_entry'] = name:upper()
SCENE = GameScene(name:lower())
else
if self.entry_pos == 3 then self:getPlayInfo(name)
elseif self.entry_pos == 3 then self:getPlayInfo(name)
else
self.name_entry[self.entry_pos ] = self.chars:sub(self.char_pos, self.char_pos)
self.name_entry[self.entry_pos+1] = self.chars:sub(self.char_pos, self.char_pos)
end
self.entry_pos = self.entry_pos + 1
end
self.entry_pos = self.entry_pos + 1
elseif e.input == "left" or e.scancode == "left" then
self.direction = "left"
elseif e.input == "right" or e.scancode == "right" then
@@ -199,6 +197,10 @@ end
function NameEntryScene:onInputRelease(e)
if e.type == "mouse" or e.type == "touch" then
BUTTON.release(buttonList, e.x, e.y, e.id)
elseif (
MOBILE and not SETTINGS.tvMode and
self.entry_pos == 4
) then love.keyboard.setTextInput(false)
elseif e.input == "left" or e.scancode == "left" or e.input == "right" or e.scancode == "right" then
self.direction = nil
self.repeat_counter = self.repeat_limit-1