tas功能需要到控制台使用tas命令开启,退出前有效
This commit is contained in:
3
main.lua
3
main.lua
@@ -18,7 +18,7 @@
|
|||||||
--Var leak check
|
--Var leak check
|
||||||
-- setmetatable(_G,{__newindex=function(self,k,v)print('>>'..k)print(debug.traceback():match("\n.-\n\t(.-): "))rawset(self,k,v)end})
|
-- setmetatable(_G,{__newindex=function(self,k,v)print('>>'..k)print(debug.traceback():match("\n.-\n\t(.-): "))rawset(self,k,v)end})
|
||||||
|
|
||||||
--Declaration
|
--System Global Vars Declaration
|
||||||
local fs=love.filesystem
|
local fs=love.filesystem
|
||||||
VERSION=require"version"
|
VERSION=require"version"
|
||||||
TIME=love.timer.getTime
|
TIME=love.timer.getTime
|
||||||
@@ -30,6 +30,7 @@ SAVEDIR=fs.getSaveDirectory()
|
|||||||
--Global Vars & Settings
|
--Global Vars & Settings
|
||||||
FIRSTLAUNCH=false
|
FIRSTLAUNCH=false
|
||||||
DAILYLAUNCH=false
|
DAILYLAUNCH=false
|
||||||
|
ALLOWTAS=false
|
||||||
|
|
||||||
--System setting
|
--System setting
|
||||||
math.randomseed(os.time()*626)
|
math.randomseed(os.time()*626)
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ return{
|
|||||||
resume="Resume (esc)",
|
resume="Resume (esc)",
|
||||||
restart="Retry (R)",
|
restart="Retry (R)",
|
||||||
quit="Quit (Q)",
|
quit="Quit (Q)",
|
||||||
|
tas="TAS (T)",
|
||||||
},
|
},
|
||||||
net_menu={
|
net_menu={
|
||||||
league="Tech League",
|
league="Tech League",
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ return{
|
|||||||
resume="Resumir (esc)",
|
resume="Resumir (esc)",
|
||||||
restart="Reiniciar (R)",
|
restart="Reiniciar (R)",
|
||||||
quit="Finalizar (Q)",
|
quit="Finalizar (Q)",
|
||||||
|
-- tas="TAS (T)",
|
||||||
},
|
},
|
||||||
net_menu={
|
net_menu={
|
||||||
league="Liga Tech",
|
league="Liga Tech",
|
||||||
|
|||||||
@@ -208,6 +208,7 @@ return{
|
|||||||
resume="Continuer (esc)",
|
resume="Continuer (esc)",
|
||||||
restart="Réessayer (R)",
|
restart="Réessayer (R)",
|
||||||
quit="Quitter (Q)",
|
quit="Quitter (Q)",
|
||||||
|
-- tas="TAS (T)",
|
||||||
},
|
},
|
||||||
net_menu={
|
net_menu={
|
||||||
-- league="Tech League",
|
-- league="Tech League",
|
||||||
|
|||||||
@@ -236,6 +236,7 @@ return{
|
|||||||
resume="Resumir (esc)",
|
resume="Resumir (esc)",
|
||||||
restart="Reiniciar (R)",
|
restart="Reiniciar (R)",
|
||||||
quit="Sair (Q)",
|
quit="Sair (Q)",
|
||||||
|
-- tas="TAS (T)",
|
||||||
},
|
},
|
||||||
net_menu={
|
net_menu={
|
||||||
-- league="Tech League",
|
-- league="Tech League",
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ return{
|
|||||||
resume="!! (esc)",
|
resume="!! (esc)",
|
||||||
restart="_→_ (R)",
|
restart="_→_ (R)",
|
||||||
quit="X (Q)",
|
quit="X (Q)",
|
||||||
|
tas="#&; (T)",
|
||||||
},
|
},
|
||||||
setting_game={
|
setting_game={
|
||||||
title="%~~%",
|
title="%~~%",
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ return{
|
|||||||
resume="继续(esc)",
|
resume="继续(esc)",
|
||||||
restart="重新开始(R)",
|
restart="重新开始(R)",
|
||||||
quit="退出(Q)",
|
quit="退出(Q)",
|
||||||
|
tas="TAS (T)",
|
||||||
},
|
},
|
||||||
net_menu={
|
net_menu={
|
||||||
league="Tech League",
|
league="Tech League",
|
||||||
|
|||||||
@@ -731,6 +731,18 @@ local commands={}do
|
|||||||
"Usage: play [mode_name]",
|
"Usage: play [mode_name]",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
commands.tas={
|
||||||
|
code=function()
|
||||||
|
ALLOWTAS=true
|
||||||
|
log{C.lC,"TAS mode on"}
|
||||||
|
end,
|
||||||
|
description="Allow you to use TAS tool",
|
||||||
|
details={
|
||||||
|
"Allow you to use TAS tool, a TAS button will show up at the pause menu",
|
||||||
|
"",
|
||||||
|
"Usage: tas",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
--Network
|
--Network
|
||||||
commands.switchhost={
|
commands.switchhost={
|
||||||
|
|||||||
@@ -224,22 +224,9 @@ function scene.keyDown(key,isRep)
|
|||||||
elseif not isRep then
|
elseif not isRep then
|
||||||
speedUp()
|
speedUp()
|
||||||
end
|
end
|
||||||
elseif key=="t"and kb.isDown('lctrl','rctrl')then
|
|
||||||
tasMode=false
|
|
||||||
floatGameRate,gameRate=0,1
|
|
||||||
updateRepButtons()
|
|
||||||
updateMenuButtons()
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if key=="t"and kb.isDown('lctrl','rctrl')then
|
gameKeyDown(key)
|
||||||
gameRate=0
|
|
||||||
tasMode=true
|
|
||||||
GAME.tasUsed=true
|
|
||||||
updateRepButtons()
|
|
||||||
updateMenuButtons()
|
|
||||||
else
|
|
||||||
gameKeyDown(key)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -161,6 +161,13 @@ function scene.keyDown(key,isRep)
|
|||||||
page=(page+1)%2
|
page=(page+1)%2
|
||||||
end
|
end
|
||||||
timer2=0
|
timer2=0
|
||||||
|
elseif key=="t"then
|
||||||
|
if ALLOWTAS then
|
||||||
|
GAME.tasUsed=true
|
||||||
|
SFX.play('ren_mega')
|
||||||
|
SFX.play('clear_3')
|
||||||
|
SYSFX.newShade(1.2,555,200,620,380,.6,.6,.6)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
WIDGET.keyPressed(key)
|
WIDGET.keyPressed(key)
|
||||||
end
|
end
|
||||||
@@ -350,6 +357,7 @@ scene.widgetList={
|
|||||||
WIDGET.newKey{name="restart", x=290,y=340,w=300,h=70,code=pressKey"r",hideF=function()return GAME.fromRepMenu end},
|
WIDGET.newKey{name="restart", x=290,y=340,w=300,h=70,code=pressKey"r",hideF=function()return GAME.fromRepMenu end},
|
||||||
WIDGET.newKey{name="setting", x=290,y=440,w=300,h=70,code=pressKey"s",hideF=function()return GAME.fromRepMenu end},
|
WIDGET.newKey{name="setting", x=290,y=440,w=300,h=70,code=pressKey"s",hideF=function()return GAME.fromRepMenu end},
|
||||||
WIDGET.newKey{name="quit", x=290,y=540,w=300,h=70,code=backScene},
|
WIDGET.newKey{name="quit", x=290,y=540,w=300,h=70,code=backScene},
|
||||||
|
WIDGET.newKey{name="tas", x=290,y=620,w=240,h=50,code=pressKey"t",hideF=function()return not ALLOWTAS or GAME.tasUsed end},
|
||||||
WIDGET.newKey{name="page_prev", x=500,y=390,w=70,code=pressKey"tab",noFrame=true,
|
WIDGET.newKey{name="page_prev", x=500,y=390,w=70,code=pressKey"tab",noFrame=true,
|
||||||
fText=GC.DO{70,70,{'setLW',2}, {'dRPol',33,35,32,3,6,3.142},{'dRPol',45,35,32,3,6,3.142}},
|
fText=GC.DO{70,70,{'setLW',2}, {'dRPol',33,35,32,3,6,3.142},{'dRPol',45,35,32,3,6,3.142}},
|
||||||
fShade=GC.DO{70,70,{'setCL',1,1,1,.6},{'draw',GC.DO{70,70,{'setCL',1,1,1,1},{'fRPol',33,35,32,3,6,3.142},{'fRPol',45,35,32,3,6,3.142}}}},
|
fShade=GC.DO{70,70,{'setCL',1,1,1,.6},{'draw',GC.DO{70,70,{'setCL',1,1,1,1},{'fRPol',33,35,32,3,6,3.142},{'fRPol',45,35,32,3,6,3.142}}}},
|
||||||
|
|||||||
Reference in New Issue
Block a user