调整把按键添加到录像的时机

修复触发了自动保存的最后一个按键本身不会保存到录像里
This commit is contained in:
MrZ626
2021-12-08 08:40:24 +08:00
parent 41e7b8e0f4
commit f13c9792af

View File

@@ -494,6 +494,15 @@ local playerActions={
Player.act_zangiLeft, --19
Player.act_zangiRight,--20
}function Player:pressKey(keyID)
if self.id==1 then
if GAME.recording then
local L=GAME.rep
ins(L,self.frameRun)
ins(L,keyID)
elseif self.streamProgress then
VK.press(keyID)
end
end
if self.keyAvailable[keyID]and self.alive then
if self.waiting>self.gameEnv.hurry then
self.waiting=self.gameEnv.hurry
@@ -505,18 +514,8 @@ local playerActions={
playerActions[keyID](self)
self.stat.key=self.stat.key+1
end
if self.id==1 then
if GAME.recording then
local L=GAME.rep
ins(L,self.frameRun)
ins(L,keyID)
elseif self.streamProgress then
VK.press(keyID)
end
end
end
function Player:releaseKey(keyID)
self.keyPressing[keyID]=false
if self.id==1 then
if GAME.recording then
local L=GAME.rep
@@ -526,6 +525,7 @@ function Player:releaseKey(keyID)
VK.release(keyID)
end
end
self.keyPressing[keyID]=false
end
function Player:newTask(code,...)
local thread=coroutine.create(code)