mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Fix bugs related to the first time launching game
This commit is contained in:
@@ -14,10 +14,15 @@ local snapUnit = 1
|
||||
local hasChanged
|
||||
|
||||
---@type function
|
||||
local exitSceneFunc = function()
|
||||
local function exitSceneFunc(saved)
|
||||
VCTRL.release()
|
||||
BUTTON.release(buttonList)
|
||||
SCENE = TitleScene()
|
||||
if SETTINGS.firstTime and not saved then
|
||||
SCENE = InputConfigScene(true)
|
||||
else
|
||||
SCENE = TitleScene()
|
||||
SETTINGS.firstTime = false
|
||||
end
|
||||
end
|
||||
|
||||
buttonList = {
|
||||
@@ -51,7 +56,7 @@ buttonList = {
|
||||
text = "MENU",
|
||||
x = 570, y = 5, w = 60, h = 25,
|
||||
codeWhenReleased = function()
|
||||
if hasChanged then
|
||||
if hasChanged or SETTINGS.firstTime then
|
||||
local selection = love.window.showMessageBox(
|
||||
"Save config?", "Do you want to save your changes before exiting?",
|
||||
{"Save", "Discard", "Keep editing", escapebutton = 2, enterbutton = 1},
|
||||
@@ -59,10 +64,9 @@ buttonList = {
|
||||
)
|
||||
if selection == 1 then
|
||||
SETTINGS.input.virtual = VCTRL.exportAll()
|
||||
SETTINGS.firstTime = false
|
||||
-- love.window.showMessageBox("Saved!", "Your changes was saved!")
|
||||
|
||||
exitSceneFunc()
|
||||
exitSceneFunc(true)
|
||||
elseif selection == 2 then
|
||||
VCTRL.clearAll()
|
||||
VCTRL.new(SETTINGS.input.virtual)
|
||||
@@ -141,12 +145,12 @@ local function sliderList_update()
|
||||
end
|
||||
end
|
||||
|
||||
function TouchConfigScene:new()
|
||||
function TouchConfigScene:new(fromPreviewScene)
|
||||
VCTRL.toggle(true)
|
||||
|
||||
VCTRL.focus = nil
|
||||
focusingButton = nil
|
||||
hasChanged = false
|
||||
hasChanged = fromPreviewScene
|
||||
Grid:new(10, 20)
|
||||
-- TODO
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user