make lua's new tastudio.setplayback re-enable the record flag if it was set (the existing logic leaves it disabled I think as security against the GUI use case where users might stomp their video seeking while playing in record mode). future work: add lua control for the record mode flag

This commit is contained in:
zeromus 2017-02-05 04:20:07 -06:00
parent 539cdc29f3
commit d87a2b27a2
3 changed files with 14 additions and 4 deletions

View File

@ -174,7 +174,7 @@ namespace BizHawk.Client.EmuHawk
}
if (f < Tastudio.CurrentTasMovie.InputLogLength && f>=0)
{
Tastudio.GoToFrame(f);
Tastudio.GoToFrame(f,true);
}
}
}

View File

@ -30,7 +30,7 @@ namespace BizHawk.Client.EmuHawk
}
// SuuperW: I changed this to public so that it could be used by MarkerControl.cs
public void GoToFrame(int frame)
public void GoToFrame(int frame, bool fromLua = false)
{
// If seeking to a frame before or at the end of the movie, use StartAtNearestFrameAndEmulate
// Otherwise, load the latest state (if not already there) and seek while recording.
@ -38,7 +38,7 @@ namespace BizHawk.Client.EmuHawk
if (frame <= CurrentTasMovie.InputLogLength)
{
// Get as close as we can then emulate there
StartAtNearestFrameAndEmulate(frame);
StartAtNearestFrameAndEmulate(frame, fromLua);
MaybeFollowCursor();
}

View File

@ -805,7 +805,7 @@ namespace BizHawk.Client.EmuHawk
//_autoRestoreFrame = null;
}
private void StartAtNearestFrameAndEmulate(int frame)
private void StartAtNearestFrameAndEmulate(int frame, bool fromLua)
{
if (frame == Emulator.Frame)
return;
@ -825,6 +825,16 @@ namespace BizHawk.Client.EmuHawk
{
StartSeeking(frame);
}
else
{
if (_wasRecording)
{
//lua botting users will want to re-activate record mode automatically -- it should be like nothing ever happened
//GUI users on the other hand need to be protected from clobbering their video when skipping around
if(fromLua)
TastudioRecordMode();
}
}
}
}