From d1cb8d53ad2bf4e52c4aa2a261bae74c5621150c Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 1 May 2020 09:52:25 -0500 Subject: [PATCH] Tastudio a few simplifications --- .../tools/TAStudio/MarkerControl.cs | 2 +- BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs | 2 +- .../tools/TAStudio/TAStudio.IToolForm.cs | 2 +- .../tools/TAStudio/TAStudio.Navigation.cs | 11 +++-------- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs index 859d07184f..81abdf2d18 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs @@ -101,7 +101,7 @@ namespace BizHawk.Client.EmuHawk { if (MarkerView.AnyRowsSelected) { - Tastudio.SetVisibleIndex(SelectedMarkerFrame()); + Tastudio.SetVisibleFrame(SelectedMarkerFrame()); Tastudio.RefreshDialog(); } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs index 0653b98019..b5c2f4f30b 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs @@ -118,7 +118,7 @@ namespace BizHawk.Client.EmuHawk if (Tastudio.Settings.FollowCursor) { - Tastudio.SetVisibleIndex(); + Tastudio.SetVisibleFrame(); Tastudio.RefreshDialog(); } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs index 024c0743be..9a09ccb391 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs @@ -45,7 +45,7 @@ namespace BizHawk.Client.EmuHawk return; } - bool refreshNeeded = false; + var refreshNeeded = false; if (AutoadjustInputMenuItem.Checked) { refreshNeeded = AutoAdjustInput(); diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs index a51eaff86c..0cdbae8bdd 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs @@ -97,26 +97,21 @@ namespace BizHawk.Client.EmuHawk /// /// Makes the given frame visible. If no frame is given, makes the current frame visible. /// - 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(); } } }