mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
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:
24
main.lua
24
main.lua
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user