几个全局变量名大写

This commit is contained in:
MrZ626
2020-11-09 23:23:47 +08:00
parent 2989067a55
commit 7b49053e6d
13 changed files with 32 additions and 32 deletions

View File

@@ -431,7 +431,7 @@ function love.errorhandler(msg)
setFont(120)gc.print(":(",100,40)
setFont(38)gc.printf(text.errorMsg,100,200,SCR.w0-100)
setFont(20)
gc.print(SYSTEM.."-"..gameVersion,100,660)
gc.print(SYSTEM.."-"..VERSION,100,660)
gc.print("scene:"..SCN.cur,400,660)
gc.printf(err[1],626,360,1260-626)
gc.print("TRACEBACK",626,426)

View File

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

View File

@@ -673,9 +673,9 @@ WIDGET.sel=nil--Selected widget
WIDGET.lnk={
BACK=function()SCN.back()end,
CUSval=function(k) return function() return customEnv[k] end end,
CUSrev=function(k) return function() customEnv[k]=not customEnv[k] end end,
CUSsto=function(k) return function(i) customEnv[k]=i end end,
CUSval=function(k) return function() return CUSTOMENV[k] end end,
CUSrev=function(k) return function() CUSTOMENV[k]=not CUSTOMENV[k] end end,
CUSsto=function(k) return function(i) CUSTOMENV[k]=i end end,
SETval=function(k) return function() return SETTING[k] end end,
SETrev=function(k) return function() SETTING[k]=not SETTING[k] end end,

View File

@@ -9,7 +9,7 @@ function love.conf(t)
if t.audio then t.audio.mixwithsystem=true end
local W=t.window
W.title="Techmino "..gameVersion
W.title="Techmino "..VERSION
W.icon="/image/icon.png"
W.width,W.height=1280,720
W.minwidth,W.minheight=640,360

View File

@@ -39,7 +39,7 @@ SCR={
dpi=1--DPI from gc.getDPIScale()
}
customEnv={
CUSTOMENV={
--Basic
drop=60,
lock=60,
@@ -217,8 +217,8 @@ do
if S.extraRate then
S.finesseRate=5*(S.piece-S.extraRate)
end
if S.version~=gameVersion then
S.version=gameVersion
if S.version~=VERSION then
S.version=VERSION
newVersionLaunch=true
--Try unlock modes which should be unlocked

View File

@@ -49,7 +49,7 @@ return{
color=COLOR.white,
env={},
load=function()
for k,v in next,customEnv do
for k,v in next,CUSTOMENV do
modeEnv[k]=v
end
if BAG[1]then
@@ -83,8 +83,8 @@ return{
for _,P in next,PLAYERS.alive do
setField(P,1)
end
modeEnv.bg=customEnv.bg
modeEnv.bgm=customEnv.bgm
modeEnv.bg=CUSTOMENV.bg
modeEnv.bgm=CUSTOMENV.bgm
end,
mesDisp=function(P)
setFont(55)

View File

@@ -38,7 +38,7 @@ return{
dropPiece=puzzleCheck,
},
load=function()
for k,v in next,customEnv do
for k,v in next,CUSTOMENV do
modeEnv[k]=v
end
if BAG[1]then
@@ -61,8 +61,8 @@ return{
PLY.newAIPlayer(2,965,360,.5,AIBUILDER("CC",2*L-11,int(L*.5-1.5),modeEnv.hold,4000*L))
end
end
modeEnv.bg=customEnv.bg
modeEnv.bgm=customEnv.bgm
modeEnv.bg=CUSTOMENV.bg
modeEnv.bgm=CUSTOMENV.bgm
end,
mesDisp=function(P)
local dx,dy=P.fieldOff.x,P.fieldOff.y

View File

@@ -59,7 +59,7 @@ SETTING={
}
STAT={
version=gameVersion,
version=VERSION,
run=0,game=0,time=0,
key=0,rotate=0,hold=0,
extraPiece=0,finesseRate=0,

View File

@@ -62,7 +62,7 @@ function restoreVirtualKey()
end
function copyQuestArgs()
local ENV=customEnv
local ENV=CUSTOMENV
local str=""..
(ENV.hold and"H"or"Z")..
(ENV.ospin and"O"or"Z")..
@@ -71,7 +71,7 @@ function copyQuestArgs()
return str
end
function pasteQuestArgs(str)
local ENV=customEnv
local ENV=CUSTOMENV
ENV.hold= byte(str,1)~=90
ENV.ospin= byte(str,2)~=90
ENV.missionKill= byte(str,3)~=90

View File

@@ -11,11 +11,11 @@ local function notAir(L)
end
end
local customEnv=customEnv
local CUSTOMENV=CUSTOMENV
function sceneInit.customGame()
destroyPlayers()
BG.set(customEnv.bg)
BGM.play(customEnv.bgm)
BG.set(CUSTOMENV.bg)
BGM.play(CUSTOMENV.bgm)
sceneInit={initField=false}
for y=1,20 do
if notAir(FIELD[1][y])then
@@ -29,14 +29,14 @@ end
function keyDown.customGame(key)
if key=="return"or key=="return2"then
if customEnv.opponent>0 then
if customEnv.opponent>5 and customEnv.sequence=="fixed"then
if CUSTOMENV.opponent>0 then
if CUSTOMENV.opponent>5 and CUSTOMENV.sequence=="fixed"then
LOG.print(text.ai_fixed,"warn")
return
elseif customEnv.opponent>0 and #BAG>0 then
elseif CUSTOMENV.opponent>0 and #BAG>0 then
LOG.print(text.ai_prebag,"warn")
return
elseif customEnv.opponent>0 and #MISSION>0 then
elseif CUSTOMENV.opponent>0 and #MISSION>0 then
LOG.print(text.ai_mission,"warn")
return
end
@@ -141,11 +141,11 @@ function Pnt.customGame()
end
setFont(30)
gc.setColor(1,1,1)
gc.print(customEnv.sequence,330,510)
gc.print(CUSTOMENV.sequence,330,510)
--Sequence
if #MISSION>0 then
gc.setColor(1,customEnv.missionKill and 0 or 1,int(Timer()*6.26)%2)
gc.setColor(1,CUSTOMENV.missionKill and 0 or 1,int(Timer()*6.26)%2)
gc.print("#",610,545)
gc.print(#MISSION,640,545)
end
@@ -168,9 +168,9 @@ WIDGET.init("customGame",{
x=1070, y=150,w=250,color="yellow",
list={"none","grey","glow","rgb","flink","wing","fan","badapple","welcome","aura","bg1","bg2","rainbow","rainbow2","lightning","lightning2","matrix","space"},
disp=WIDGET.lnk.CUSval("bg"),
code=function(i)customEnv.bg=i BG.set(i)end
code=function(i)CUSTOMENV.bg=i BG.set(i)end
}),
WIDGET.newSelector({name="bgm", x=1070, y=230,w=250,color="yellow", list=BGM.list, disp=WIDGET.lnk.CUSval("bgm"), code=function(i)customEnv.bgm=i BGM.play(i)end}),
WIDGET.newSelector({name="bgm", x=1070, y=230,w=250,color="yellow", list=BGM.list, disp=WIDGET.lnk.CUSval("bgm"), code=function(i)CUSTOMENV.bgm=i BGM.play(i)end}),
--Copy/Paste/Start
WIDGET.newButton({name="copy", x=1070, y=310,w=310,h=70,color="lRed", font=25,code=WIDGET.lnk.pressKey("cC")}),

View File

@@ -15,7 +15,7 @@ WIDGET.init("custom_advance",{
--Control
WIDGET.newSlider({name="next", x=130, y=410,w=200,unit=6, disp=WIDGET.lnk.CUSval("next"), code=WIDGET.lnk.CUSsto("next")}),
WIDGET.newSwitch({name="hold", x=260, y=480, disp=WIDGET.lnk.CUSval("hold"), code=WIDGET.lnk.CUSrev("hold")}),
WIDGET.newSwitch({name="oncehold", x=260, y=560, disp=WIDGET.lnk.CUSval("oncehold"),code=WIDGET.lnk.CUSrev("oncehold"),hide=function()return not customEnv.hold end}),
WIDGET.newSwitch({name="oncehold", x=260, y=560, disp=WIDGET.lnk.CUSval("oncehold"),code=WIDGET.lnk.CUSrev("oncehold"),hide=function()return not CUSTOMENV.hold end}),
WIDGET.newSlider({name="mindas", x=180, y=150,w=400,unit=15,font=25, disp=WIDGET.lnk.CUSval("mindas"), code=WIDGET.lnk.CUSsto("mindas")}),
WIDGET.newSlider({name="minarr", x=180, y=220,w=400,unit=10,font=25, disp=WIDGET.lnk.CUSval("minarr"), code=WIDGET.lnk.CUSsto("minarr")}),

View File

@@ -24,7 +24,7 @@ function Pnt.main()
gc.draw(IMG.title_color,60,30,nil,1.3)
setFont(30)
gc.print(SYSTEM,610,50)
gc.print(gameVersion,610,90)
gc.print(VERSION,610,90)
gc.print(sceneTemp.tip,50,660)
local L=text.modes[STAT.lastPlay]
setFont(25)

View File

@@ -81,7 +81,7 @@ function Tick.httpREQ_launch(data)
err,res=json.decode(res.body)
if res then
LOG.print(res.notice,360,COLOR.sky)
if gameVersion==res.version then
if VERSION==res.version then
LOG.print(text.versionIsNew,360,COLOR.sky)
else
LOG.print(string.gsub(text.versionIsOld,"$1",res.version),"warn")