From c12d715c1258b7e3fb898af1c69b55f9f5aa899c Mon Sep 17 00:00:00 2001 From: SuuperW Date: Fri, 27 Feb 2015 19:34:31 +0000 Subject: [PATCH] TAStudio: -Bugfix: Didn't refresh when changing lag frames to hide. -Bugfix: Another error with setting LastVisisbleFrame. -Bugfix: Truncating a movie didn't remove truncated marker selection. --- .../tools/TAStudio/InputRoll.cs | 13 +++++++--- .../tools/TAStudio/TAStudio.Designer.cs | 26 ++++++++++--------- .../tools/TAStudio/TAStudio.MenuItems.cs | 25 ++++++------------ 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs index 09aa7dc81e..d82d4c707e 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs @@ -383,6 +383,10 @@ namespace BizHawk.Client.EmuHawk { SelectedItems.Clear(); } + public void TruncateSelection(int index) + { + SelectedItems.RemoveAll(cell => cell.RowIndex > index); + } [Browsable(false)] [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)] @@ -588,18 +592,21 @@ namespace BizHawk.Client.EmuHawk else { if (Math.Abs(LastFullyVisibleRow - value) > VisibleRows) // Big jump + { FirstVisibleRow = Math.Max(value - (ExpectedDisplayRange() - HalfRow), 0); + SetLagFramesArray(); + } // Small jump, more accurate - int lastVisible; + int lastVisible = LastFullyVisibleRow; do { - SetLagFramesArray(); - lastVisible = LastFullyVisibleRow; if ((lastVisible - value) / (LagFramesToHide + 1) != 0) FirstVisibleRow = Math.Max(FirstVisibleRow - ((lastVisible - value) / (LagFramesToHide + 1)), 0); else FirstVisibleRow -= Math.Sign(lastVisible - value); + SetLagFramesArray(); + lastVisible = LastFullyVisibleRow; } while ((lastVisible - value < 0 || lastVisible - value > lagFrames[VisibleRows]) && FirstVisibleRow != 0); System.Diagnostics.Debug.Print("Jumped to: " + value + " (" + LastFullyVisibleRow + ")"); diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index 90afbcd654..0416bcc5a5 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -680,34 +680,36 @@ namespace BizHawk.Client.EmuHawk this.HideLagFrames0.CheckOnClick = true; this.HideLagFrames0.CheckState = System.Windows.Forms.CheckState.Checked; this.HideLagFrames0.Name = "HideLagFrames0"; - this.HideLagFrames0.Size = new System.Drawing.Size(131, 22); - this.HideLagFrames0.Tag = ""; + this.HideLagFrames0.Size = new System.Drawing.Size(152, 22); + this.HideLagFrames0.Tag = 0; this.HideLagFrames0.Text = "Don\'t Hide"; - this.HideLagFrames0.Click += new System.EventHandler(this.HideLagFrames0_Click); + this.HideLagFrames0.Click += new System.EventHandler(this.HideLagFramesX_Click); // // HideLagFrames1 // this.HideLagFrames1.CheckOnClick = true; this.HideLagFrames1.Name = "HideLagFrames1"; - this.HideLagFrames1.Size = new System.Drawing.Size(131, 22); + this.HideLagFrames1.Size = new System.Drawing.Size(152, 22); + this.HideLagFrames1.Tag = 1; this.HideLagFrames1.Text = "1 (30 fps)"; - this.HideLagFrames1.Click += new System.EventHandler(this.HideLagFrames1_Click); + this.HideLagFrames1.Click += new System.EventHandler(this.HideLagFramesX_Click); // // HideLagFrames2 // this.HideLagFrames2.Name = "HideLagFrames2"; - this.HideLagFrames2.Size = new System.Drawing.Size(131, 22); + this.HideLagFrames2.Size = new System.Drawing.Size(152, 22); + this.HideLagFrames2.Tag = 2; this.HideLagFrames2.Text = "2 (20 fps)"; - this.HideLagFrames2.Click += new System.EventHandler(this.HideLagFrames2_Click); + this.HideLagFrames2.Click += new System.EventHandler(this.HideLagFramesX_Click); // // HideLagFrames3 // this.HideLagFrames3.CheckOnClick = true; this.HideLagFrames3.Name = "HideLagFrames3"; - this.HideLagFrames3.Size = new System.Drawing.Size(131, 22); - this.HideLagFrames3.Tag = ""; + this.HideLagFrames3.Size = new System.Drawing.Size(152, 22); + this.HideLagFrames3.Tag = 3; this.HideLagFrames3.Text = "3 (15fps)"; - this.HideLagFrames3.Click += new System.EventHandler(this.HideLagFrames3_Click); + this.HideLagFrames3.Click += new System.EventHandler(this.HideLagFramesX_Click); // // ColumnsSubMenu // @@ -1171,8 +1173,8 @@ namespace BizHawk.Client.EmuHawk private System.Windows.Forms.ToolStripSeparator StartFromNowSeparator; private System.Windows.Forms.ToolStripMenuItem StartNewProjectFromNowMenuItem; private System.Windows.Forms.ToolStripMenuItem RotateMenuItem; - private System.Windows.Forms.ToolStripProgressBar SavingProgressBar; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2; + private System.Windows.Forms.ToolStripProgressBar SavingProgressBar; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2; private System.Windows.Forms.ToolStripMenuItem HideLagFramesSubMenu; private System.Windows.Forms.ToolStripMenuItem HideLagFrames3; private System.Windows.Forms.ToolStripMenuItem HideLagFrames0; diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 0534b272c5..627b0175a5 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -486,6 +486,7 @@ namespace BizHawk.Client.EmuHawk var needsToRollback = !(rollbackFrame > Emulator.Frame); CurrentTasMovie.Truncate(rollbackFrame); + MarkerControl.MarkerInputRoll.TruncateSelection(CurrentTasMovie.Markers.Count - 1); if (needsToRollback) { @@ -636,24 +637,14 @@ namespace BizHawk.Client.EmuHawk CurrentTasMovie.FlagChanges(); } - private void HideLagFrames0_Click(object sender, EventArgs e) + private void HideLagFramesX_Click(object sender, EventArgs e) { - TasView.LagFramesToHide = 0; - } - - private void HideLagFrames1_Click(object sender, EventArgs e) - { - TasView.LagFramesToHide = 1; - } - - private void HideLagFrames2_Click(object sender, EventArgs e) - { - TasView.LagFramesToHide = 2; - } - - private void HideLagFrames3_Click(object sender, EventArgs e) - { - TasView.LagFramesToHide = 3; + TasView.LagFramesToHide = (int)(sender as ToolStripMenuItem).Tag; + if (TasPlaybackBox.FollowCursor) + { + SetVisibleIndex(); + } + RefreshDialog(); } #endregion