优化tas工具的使用体验
暂时禁止录像中途进入tas模式
This commit is contained in:
@@ -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 sin=math.sin
|
||||||
local SCR,VK=SCR,VK
|
local SCR,VK=SCR,VK
|
||||||
local GAME=GAME
|
local GAME=GAME
|
||||||
@@ -108,19 +108,20 @@ local function restart()
|
|||||||
noKey=replaying
|
noKey=replaying
|
||||||
noTouch=replaying
|
noTouch=replaying
|
||||||
end
|
end
|
||||||
local function gameKeyDown(key)
|
local function checkGameKeyDown(key)
|
||||||
local k=keyMap.keyboard[key]
|
local k=keyMap.keyboard[key]
|
||||||
if k then
|
if k then
|
||||||
if k>0 then
|
if k>0 then
|
||||||
if noKey then return end
|
if noKey then return end
|
||||||
PLAYERS[1]:pressKey(k)
|
PLAYERS[1]:pressKey(k)
|
||||||
VK.press(k)
|
VK.press(k)
|
||||||
|
return
|
||||||
elseif not GAME.fromRepMenu then
|
elseif not GAME.fromRepMenu then
|
||||||
restart()
|
restart()
|
||||||
|
return
|
||||||
end
|
end
|
||||||
elseif key=="escape"then
|
|
||||||
pauseGame()
|
|
||||||
end
|
end
|
||||||
|
return true--No key pressed
|
||||||
end
|
end
|
||||||
|
|
||||||
function scene.sceneInit(org)
|
function scene.sceneInit(org)
|
||||||
@@ -210,23 +211,26 @@ function scene.keyDown(key,isRep)
|
|||||||
else
|
else
|
||||||
if isRep then
|
if isRep then
|
||||||
return
|
return
|
||||||
elseif tasMode then
|
elseif checkGameKeyDown(key)then
|
||||||
if key=="f1"then
|
if tasMode then
|
||||||
if not isRep then gameRate=gameRate==0 and .125 or 0 end
|
if key=="f1"then
|
||||||
updateRepButtons()
|
if not isRep then gameRate=gameRate==0 and .125 or 0 end
|
||||||
elseif key=='f2'then
|
updateRepButtons()
|
||||||
if not isRep then
|
elseif key=='f2'then
|
||||||
speedDown()
|
if not isRep then
|
||||||
end
|
speedDown()
|
||||||
elseif key=='f3'then
|
end
|
||||||
if gameRate==0 then
|
elseif key=='f3'then
|
||||||
_step()
|
if gameRate==0 then
|
||||||
elseif not isRep then
|
_step()
|
||||||
speedUp()
|
elseif not isRep then
|
||||||
|
speedUp()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
if key=="escape"then
|
||||||
gameKeyDown(key)
|
pauseGame()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ function scene.keyDown(key,isRep)
|
|||||||
end
|
end
|
||||||
timer2=0
|
timer2=0
|
||||||
elseif key=="t"then
|
elseif key=="t"then
|
||||||
if ALLOWTAS then
|
if ALLOWTAS and not(GAME.result or GAME.replaying)then
|
||||||
GAME.tasUsed=true
|
GAME.tasUsed=true
|
||||||
SFX.play('ren_mega')
|
SFX.play('ren_mega')
|
||||||
SFX.play('clear_3')
|
SFX.play('clear_3')
|
||||||
@@ -220,6 +220,16 @@ function scene.draw()
|
|||||||
gc.pop()
|
gc.pop()
|
||||||
end
|
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
|
--Big info frame
|
||||||
if PLAYERS[1].frameRun>180 then
|
if PLAYERS[1].frameRun>180 then
|
||||||
gc.push('transform')
|
gc.push('transform')
|
||||||
@@ -236,15 +246,6 @@ function scene.draw()
|
|||||||
mStr(("%s:[%d] %.2fs"):format(text.pauseCount,GAME.pauseCount,GAME.pauseTime),305,389)
|
mStr(("%s:[%d] %.2fs"):format(text.pauseCount,GAME.pauseCount,GAME.pauseTime),305,389)
|
||||||
end
|
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
|
--Pages
|
||||||
if page==0 then
|
if page==0 then
|
||||||
--Frame
|
--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="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="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,
|
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