优化tas工具的使用体验

暂时禁止录像中途进入tas模式
This commit is contained in:
MrZ626
2021-08-17 01:45:43 +08:00
parent 23e3dc465d
commit 2654c8a614
2 changed files with 35 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
local gc,kb,tc=love.graphics,love.keyboard,love.touch
local gc,tc=love.graphics,love.touch
local sin=math.sin
local SCR,VK=SCR,VK
local GAME=GAME
@@ -108,19 +108,20 @@ local function restart()
noKey=replaying
noTouch=replaying
end
local function gameKeyDown(key)
local function checkGameKeyDown(key)
local k=keyMap.keyboard[key]
if k then
if k>0 then
if noKey then return end
PLAYERS[1]:pressKey(k)
VK.press(k)
return
elseif not GAME.fromRepMenu then
restart()
return
end
elseif key=="escape"then
pauseGame()
end
return true--No key pressed
end
function scene.sceneInit(org)
@@ -210,23 +211,26 @@ function scene.keyDown(key,isRep)
else
if isRep then
return
elseif tasMode then
if key=="f1"then
if not isRep then gameRate=gameRate==0 and .125 or 0 end
updateRepButtons()
elseif key=='f2'then
if not isRep then
speedDown()
end
elseif key=='f3'then
if gameRate==0 then
_step()
elseif not isRep then
speedUp()
elseif checkGameKeyDown(key)then
if tasMode then
if key=="f1"then
if not isRep then gameRate=gameRate==0 and .125 or 0 end
updateRepButtons()
elseif key=='f2'then
if not isRep then
speedDown()
end
elseif key=='f3'then
if gameRate==0 then
_step()
elseif not isRep then
speedUp()
end
end
end
else
gameKeyDown(key)
if key=="escape"then
pauseGame()
end
end
end
end

View File

@@ -162,7 +162,7 @@ function scene.keyDown(key,isRep)
end
timer2=0
elseif key=="t"then
if ALLOWTAS then
if ALLOWTAS and not(GAME.result or GAME.replaying)then
GAME.tasUsed=true
SFX.play('ren_mega')
SFX.play('clear_3')
@@ -220,6 +220,16 @@ function scene.draw()
gc.pop()
end
if GAME.tasUsed then
gc.push('transform')
gc.translate(560,205)
gc.scale(2.6)
setFont(100)
gc.setColor(.97,.97,.97,T*.08)
gc.print("TAS",50,-23,.3)
gc.pop()
end
--Big info frame
if PLAYERS[1].frameRun>180 then
gc.push('transform')
@@ -236,15 +246,6 @@ function scene.draw()
mStr(("%s:[%d] %.2fs"):format(text.pauseCount,GAME.pauseCount,GAME.pauseTime),305,389)
end
if GAME.tasUsed then
gc.push('transform')
gc.scale(2.6)
setFont(100)
gc.setColor(.97,.97,.97,T*.08)
gc.print("TAS",50,-23,.3)
gc.pop()
end
--Pages
if page==0 then
--Frame
@@ -357,7 +358,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="tas", x=290,y=620,w=240,h=50,code=pressKey"t",hideF=function()return not ALLOWTAS or GAME.tasUsed or GAME.result or GAME.replaying 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}}}},