mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
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:
@@ -12,7 +12,6 @@ local GameMode = Object:extend()
|
|||||||
|
|
||||||
function GameMode:new(player_name, input_file, replay_grade)
|
function GameMode:new(player_name, input_file, replay_grade)
|
||||||
VCTRL.toggle(MOBILE and not input_file and not SETTINGS.tvMode)
|
VCTRL.toggle(MOBILE and not input_file and not SETTINGS.tvMode)
|
||||||
if MOBILE and not SETTINGS.tvMode then love.keyboard.setTextInput(false) end
|
|
||||||
VCTRL.reset()
|
VCTRL.reset()
|
||||||
|
|
||||||
if player_name == nil then self.training = true else self.training = false end
|
if player_name == nil then self.training = true else self.training = false end
|
||||||
|
|||||||
@@ -170,14 +170,12 @@ function NameEntryScene:onInputPress(e)
|
|||||||
BUTTON.release(buttonList, e.x, e.y, e.id)
|
BUTTON.release(buttonList, e.x, e.y, e.id)
|
||||||
SETTINGS['last_entry'] = name:upper()
|
SETTINGS['last_entry'] = name:upper()
|
||||||
SCENE = GameScene(name:lower())
|
SCENE = GameScene(name:lower())
|
||||||
else
|
elseif self.entry_pos == 3 then self:getPlayInfo(name)
|
||||||
if self.entry_pos == 3 then self:getPlayInfo(name)
|
|
||||||
else
|
else
|
||||||
self.name_entry[self.entry_pos ] = self.chars:sub(self.char_pos, self.char_pos)
|
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)
|
self.name_entry[self.entry_pos+1] = self.chars:sub(self.char_pos, self.char_pos)
|
||||||
end
|
end
|
||||||
self.entry_pos = self.entry_pos + 1
|
self.entry_pos = self.entry_pos + 1
|
||||||
end
|
|
||||||
elseif e.input == "left" or e.scancode == "left" then
|
elseif e.input == "left" or e.scancode == "left" then
|
||||||
self.direction = "left"
|
self.direction = "left"
|
||||||
elseif e.input == "right" or e.scancode == "right" then
|
elseif e.input == "right" or e.scancode == "right" then
|
||||||
@@ -199,6 +197,10 @@ end
|
|||||||
function NameEntryScene:onInputRelease(e)
|
function NameEntryScene:onInputRelease(e)
|
||||||
if e.type == "mouse" or e.type == "touch" then
|
if e.type == "mouse" or e.type == "touch" then
|
||||||
BUTTON.release(buttonList, e.x, e.y, e.id)
|
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
|
elseif e.input == "left" or e.scancode == "left" or e.input == "right" or e.scancode == "right" then
|
||||||
self.direction = nil
|
self.direction = nil
|
||||||
self.repeat_counter = self.repeat_limit-1
|
self.repeat_counter = self.repeat_limit-1
|
||||||
|
|||||||
@@ -8,7 +8,11 @@ local buttonList = {
|
|||||||
x = 325, y = 385, w = 100, h = 30,
|
x = 325, y = 385, w = 100, h = 30,
|
||||||
text = CHAR.key.up.." Page up",
|
text = CHAR.key.up.." Page up",
|
||||||
codeWhenReleased = function()
|
codeWhenReleased = function()
|
||||||
scene_self.page = math.max(scene_self.page - 1, 0)
|
if scene_self.page == 1 then
|
||||||
|
scene_self.page = 1 + math.floor(#scene_self.replays / scene_self.page_flip)
|
||||||
|
else
|
||||||
|
scene_self.page = scene_self.page - 1
|
||||||
|
end
|
||||||
scene_self.replay_select = 1;
|
scene_self.replay_select = 1;
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
@@ -16,7 +20,11 @@ local buttonList = {
|
|||||||
x = 435, y = 385, w = 100, h = 30,
|
x = 435, y = 385, w = 100, h = 30,
|
||||||
text = CHAR.key.down.." Page down",
|
text = CHAR.key.down.." Page down",
|
||||||
codeWhenReleased = function()
|
codeWhenReleased = function()
|
||||||
scene_self.page = math.max(scene_self.page - 1, 1+(math.floor(#scene_self.replays / scene_self.page_flip)))
|
if scene_self.page < 1 + math.floor(#scene_self.replays / scene_self.page_flip) then
|
||||||
|
scene_self.page = scene_self.page + 1
|
||||||
|
else
|
||||||
|
scene_self.page = 1
|
||||||
|
end
|
||||||
scene_self.replay_select = 1;
|
scene_self.replay_select = 1;
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ end
|
|||||||
function TrainingScene:onInputPress(e)
|
function TrainingScene:onInputPress(e)
|
||||||
if e.type == "mouse" or (e.type == "touch" and not VCTRL.press(e.x, e.y, e.id)) then
|
if e.type == "mouse" or (e.type == "touch" and not VCTRL.press(e.x, e.y, e.id)) then
|
||||||
menuKey:press(e.x, e.y, e.id)
|
menuKey:press(e.x, e.y, e.id)
|
||||||
elseif (self.game.game_over or self.game.completed) and (e.input == "menu_decide" or e.input == "menu_back" or e.input == "rotate_right") and self.game.game_over_frames > 50 then
|
elseif (self.game.game_over or self.game.completed) and (e.input == "menu_back" or e.input == "rotate_right") and self.game.game_over_frames > 50 then
|
||||||
SCENE = TitleScene()
|
SCENE = TitleScene()
|
||||||
elseif (e.input == "menu_back") then
|
elseif (e.input == "menu_back") then
|
||||||
SCENE = TitleScene()
|
SCENE = TitleScene()
|
||||||
|
|||||||
Reference in New Issue
Block a user