Multiple changes

- Fix softlock in Name entry
- Wrong page count in Replay scene
- Last key can't be ignored by other controllers
- Small B.T.S changes
This commit is contained in:
Nguyễn Quốc Hưng
2024-10-06 16:57:49 +07:00
parent 1f5a21fec4
commit c0089fc4a5
7 changed files with 93 additions and 57 deletions

View File

@@ -20,6 +20,9 @@ MOBILE = CURRENT_OS == "Android" or CURRENT_OS == "iOS"
LILY = require "libs.lily"
---@type table
local sceneStack -- Only use for checking scene stack, not
function love.load()
require 'funcs'
math.randomseed(os.time())
@@ -40,6 +43,7 @@ function love.load()
require "game.vctrl" -- VCTRL
SCENE = LoadingScene()
sceneStack = {SCENE}
VCTRL.new(SETTINGS.input.virtual)
end
@@ -305,11 +309,23 @@ function love.run()
end
end
love.handlers[name](a,b,c,d,e,f)
-- Checking for new scene and add it to the end of scene stack
if SCENE ~= sceneStack[1] then
table.insert(sceneStack, SCENE)
SCENE = sceneStack[1]
end
end
end
if SCENE and SCENE.update and love.timer then
SCENE:update()
-- Checking for new scene and add it to the end of scene stack
if SCENE ~= sceneStack[1] then
table.insert(sceneStack, SCENE)
SCENE = sceneStack[1]
end
local frame_duration = 1.0 / TARGET_FPS
if time_accumulator < frame_duration then
@@ -330,6 +346,12 @@ function love.run()
time_accumulator = time_accumulator - frame_duration
end
last_time = love.timer.getTime()
-- Finally, changing to the latest scene in scene stack
if #sceneStack > 1 then
SCENE = sceneStack[#sceneStack]
sceneStack = {SCENE}
end
end
end
@@ -412,7 +434,7 @@ function love.errorhandler(msg)
love.graphics.setColor(1, 1, 1)
love.graphics.draw(screenshot_canva, 0, 0, 0, screenshot_canva_scale)
if not showScreenshot then
love.graphics.setColor(0, 0, 0, 0.75)
love.graphics.rectangle("fill", 0, 0, 640, 480)