Tastudio a few simplifications

This commit is contained in:
adelikat 2020-05-01 09:52:25 -05:00
parent 67a832d79a
commit d1cb8d53ad
4 changed files with 6 additions and 11 deletions

View File

@ -101,7 +101,7 @@ namespace BizHawk.Client.EmuHawk
{
if (MarkerView.AnyRowsSelected)
{
Tastudio.SetVisibleIndex(SelectedMarkerFrame());
Tastudio.SetVisibleFrame(SelectedMarkerFrame());
Tastudio.RefreshDialog();
}
}

View File

@ -118,7 +118,7 @@ namespace BizHawk.Client.EmuHawk
if (Tastudio.Settings.FollowCursor)
{
Tastudio.SetVisibleIndex();
Tastudio.SetVisibleFrame();
Tastudio.RefreshDialog();
}
}

View File

@ -45,7 +45,7 @@ namespace BizHawk.Client.EmuHawk
return;
}
bool refreshNeeded = false;
var refreshNeeded = false;
if (AutoadjustInputMenuItem.Checked)
{
refreshNeeded = AutoAdjustInput();

View File

@ -97,26 +97,21 @@ namespace BizHawk.Client.EmuHawk
/// <summary>
/// Makes the given frame visible. If no frame is given, makes the current frame visible.
/// </summary>
public void SetVisibleIndex(int? indexThatMustBeVisible = null)
public void SetVisibleFrame(int? frame = null)
{
if (TasView.AlwaysScroll && _leftButtonHeld)
{
return;
}
if (!indexThatMustBeVisible.HasValue)
{
indexThatMustBeVisible = Emulator.Frame;
}
TasView.ScrollToIndex(indexThatMustBeVisible.Value);
TasView.ScrollToIndex(frame ?? Emulator.Frame);
}
private void MaybeFollowCursor()
{
if (TasPlaybackBox.FollowCursor)
{
SetVisibleIndex();
SetVisibleFrame();
}
}
}