intro场景NOGAME铁门改为启动时弹窗提示重启;不再接受v0.13.2前的设置(自动删除重置)
This commit is contained in:
38
main.lua
38
main.lua
@@ -22,7 +22,6 @@ SAVEDIR=fs.getSaveDirectory()
|
|||||||
--Global Vars & Settings
|
--Global Vars & Settings
|
||||||
LOADED=false
|
LOADED=false
|
||||||
DAILYLAUNCH=false
|
DAILYLAUNCH=false
|
||||||
NOGAME=false
|
|
||||||
LOGIN=false
|
LOGIN=false
|
||||||
EDITING=""
|
EDITING=""
|
||||||
WSCONN=false
|
WSCONN=false
|
||||||
@@ -271,22 +270,7 @@ LANG.set(SETTING.lang)
|
|||||||
--Update data
|
--Update data
|
||||||
do
|
do
|
||||||
local needSave
|
local needSave
|
||||||
--Check setting file
|
local noGame
|
||||||
if
|
|
||||||
type(STAT.version)~="number"or
|
|
||||||
type(SETTING.block)~="boolean"or
|
|
||||||
type(SETTING.sfx_spawn)~="number"or
|
|
||||||
type(SETTING.ghost)~="number"or
|
|
||||||
type(SETTING.center)~="number"or
|
|
||||||
type(SETTING.grid)~="number"or
|
|
||||||
#SETTING.skin<29 or
|
|
||||||
SETTING.bgm>1 or SETTING.sfx>1 or SETTING.voc>1 or
|
|
||||||
SETTING.stereo>1 or SETTING.VKSFX>1 or SETTING.VKAlpha>1 or
|
|
||||||
SETTING.VKCurW>1 or SETTING.VKCurW>1
|
|
||||||
then
|
|
||||||
NOGAME=true
|
|
||||||
fs.remove("conf/settings")
|
|
||||||
end
|
|
||||||
|
|
||||||
if STAT.extraRate then
|
if STAT.extraRate then
|
||||||
STAT.finesseRate=5*(STAT.piece-STAT.extraRate)
|
STAT.finesseRate=5*(STAT.piece-STAT.extraRate)
|
||||||
@@ -301,24 +285,18 @@ do
|
|||||||
RANKS.sprintLock=nil
|
RANKS.sprintLock=nil
|
||||||
needSave=true
|
needSave=true
|
||||||
end
|
end
|
||||||
if STAT.version<1208 then
|
|
||||||
SETTING.skinSet=1
|
|
||||||
needSave=true
|
|
||||||
end
|
|
||||||
|
|
||||||
if STAT.version<1300 then
|
if STAT.version<1300 then
|
||||||
for _,name in next,fs.getDirectoryItems("replay")do
|
for _,name in next,fs.getDirectoryItems("replay")do
|
||||||
fs.remove("replay/"..name)
|
fs.remove("replay/"..name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if STAT.version<1302 then
|
if STAT.version<1302 then
|
||||||
if RANKS.pctrain_n then RANKS.pctrain_n=0 end
|
if RANKS.pctrain_n then RANKS.pctrain_n=0 end
|
||||||
if RANKS.pctrain_l then RANKS.pctrain_l=0 end
|
if RANKS.pctrain_l then RANKS.pctrain_l=0 end
|
||||||
fs.remove("conf/user")
|
fs.remove("conf/user")
|
||||||
NOGAME=true
|
fs.remove("conf/settings")
|
||||||
|
noGame=true
|
||||||
end
|
end
|
||||||
|
|
||||||
if STAT.version<1303 then
|
if STAT.version<1303 then
|
||||||
SETTING.appLock=false
|
SETTING.appLock=false
|
||||||
needSave=true
|
needSave=true
|
||||||
@@ -326,7 +304,7 @@ do
|
|||||||
|
|
||||||
for _,v in next,VK_org do
|
for _,v in next,VK_org do
|
||||||
if not v.color then
|
if not v.color then
|
||||||
NOGAME=true
|
noGame=true
|
||||||
fs.remove("conf/virtualkey")
|
fs.remove("conf/virtualkey")
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -334,7 +312,6 @@ do
|
|||||||
|
|
||||||
if RANKS.infinite then RANKS.infinite=6 end
|
if RANKS.infinite then RANKS.infinite=6 end
|
||||||
if RANKS.infinite_dig then RANKS.infinite_dig=6 end
|
if RANKS.infinite_dig then RANKS.infinite_dig=6 end
|
||||||
|
|
||||||
for k in next,RANKS do
|
for k in next,RANKS do
|
||||||
if type(k)=="number"then
|
if type(k)=="number"then
|
||||||
RANKS[k]=nil
|
RANKS[k]=nil
|
||||||
@@ -370,7 +347,7 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
if keyMap[1]then
|
if keyMap[1]then
|
||||||
NOGAME=true
|
noGame=true
|
||||||
fs.remove("conf/key")
|
fs.remove("conf/key")
|
||||||
end
|
end
|
||||||
USER.username=nil
|
USER.username=nil
|
||||||
@@ -380,4 +357,9 @@ do
|
|||||||
STAT.version=VERSION_CODE
|
STAT.version=VERSION_CODE
|
||||||
FILE.save(STAT,"conf/data","q")
|
FILE.save(STAT,"conf/data","q")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if noGame then
|
||||||
|
love.window.showMessageBox("重启更新 Restart to Update","检测到大版本更新,请重启游戏完成\nOld version detected & saving file changed, please restart the game",{"Get it!"},"info",true)
|
||||||
|
love.event.quit()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@@ -15,17 +15,12 @@ end
|
|||||||
|
|
||||||
function scene.mouseDown(_,_,k)
|
function scene.mouseDown(_,_,k)
|
||||||
if k~=2 then
|
if k~=2 then
|
||||||
if NOGAME then
|
if newVersionLaunch then
|
||||||
LOG.print("检测到大版本更新,请重启游戏完成",600,COLOR.yellow)
|
SCN.push(SETTING.simpMode and"main_simple"or"main")
|
||||||
LOG.print("Old version detected & saving file changed, please restart the game",600,COLOR.yellow)
|
SCN.swapTo("history","fade")
|
||||||
|
LOG.print(text.newVersion,"warn",COLOR.lBlue)
|
||||||
else
|
else
|
||||||
if newVersionLaunch then
|
SCN.go(SETTING.simpMode and"main_simple"or"main")
|
||||||
SCN.push(SETTING.simpMode and"main_simple"or"main")
|
|
||||||
SCN.swapTo("history","fade")
|
|
||||||
LOG.print(text.newVersion,"warn",COLOR.lBlue)
|
|
||||||
else
|
|
||||||
SCN.go(SETTING.simpMode and"main_simple"or"main")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user