Tastudio - support dragging the marker through greenzone frames. Does nothing currently if you go outside the greenzone.

This commit is contained in:
adelikat 2013-12-15 04:45:46 +00:00
parent 1723f9dc92
commit a75e91af13
2 changed files with 27 additions and 2 deletions

View File

@ -92,7 +92,7 @@ namespace BizHawk.Client.EmuHawk
get { return Global.Emulator.Frame; }
}
public virtual string Message
public override string Message
{
get { return String.Empty; }
set { return; }

View File

@ -282,6 +282,28 @@ namespace BizHawk.Client.EmuHawk
}
}
private void GoToFrame(int frame)
{
//If past greenzone, emulate and capture states
//if past greenzone AND movie, record input and capture states
//If in greenzone, loadstate
//If near a greenzone item, load and emulate
//Do capturing and recording as needed
if (_tas[frame - 1].HasState) // Go back 1 frame and emulate
{
_tas.SwitchToPlay();
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(_tas[frame].State.ToArray())));
Global.Emulator.FrameAdvance(true, true);
GlobalWin.DisplayManager.NeedsToPaint = true;
TASView.Refresh();
}
else
{
//Find the earliest frame before this state
}
}
#region Events
#region File Menu
@ -449,7 +471,10 @@ namespace BizHawk.Client.EmuHawk
{
if (StartMarkerDrag)
{
// TODO e.NewCell.Row
if (e.NewCell.Row.HasValue)
{
GoToFrame(e.NewCell.Row.Value + 1);
}
}
else if (StartFrameDrag)
{