tas功能需要到控制台使用tas命令开启,退出前有效

This commit is contained in:
MrZ626
2021-08-16 23:38:17 +08:00
parent 132cb89b90
commit 23e3dc465d
10 changed files with 29 additions and 15 deletions

View File

@@ -18,7 +18,7 @@
--Var leak check
-- 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
VERSION=require"version"
TIME=love.timer.getTime
@@ -30,6 +30,7 @@ SAVEDIR=fs.getSaveDirectory()
--Global Vars & Settings
FIRSTLAUNCH=false
DAILYLAUNCH=false
ALLOWTAS=false
--System setting
math.randomseed(os.time()*626)

View File

@@ -246,6 +246,7 @@ return{
resume="Resume (esc)",
restart="Retry (R)",
quit="Quit (Q)",
tas="TAS (T)",
},
net_menu={
league="Tech League",

View File

@@ -212,6 +212,7 @@ return{
resume="Resumir (esc)",
restart="Reiniciar (R)",
quit="Finalizar (Q)",
-- tas="TAS (T)",
},
net_menu={
league="Liga Tech",

View File

@@ -208,6 +208,7 @@ return{
resume="Continuer (esc)",
restart="Réessayer (R)",
quit="Quitter (Q)",
-- tas="TAS (T)",
},
net_menu={
-- league="Tech League",

View File

@@ -236,6 +236,7 @@ return{
resume="Resumir (esc)",
restart="Reiniciar (R)",
quit="Sair (Q)",
-- tas="TAS (T)",
},
net_menu={
-- league="Tech League",

View File

@@ -127,6 +127,7 @@ return{
resume="!! (esc)",
restart="_→_ (R)",
quit="X (Q)",
tas="#&; (T)",
},
setting_game={
title="%~~%",

View File

@@ -246,6 +246,7 @@ return{
resume="继续(esc)",
restart="重新开始(R)",
quit="退出(Q)",
tas="TAS (T)",
},
net_menu={
league="Tech League",

View File

@@ -731,6 +731,18 @@ local commands={}do
"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
commands.switchhost={

View File

@@ -224,22 +224,9 @@ function scene.keyDown(key,isRep)
elseif not isRep then
speedUp()
end
elseif key=="t"and kb.isDown('lctrl','rctrl')then
tasMode=false
floatGameRate,gameRate=0,1
updateRepButtons()
updateMenuButtons()
end
else
if key=="t"and kb.isDown('lctrl','rctrl')then
gameRate=0
tasMode=true
GAME.tasUsed=true
updateRepButtons()
updateMenuButtons()
else
gameKeyDown(key)
end
gameKeyDown(key)
end
end
end

View File

@@ -161,6 +161,13 @@ function scene.keyDown(key,isRep)
page=(page+1)%2
end
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
WIDGET.keyPressed(key)
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="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="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,
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}}}},