TAStudio: do not seek when needing to load greenzone on paint

This commit is contained in:
alyosha-tas 2021-10-12 19:04:43 -04:00
parent f721dad395
commit 5626edf43d
2 changed files with 9 additions and 9 deletions

View File

@ -67,11 +67,11 @@ namespace BizHawk.Client.EmuHawk
public AutoPatternBool[] BoolPatterns;
public AutoPatternAxis[] AxisPatterns;
public void JumpToGreenzone()
public void JumpToGreenzone(bool OnLeftMouseDown = false)
{
if (Emulator.Frame > CurrentTasMovie.LastEditedFrame)
{
GoToLastEmulatedFrameIfNecessary(CurrentTasMovie.LastEditedFrame);
GoToLastEmulatedFrameIfNecessary(CurrentTasMovie.LastEditedFrame, OnLeftMouseDown);
}
}
@ -611,7 +611,7 @@ namespace BizHawk.Client.EmuHawk
if (TasView.CurrentCell.Column.Name == CursorColumnName)
{
_startCursorDrag = true;
GoToFrame(TasView.CurrentCell.RowIndex.Value);
GoToFrame(TasView.CurrentCell.RowIndex.Value, false, false, true);
}
else if (TasView.CurrentCell.Column.Name == FrameColumnName)
{
@ -673,7 +673,7 @@ namespace BizHawk.Client.EmuHawk
CurrentTasMovie.SetBoolStates(firstSel, (frame - firstSel) + 1, buttonName, !allPressed);
_boolPaintState = CurrentTasMovie.BoolIsPressed(frame, buttonName);
_triggerAutoRestore = true;
JumpToGreenzone();
JumpToGreenzone(true);
RefreshDialog();
}
else if (ModifierKeys == Keys.Shift && ModifierKeys == Keys.Alt) // Does not work?
@ -687,7 +687,7 @@ namespace BizHawk.Client.EmuHawk
CurrentTasMovie.ToggleBoolState(TasView.CurrentCell.RowIndex.Value, buttonName);
_boolPaintState = CurrentTasMovie.BoolIsPressed(frame, buttonName);
_triggerAutoRestore = true;
JumpToGreenzone();
JumpToGreenzone(true);
RefreshDialog();
}
}

View File

@ -7,7 +7,7 @@ namespace BizHawk.Client.EmuHawk
/// <summary>
/// Only goes to go to the frame if it is an event before current emulation, otherwise it is just a future event that can freely be edited
/// </summary>
private void GoToLastEmulatedFrameIfNecessary(int frame)
private void GoToLastEmulatedFrameIfNecessary(int frame, bool OnLeftMouseDown = false)
{
if (frame != Emulator.Frame) // Don't go to a frame if you are already on it!
{
@ -20,12 +20,12 @@ namespace BizHawk.Client.EmuHawk
CurrentTasMovie.LastPositionStable = true; // until new frame is emulated
}
GoToFrame(frame);
GoToFrame(frame, false, false, OnLeftMouseDown);
}
}
}
public void GoToFrame(int frame, bool fromLua = false, bool fromRewinding = false)
public void GoToFrame(int frame, bool fromLua = false, bool fromRewinding = false, bool OnLeftMouseDown = 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.
@ -35,7 +35,7 @@ namespace BizHawk.Client.EmuHawk
{
// Get as close as we can then emulate there
StartAtNearestFrameAndEmulate(frame, fromLua, fromRewinding);
MaybeFollowCursor();
if (!OnLeftMouseDown) { MaybeFollowCursor(); }
}
else // Emulate to a future frame
{