From 5ed74d018841c09860c12a0beb8d4fed91483922 Mon Sep 17 00:00:00 2001 From: kylelyk Date: Sat, 23 Aug 2014 02:51:52 +0000 Subject: [PATCH] Set Markers and Remove Markers ContextMenuItems are now working. If multiple rows are selected, the new marker dialog will come up for each row. The option to remove markers is disabled if selected rows do not contain at least one marker. --- .../tools/TAStudio/TAStudio.Designer.cs | 4 ++-- .../tools/TAStudio/TAStudio.ListView.cs | 2 ++ BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index 3d4fcd8859..1de1ee1ffe 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -799,17 +799,17 @@ namespace BizHawk.Client.EmuHawk // // SetMarkersContextMenuItem // - this.SetMarkersContextMenuItem.Enabled = false; this.SetMarkersContextMenuItem.Name = "SetMarkersContextMenuItem"; this.SetMarkersContextMenuItem.Size = new System.Drawing.Size(272, 22); this.SetMarkersContextMenuItem.Text = "Set Markers"; + this.SetMarkersContextMenuItem.Click += new System.EventHandler(this.SetMarkersMenuItem_Click); // // RemoveMarkersContextMenuItem // - this.RemoveMarkersContextMenuItem.Enabled = false; this.RemoveMarkersContextMenuItem.Name = "RemoveMarkersContextMenuItem"; this.RemoveMarkersContextMenuItem.Size = new System.Drawing.Size(272, 22); this.RemoveMarkersContextMenuItem.Text = "Remove Markers"; + this.RemoveMarkersContextMenuItem.Click += new System.EventHandler(this.RemoveMarkersMenuItem_Click); // // toolStripSeparator15 // diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index c70b402aeb..3a8eb6e437 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -238,6 +238,8 @@ namespace BizHawk.Client.EmuHawk var buttonName = TasView.PointedCell.Column; if (TasView.SelectedIndices.IndexOf(frame) != -1 && (buttonName == MarkerColumnName || buttonName == FrameColumnName)) { + //Disable the option to remove markers if no markers are selected (FCUEX does this). + RemoveMarkersContextMenuItem.Enabled = _currentTasMovie.Markers.Any(m => TasView.SelectedIndices().Contains(m.Frame)); RightClickMenu.Show(TasView, e.X, e.Y); } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 43ace4b027..c975752814 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -800,6 +800,21 @@ namespace BizHawk.Client.EmuHawk } } + private void SetMarkersMenuItem_Click(object sender, EventArgs e) + { + foreach(int index in TasView.SelectedIndices()) + { + CallAddMarkerPopUp(index); + } + } + + private void RemoveMarkersMenuItem_Click(object sender, EventArgs e) + { + + _currentTasMovie.Markers.RemoveAll(m => TasView.SelectedIndices().Contains(m.Frame)); + RefreshDialog(); + } + #endregion #region Config