TAStudio - fix up Insert Frame functionality, add it to non-interim builds, and map hotkey as ctrl+shift+ins

This commit is contained in:
adelikat 2012-08-17 01:26:00 +00:00
parent 932303df68
commit e900a5b1ba
2 changed files with 59 additions and 25 deletions

View File

@ -64,8 +64,8 @@
this.ReadOnlyCheckBox = new System.Windows.Forms.CheckBox(); this.ReadOnlyCheckBox = new System.Windows.Forms.CheckBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.Insert = new System.Windows.Forms.ToolStripMenuItem(); this.ContextMenu_Insert = new System.Windows.Forms.ToolStripMenuItem();
this.Delete = new System.Windows.Forms.ToolStripMenuItem(); this.ContextMenu_Delete = new System.Windows.Forms.ToolStripMenuItem();
this.SelectAll = new System.Windows.Forms.ToolStripMenuItem(); this.SelectAll = new System.Windows.Forms.ToolStripMenuItem();
this.ControllerBox = new System.Windows.Forms.GroupBox(); this.ControllerBox = new System.Windows.Forms.GroupBox();
this.ControllersContext = new System.Windows.Forms.ContextMenuStrip(this.components); this.ControllersContext = new System.Windows.Forms.ContextMenuStrip(this.components);
@ -213,20 +213,21 @@
// insertFrameToolStripMenuItem // insertFrameToolStripMenuItem
// //
this.insertFrameToolStripMenuItem.Name = "insertFrameToolStripMenuItem"; this.insertFrameToolStripMenuItem.Name = "insertFrameToolStripMenuItem";
this.insertFrameToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); this.insertFrameToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
this.insertFrameToolStripMenuItem.Size = new System.Drawing.Size(191, 22); | System.Windows.Forms.Keys.Insert)));
this.insertFrameToolStripMenuItem.Text = "Insert Frame"; this.insertFrameToolStripMenuItem.Size = new System.Drawing.Size(247, 22);
this.insertFrameToolStripMenuItem.Text = "Insert New Frame";
this.insertFrameToolStripMenuItem.Click += new System.EventHandler(this.insertFrameToolStripMenuItem_Click); this.insertFrameToolStripMenuItem.Click += new System.EventHandler(this.insertFrameToolStripMenuItem_Click);
// //
// toolStripSeparator7 // toolStripSeparator7
// //
this.toolStripSeparator7.Name = "toolStripSeparator7"; this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(188, 6); this.toolStripSeparator7.Size = new System.Drawing.Size(244, 6);
// //
// clearVirtualPadsToolStripMenuItem // clearVirtualPadsToolStripMenuItem
// //
this.clearVirtualPadsToolStripMenuItem.Name = "clearVirtualPadsToolStripMenuItem"; this.clearVirtualPadsToolStripMenuItem.Name = "clearVirtualPadsToolStripMenuItem";
this.clearVirtualPadsToolStripMenuItem.Size = new System.Drawing.Size(191, 22); this.clearVirtualPadsToolStripMenuItem.Size = new System.Drawing.Size(247, 22);
this.clearVirtualPadsToolStripMenuItem.Text = "&Clear Controller Holds"; this.clearVirtualPadsToolStripMenuItem.Text = "&Clear Controller Holds";
this.clearVirtualPadsToolStripMenuItem.Click += new System.EventHandler(this.clearVirtualPadsToolStripMenuItem_Click); this.clearVirtualPadsToolStripMenuItem.Click += new System.EventHandler(this.clearVirtualPadsToolStripMenuItem_Click);
// //
@ -294,31 +295,33 @@
// contextMenuStrip1 // contextMenuStrip1
// //
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.Insert, this.ContextMenu_Insert,
this.Delete, this.ContextMenu_Delete,
this.SelectAll}); this.SelectAll});
this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(157, 70); this.contextMenuStrip1.Size = new System.Drawing.Size(248, 70);
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
// //
// Insert // ContextMenu_Insert
// //
this.Insert.Name = "Insert"; this.ContextMenu_Insert.Name = "ContextMenu_Insert";
this.Insert.Size = new System.Drawing.Size(156, 22); this.ContextMenu_Insert.ShortcutKeyDisplayString = "Ctrl+Shift+Ins";
this.Insert.Text = "Insert Frame(s)"; this.ContextMenu_Insert.Size = new System.Drawing.Size(247, 22);
this.Insert.Click += new System.EventHandler(this.Insert_Click); this.ContextMenu_Insert.Text = "Insert New Frame";
this.ContextMenu_Insert.Click += new System.EventHandler(this.Insert_Click);
// //
// Delete // ContextMenu_Delete
// //
this.Delete.Name = "Delete"; this.ContextMenu_Delete.Name = "ContextMenu_Delete";
this.Delete.Size = new System.Drawing.Size(156, 22); this.ContextMenu_Delete.Size = new System.Drawing.Size(247, 22);
this.Delete.Text = "Delete Frame(s)"; this.ContextMenu_Delete.Text = "Delete Frame(s)";
this.Delete.Click += new System.EventHandler(this.Delete_Click); this.ContextMenu_Delete.Click += new System.EventHandler(this.Delete_Click);
// //
// SelectAll // SelectAll
// //
this.SelectAll.Enabled = false; this.SelectAll.Enabled = false;
this.SelectAll.Name = "SelectAll"; this.SelectAll.Name = "SelectAll";
this.SelectAll.Size = new System.Drawing.Size(156, 22); this.SelectAll.Size = new System.Drawing.Size(247, 22);
this.SelectAll.Text = "Select All"; this.SelectAll.Text = "Select All";
// //
// ControllerBox // ControllerBox
@ -551,7 +554,7 @@
private System.Windows.Forms.ToolStripButton FastFowardToEnd; private System.Windows.Forms.ToolStripButton FastFowardToEnd;
private System.Windows.Forms.ToolStripMenuItem insertFrameToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem insertFrameToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem Insert; private System.Windows.Forms.ToolStripMenuItem ContextMenu_Insert;
private System.Windows.Forms.ToolStripMenuItem SelectAll; private System.Windows.Forms.ToolStripMenuItem SelectAll;
private System.Windows.Forms.GroupBox ControllerBox; private System.Windows.Forms.GroupBox ControllerBox;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
@ -564,6 +567,6 @@
private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem1;
private System.Windows.Forms.ToolStripButton FastForward; private System.Windows.Forms.ToolStripButton FastForward;
private System.Windows.Forms.ToolStripButton TurboFastForward; private System.Windows.Forms.ToolStripButton TurboFastForward;
private System.Windows.Forms.ToolStripMenuItem Delete; private System.Windows.Forms.ToolStripMenuItem ContextMenu_Delete;
} }
} }

View File

@ -272,7 +272,6 @@ namespace BizHawk.MultiClient
saveProjectAsToolStripMenuItem.Enabled = false; saveProjectAsToolStripMenuItem.Enabled = false;
recentToolStripMenuItem.Enabled = false; recentToolStripMenuItem.Enabled = false;
importTASFileToolStripMenuItem.Enabled = false; importTASFileToolStripMenuItem.Enabled = false;
insertFrameToolStripMenuItem.Enabled = false;
} }
LoadTAStudio(); LoadTAStudio();
@ -361,6 +360,7 @@ namespace BizHawk.MultiClient
{ {
if (ReadOnlyCheckBox.Checked) if (ReadOnlyCheckBox.Checked)
{ {
Global.MainForm.SetReadOnly(true);
ReadOnlyCheckBox.BackColor = System.Drawing.SystemColors.Control; ReadOnlyCheckBox.BackColor = System.Drawing.SystemColors.Control;
if (Global.MovieSession.Movie.Mode != MOVIEMODE.INACTIVE) if (Global.MovieSession.Movie.Mode != MOVIEMODE.INACTIVE)
@ -371,6 +371,7 @@ namespace BizHawk.MultiClient
} }
else else
{ {
Global.MainForm.SetReadOnly(false);
ReadOnlyCheckBox.BackColor = Color.LightCoral; ReadOnlyCheckBox.BackColor = Color.LightCoral;
if (Global.MovieSession.Movie.Mode != MOVIEMODE.INACTIVE) if (Global.MovieSession.Movie.Mode != MOVIEMODE.INACTIVE)
{ {
@ -420,8 +421,14 @@ namespace BizHawk.MultiClient
private void insertFrameToolStripMenuItem_Click(object sender, EventArgs e) private void insertFrameToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (Global.MainForm.ReadOnly) if (ReadOnlyCheckBox.Checked)
{
return; return;
}
else
{
InsertNewFrame();
}
} }
private void updatePadsOnMovePlaybackToolStripMenuItem_Click(object sender, EventArgs e) private void updatePadsOnMovePlaybackToolStripMenuItem_Click(object sender, EventArgs e)
@ -507,6 +514,11 @@ namespace BizHawk.MultiClient
} }
private void Insert_Click(object sender, EventArgs e) private void Insert_Click(object sender, EventArgs e)
{
InsertNewFrame();
}
private void InsertNewFrame()
{ {
ListView.SelectedIndexCollection list = TASView.SelectedIndices; ListView.SelectedIndexCollection list = TASView.SelectedIndices;
for (int index = 0; index < list.Count; index++) for (int index = 0; index < list.Count; index++)
@ -516,6 +528,11 @@ namespace BizHawk.MultiClient
} }
private void Delete_Click(object sender, EventArgs e) private void Delete_Click(object sender, EventArgs e)
{
DeleteFrame();
}
private void DeleteFrame()
{ {
ListView.SelectedIndexCollection list = TASView.SelectedIndices; ListView.SelectedIndexCollection list = TASView.SelectedIndices;
for (int index = 0; index < list.Count; index++) for (int index = 0; index < list.Count; index++)
@ -559,5 +576,19 @@ namespace BizHawk.MultiClient
} }
} }
} }
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
if (ReadOnlyCheckBox.Checked)
{
ContextMenu_Insert.Enabled = false; //TODO: just hide them, but right now only read-only depenent items are in this menu and I need something to show!
ContextMenu_Delete.Enabled = false;
}
else
{
ContextMenu_Insert.Enabled = true;
ContextMenu_Delete.Enabled = true;
}
}
} }
} }