From 6f105f6ee8ed164d04f768ea4ac45e7af565f287 Mon Sep 17 00:00:00 2001 From: Suuper Date: Wed, 22 Jul 2015 14:14:33 -0500 Subject: [PATCH] -Better fix of lag log clearing. -Current branch is now highlighted in BranchView --- .../movie/tasproj/TasLagLog.cs | 6 ++++ .../movie/tasproj/TasMovie.cs | 4 +-- .../TAStudio/BookmarksBranchesBox.Designer.cs | 32 +++++++++---------- .../tools/TAStudio/BookmarksBranchesBox.cs | 19 +++++++---- 4 files changed, 36 insertions(+), 25 deletions(-) diff --git a/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs b/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs index cc433b1907..5705cc41db 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasLagLog.cs @@ -174,5 +174,11 @@ namespace BizHawk.Client.Common return log; } + + public void FromLagLog(TasLagLog log) + { + LagLog = log.LagLog; + WasLag = log.WasLag; + } } } diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index 8c6446a9f7..67aa0907e3 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -463,8 +463,8 @@ namespace BizHawk.Client.Common _changes = true; StateManager.ClearStateHistory(); StateManager.SetState(branch.Frame, branch.CoreData); - LagLog.Clear(); - LagLog = branch.LagLog.Clone(); + //LagLog.Clear(); LagLog and InputLog is the same reference as what's in the branch! + LagLog.FromLagLog(branch.LagLog); } } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.Designer.cs index 3917880691..32e48af469 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.Designer.cs @@ -31,10 +31,10 @@ this.components = new System.ComponentModel.Container(); this.BookmarksBranchesGroupBox = new System.Windows.Forms.GroupBox(); this.BranchesContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); - this.AddContextMenu = new System.Windows.Forms.ToolStripMenuItem(); - this.RemoveBranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.LoadBranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.AddContextMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.RemoveBranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.BranchView = new BizHawk.Client.EmuHawk.VirtualListView(); this.BranchNumberColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.FrameColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -64,9 +64,22 @@ this.AddContextMenu, this.RemoveBranchContextMenuItem}); this.BranchesContextMenu.Name = "BranchesContextMenu"; - this.BranchesContextMenu.Size = new System.Drawing.Size(153, 98); + this.BranchesContextMenu.Size = new System.Drawing.Size(118, 76); this.BranchesContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.BranchesContextMenu_Opening); // + // LoadBranchContextMenuItem + // + this.LoadBranchContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Debugger; + this.LoadBranchContextMenuItem.Name = "LoadBranchContextMenuItem"; + this.LoadBranchContextMenuItem.Size = new System.Drawing.Size(117, 22); + this.LoadBranchContextMenuItem.Text = "Load"; + this.LoadBranchContextMenuItem.Click += new System.EventHandler(this.LoadBranchContextMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(114, 6); + // // AddContextMenu // this.AddContextMenu.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.add; @@ -83,19 +96,6 @@ this.RemoveBranchContextMenuItem.Text = "Remove"; this.RemoveBranchContextMenuItem.Click += new System.EventHandler(this.RemoveBranchContextMenuItem_Click); // - // LoadBranchContextMenuItem - // - this.LoadBranchContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Debugger; - this.LoadBranchContextMenuItem.Name = "LoadBranchContextMenuItem"; - this.LoadBranchContextMenuItem.Size = new System.Drawing.Size(152, 22); - this.LoadBranchContextMenuItem.Text = "Load"; - this.LoadBranchContextMenuItem.Click += new System.EventHandler(this.LoadBranchContextMenuItem_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(114, 6); - // // BranchView // this.BranchView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs index b6f19b8571..5fc46b49dd 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs @@ -43,6 +43,8 @@ namespace BizHawk.Client.EmuHawk } } + private int CurrentBranch = -1; + private void QueryItemText(int index, int column, out string text) { text = string.Empty; @@ -70,7 +72,8 @@ namespace BizHawk.Client.EmuHawk private void QueryItemBkColor(int index, int column, ref Color color) { - + if (index == CurrentBranch) + color = SystemColors.HotTrack; } private void AddContextMenu_Click(object sender, EventArgs e) @@ -92,23 +95,25 @@ namespace BizHawk.Client.EmuHawk private void BranchView_MouseDoubleClick(object sender, MouseEventArgs e) { - if (SelectedBranch != null) - { - LoadBranch(SelectedBranch); - } + LoadSelectedBranch(); } - private void LoadBranchContextMenuItem_Click(object sender, EventArgs e) + { + LoadSelectedBranch(); + } + private void LoadSelectedBranch() { if (SelectedBranch != null) { + CurrentBranch = BranchView.selectedItem; + BranchView.Refresh(); LoadBranch(SelectedBranch); } } private void BranchesContextMenu_Opening(object sender, CancelEventArgs e) { - RemoveBranchContextMenuItem.Enabled = + RemoveBranchContextMenuItem.Enabled = LoadBranchContextMenuItem.Enabled = SelectedBranch != null; }