VERSION改为全局table并包含版本名称

This commit is contained in:
MrZ626
2021-04-10 16:56:27 +08:00
parent b757055525
commit 54697c44de
11 changed files with 19 additions and 16 deletions

View File

@@ -390,7 +390,7 @@ function love.errorhandler(msg)
--Write messages to log file --Write messages to log file
love.filesystem.append("conf/error.log", love.filesystem.append("conf/error.log",
os.date("%Y/%m/%d %A %H:%M:%S\n").. os.date("%Y/%m/%d %A %H:%M:%S\n")..
#ERRDATA.." crash(es) "..SYSTEM.."-"..VERSION_NAME.." scene: "..scn.."\n".. #ERRDATA.." crash(es) "..SYSTEM.."-"..VERSION.string.." scene: "..scn.."\n"..
table.concat(err,"\n",1,c-2).."\n\n" table.concat(err,"\n",1,c-2).."\n\n"
) )
@@ -432,7 +432,7 @@ function love.errorhandler(msg)
setFont(100)gc_print(":(",100,0,0,1.2) setFont(100)gc_print(":(",100,0,0,1.2)
setFont(40)gc.printf(errorMsg,100,160,SCR.w0-100) setFont(40)gc.printf(errorMsg,100,160,SCR.w0-100)
setFont(20) setFont(20)
gc_print(SYSTEM.."-"..VERSION_NAME.." scene:"..(SCN and SCN.cur or"NULL"),100,660) gc_print(SYSTEM.."-"..VERSION.string.." scene:"..(SCN and SCN.cur or"NULL"),100,660)
gc.printf(err[1],100,360,1260-100) gc.printf(err[1],100,360,1260-100)
gc_print("TRACEBACK",100,450) gc_print("TRACEBACK",100,450)
for i=4,#err-2 do for i=4,#err-2 do

View File

@@ -4,7 +4,7 @@ local ins,rem=table.insert,table.remove
local debugMesList={} local debugMesList={}
local debugMesHistory={ local debugMesHistory={
"Version: "..VERSION_NAME, "Version: "..VERSION.string,
os.date("Launched at %Y/%m/%d %H:%M"), os.date("Launched at %Y/%m/%d %H:%M"),
} }
local LOG={} local LOG={}

View File

@@ -1,5 +1,8 @@
VERSION_CODE=1401 VERSION={
VERSION_NAME="Alpha V0.14.1 黎明 Dawn" code=1401,
string="Alpha V0.14.1",
name="黎明 Dawn",
}
function love.conf(t) function love.conf(t)
t.identity="Techmino"--Saving folder t.identity="Techmino"--Saving folder
t.version="11.1" t.version="11.1"
@@ -12,7 +15,7 @@ function love.conf(t)
end end
local W=t.window local W=t.window
W.title="Techmino "..VERSION_NAME W.title="Techmino "..VERSION.string
W.icon="media/image/icon.png" W.icon="media/image/icon.png"
W.width,W.height=1280,720 W.width,W.height=1280,720
W.minwidth,W.minheight=640,360 W.minwidth,W.minheight=640,360

View File

@@ -327,9 +327,9 @@ do
end end
USER.username=nil USER.username=nil
if STAT.version~=VERSION_CODE then if STAT.version~=VERSION.code then
newVersionLaunch=true newVersionLaunch=true
STAT.version=VERSION_CODE STAT.version=VERSION.code
FILE.save(STAT,"conf/data","q") FILE.save(STAT,"conf/data","q")
end end

View File

@@ -956,7 +956,7 @@ do--function saveRecording()
local fileHead= local fileHead=
os.date("%Y/%m/%d %A %H:%M:%S\n").. os.date("%Y/%m/%d %A %H:%M:%S\n")..
GAME.curModeName.."\n".. GAME.curModeName.."\n"..
VERSION_NAME.."\n".. VERSION.string.."\n"..
(USER.username or"Player") (USER.username or"Player")
local fileBody= local fileBody=
GAME.seed.."\n".. GAME.seed.."\n"..

View File

@@ -305,7 +305,7 @@ if S then--Statistics
STAT=S STAT=S
else else
STAT={ STAT={
version=VERSION_CODE, version=VERSION.code,
run=0,game=0,time=0,frame=0, run=0,game=0,time=0,frame=0,
key=0,rotate=0,hold=0, key=0,rotate=0,hold=0,
extraPiece=0,finesseRate=0, extraPiece=0,finesseRate=0,

View File

@@ -247,8 +247,8 @@ function NET.updateWS_app()
local res=_parse(message) local res=_parse(message)
if res then if res then
NET.connected=true NET.connected=true
NET.allow_online=VERSION_CODE>=res.lowest NET.allow_online=VERSION.code>=res.lowest
if VERSION_CODE<res.newestCode then if VERSION.code<res.newestCode then
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,COLOR.sky) LOG.print(text.oldVersion:gsub("$1",res.newestName),180,COLOR.sky)
end end
LOG.print(res.notice,300,COLOR.sky) LOG.print(res.notice,300,COLOR.sky)

View File

@@ -537,7 +537,7 @@ local function log_user(str)
log(noLog and"CHEATER."or tostring(str)) log(noLog and"CHEATER."or tostring(str))
end end
local userG={ local userG={
_VERSION=VERSION_CODE, _VERSION=VERSION.code,
assert=assert,error=error, assert=assert,error=error,
tonumber=tonumber,tostring=tostring, tonumber=tonumber,tostring=tostring,
select=select,next=next, select=select,next=next,

View File

@@ -9,7 +9,7 @@ local scene={}
function scene.sceneInit() function scene.sceneInit()
BGcolor=rnd()>.026 and{.3,.5,.9}or{.62,.3,.926} BGcolor=rnd()>.026 and{.3,.5,.9}or{.62,.3,.926}
stateInfo=SYSTEM.."-"..VERSION_NAME.." scene:"..ERRDATA[#ERRDATA].scene stateInfo=SYSTEM.."-"..VERSION.string.." scene:"..ERRDATA[#ERRDATA].scene
errorText=LOADED and text.errorMsg or"An error has occurred during loading.\nError info has been created, and you can send it to the author." errorText=LOADED and text.errorMsg or"An error has occurred during loading.\nError info has been created, and you can send it to the author."
errorShot,errorInfo=ERRDATA[#ERRDATA].shot,ERRDATA[#ERRDATA].mes errorShot,errorInfo=ERRDATA[#ERRDATA].shot,ERRDATA[#ERRDATA].mes
if SETTING then SFX.fplay("error",SETTING.voc*.8 or 0)end if SETTING then SFX.fplay("error",SETTING.voc*.8 or 0)end

View File

@@ -2,7 +2,7 @@ local gc=love.graphics
local scene={} local scene={}
local verName=SYSTEM.." "..VERSION_NAME local verName=("%s %s %s"):format(SYSTEM,VERSION.string,VERSION.name)
local tipLength=760 local tipLength=760
local tip=gc.newText(getFont(30),"") local tip=gc.newText(getFont(30),"")
local scrollX--Tip scroll position local scrollX--Tip scroll position

View File

@@ -17,7 +17,7 @@ end
scene.widgetList={ scene.widgetList={
WIDGET.newText{name="system", x=750,y=280,fText=SYSTEM,color="white",font=30,align="L"}, WIDGET.newText{name="system", x=750,y=280,fText=SYSTEM,color="white",font=30,align="L"},
WIDGET.newText{name="version", x=950,y=280,fText=VERSION_NAME,color="white",font=30,align="L"}, WIDGET.newText{name="version", x=950,y=280,fText=VERSION.string,color="white",font=30,align="L"},
WIDGET.newButton{name="sprint", x=260,y=480,w=260,font=50,code=function()loadGame("sprint_40l",true)end}, WIDGET.newButton{name="sprint", x=260,y=480,w=260,font=50,code=function()loadGame("sprint_40l",true)end},
WIDGET.newButton{name="marathon",x=640,y=480,w=260,font=50,code=function()loadGame("marathon_n",true)end}, WIDGET.newButton{name="marathon",x=640,y=480,w=260,font=50,code=function()loadGame("marathon_n",true)end},
WIDGET.newButton{name="setting",x=1000,y=400,w=120,fText="...",font=50,code=goScene"setting_game"}, WIDGET.newButton{name="setting",x=1000,y=400,w=120,fText="...",font=50,code=goScene"setting_game"},