From 6fa3cf4d28351c14daade6bcc960bf5d94e3ecec Mon Sep 17 00:00:00 2001 From: kylelyk Date: Sat, 23 Aug 2014 02:06:56 +0000 Subject: [PATCH] Inserting frames in TAStudio now inserts before FirstSelectedIndex like FCEUX and most other programs with insertion options. --- BizHawk.Client.Common/movie/tasproj/TasMovie.cs | 1 + BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index 0f056a261c..580eca9465 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -65,6 +65,7 @@ namespace BizHawk.Client.Common /// /// Removes lag log and greenzone after this frame /// + /// The last frame that can be valid. private void InvalidateAfter(int frame) { if (frame < LagLog.Count) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 2dbed31992..43ace4b027 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -286,8 +286,8 @@ namespace BizHawk.Client.EmuHawk } } else // We are going foward - { - var goToFrame = frame - 1; + { + var goToFrame = frame == 0 ? 0 : frame - 1; if (_currentTasMovie[goToFrame].HasState) // Can we go directly there? { _currentTasMovie.SwitchToPlay(); @@ -743,8 +743,8 @@ namespace BizHawk.Client.EmuHawk private void InsertFrameMenuItem_Click(object sender, EventArgs e) { - var insertionFrame = TasView.SelectedIndices().Any() ? LastSelectedIndex + 1 : 0; - var needsToRollback = !(insertionFrame > Global.Emulator.Frame); + var insertionFrame = TasView.SelectedIndices().Any() ? FirstSelectedIndex : 0; + bool needsToRollback = insertionFrame <= Global.Emulator.Frame; _currentTasMovie.InsertEmptyFrame(insertionFrame); @@ -760,8 +760,8 @@ namespace BizHawk.Client.EmuHawk private void InsertNumFramesMenuItem_Click(object sender, EventArgs e) { - var insertionFrame = TasView.SelectedIndices().Any() ? LastSelectedIndex + 1 : 0; - var needsToRollback = !(insertionFrame > Global.Emulator.Frame); + var insertionFrame = TasView.SelectedIndices().Any() ? FirstSelectedIndex : 0; + bool needsToRollback = insertionFrame <= Global.Emulator.Frame; var framesPrompt = new FramesPrompt(); var result = framesPrompt.ShowDialog();