Tastudio - Branch context menu item available if pointing at the current frame

This commit is contained in:
adelikat 2015-07-19 21:57:41 -04:00
parent 125a16ec67
commit 6000a499e7
3 changed files with 25 additions and 1 deletions

View File

@ -184,5 +184,11 @@ namespace BizHawk.Client.EmuHawk
{
BranchView.ItemCount = Branches.Count;
}
public void Branch()
{
// TODO: refactor, creating a branch shouldn't be in context menu click event
AddContextMenu_Click(null, null);
}
}
}

View File

@ -172,6 +172,7 @@ namespace BizHawk.Client.EmuHawk
this.StartNewProjectFromNowMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.BookMarkControl = new BizHawk.Client.EmuHawk.BookmarksBranchesBox();
this.BranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.TASMenu.SuspendLayout();
this.TasStatusStrip.SuspendLayout();
this.MarkerContextMenu.SuspendLayout();
@ -1168,10 +1169,11 @@ namespace BizHawk.Client.EmuHawk
this.InsertNumFramesContextMenuItem,
this.toolStripSeparator18,
this.TruncateContextMenuItem,
this.BranchContextMenuItem,
this.StartFromNowSeparator,
this.StartNewProjectFromNowMenuItem});
this.RightClickMenu.Name = "RightClickMenu";
this.RightClickMenu.Size = new System.Drawing.Size(273, 414);
this.RightClickMenu.Size = new System.Drawing.Size(273, 458);
this.RightClickMenu.Opened += new System.EventHandler(this.RightClickMenu_Opened);
//
// SetMarkersContextMenuItem
@ -1354,6 +1356,14 @@ namespace BizHawk.Client.EmuHawk
this.BookMarkControl.Name = "BookMarkControl";
this.BookMarkControl.Size = new System.Drawing.Size(204, 205);
this.BookMarkControl.TabIndex = 8;
this.BookMarkControl.Tastudio = null;
//
// BranchContextMenuItem
//
this.BranchContextMenuItem.Name = "BranchContextMenuItem";
this.BranchContextMenuItem.Size = new System.Drawing.Size(272, 22);
this.BranchContextMenuItem.Text = "&Branch";
this.BranchContextMenuItem.Click += new System.EventHandler(this.BranchContextMenuItem_Click);
//
// TAStudio
//
@ -1534,5 +1544,6 @@ namespace BizHawk.Client.EmuHawk
private System.Windows.Forms.ToolStripMenuItem applyPatternToPaintedInputToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem onlyOnAutoFireColumnsToolStripMenuItem;
private BookmarksBranchesBox BookMarkControl;
private System.Windows.Forms.ToolStripMenuItem BranchContextMenuItem;
}
}

View File

@ -979,6 +979,8 @@ namespace BizHawk.Client.EmuHawk
RemoveMarkersContextMenuItem.Enabled = CurrentTasMovie.Markers.Any(m => TasView.SelectedRows.Contains(m.Frame)); // Disable the option to remove markers if no markers are selected (FCEUX does this).
CancelSeekContextMenuItem.Enabled = GlobalWin.MainForm.PauseOnFrame.HasValue;
BranchContextMenuItem.Visible = TasView.CurrentCell.RowIndex == Global.Emulator.Frame;
}
private void CancelSeekContextMenuItem_Click(object sender, EventArgs e)
@ -987,6 +989,11 @@ namespace BizHawk.Client.EmuHawk
RefreshTasView();
}
private void BranchContextMenuItem_Click(object sender, EventArgs e)
{
BookMarkControl.Branch();
}
private void StartNewProjectFromNowMenuItem_Click(object sender, EventArgs e)
{
if (TasView.SelectedRows.Count() == 1 &&