TAStudio - implement clear frame, pause emulator on TAStudio load

This commit is contained in:
adelikat 2012-08-17 02:26:47 +00:00
parent 9baf1b8f28
commit d7e05ceb32
3 changed files with 50 additions and 3 deletions

View File

@ -237,6 +237,17 @@ namespace BizHawk.MultiClient
return ""; return "";
} }
public void ModifyFrame(string record, int frame)
{
Log.SetFrameAt(frame, record);
}
public void ClearFrame(int frame)
{
MnemonicsGenerator mg = new MnemonicsGenerator();
Log.SetFrameAt(frame, mg.GetEmptyMnemonic());
}
public void AppendFrame(string record) public void AppendFrame(string record)
{ {
Log.AddFrame(record); Log.AddFrame(record);

View File

@ -88,6 +88,8 @@
this.TASView = new BizHawk.VirtualListView(); this.TASView = new BizHawk.VirtualListView();
this.Frame = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.Frame = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Log = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.Log = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.clearToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout();
this.ControllersContext.SuspendLayout(); this.ControllersContext.SuspendLayout();
@ -224,6 +226,7 @@
this.clearToolStripMenuItem2.Name = "clearToolStripMenuItem2"; this.clearToolStripMenuItem2.Name = "clearToolStripMenuItem2";
this.clearToolStripMenuItem2.Size = new System.Drawing.Size(187, 22); this.clearToolStripMenuItem2.Size = new System.Drawing.Size(187, 22);
this.clearToolStripMenuItem2.Text = "Clear"; this.clearToolStripMenuItem2.Text = "Clear";
this.clearToolStripMenuItem2.Click += new System.EventHandler(this.clearToolStripMenuItem2_Click);
// //
// deleteFramesToolStripMenuItem // deleteFramesToolStripMenuItem
// //
@ -332,12 +335,14 @@
// contextMenuStrip1 // contextMenuStrip1
// //
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ContextMenu_Insert, this.clearToolStripMenuItem3,
this.cloneToolStripMenuItem1,
this.ContextMenu_Delete, this.ContextMenu_Delete,
this.cloneToolStripMenuItem1,
this.ContextMenu_Insert,
this.toolStripSeparator5,
this.SelectAll}); this.SelectAll});
this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(232, 114); this.contextMenuStrip1.Size = new System.Drawing.Size(232, 120);
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening); this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
// //
// ContextMenu_Insert // ContextMenu_Insert
@ -540,6 +545,17 @@
this.Log.Text = "Log"; this.Log.Text = "Log";
this.Log.Width = 201; this.Log.Width = 201;
// //
// clearToolStripMenuItem3
//
this.clearToolStripMenuItem3.Name = "clearToolStripMenuItem3";
this.clearToolStripMenuItem3.Size = new System.Drawing.Size(231, 22);
this.clearToolStripMenuItem3.Text = "Clear";
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(228, 6);
//
// TAStudio // TAStudio
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -620,5 +636,7 @@
private System.Windows.Forms.ToolStripMenuItem deleteFramesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem deleteFramesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem2; private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem insertNumFramesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem insertNumFramesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem3;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
} }
} }

View File

@ -12,6 +12,7 @@ namespace BizHawk.MultiClient
public partial class TAStudio : Form public partial class TAStudio : Form
{ {
//TODO: //TODO:
//Ins/Del hotkeys for Clear and Insert # Frames (set up key listener)
//When closing tastudio, don't write the movie file? AskSave() is acceptable however //When closing tastudio, don't write the movie file? AskSave() is acceptable however
//If null emulator do a base virtualpad so getmnemonic doesn't fail //If null emulator do a base virtualpad so getmnemonic doesn't fail
//Right-click - Go to current frame //Right-click - Go to current frame
@ -163,6 +164,7 @@ namespace BizHawk.MultiClient
{ {
//TODO: don't engage until new/open project //TODO: don't engage until new/open project
// //
Global.MainForm.PauseEmulator();
Engaged = true; Engaged = true;
Global.OSD.AddMessage("TAStudio engaged"); Global.OSD.AddMessage("TAStudio engaged");
if (Global.MovieSession.Movie.Mode != MOVIEMODE.INACTIVE) if (Global.MovieSession.Movie.Mode != MOVIEMODE.INACTIVE)
@ -631,5 +633,21 @@ namespace BizHawk.MultiClient
UpdateValues(); UpdateValues();
} }
private void ClearFrames()
{
ListView.SelectedIndexCollection list = TASView.SelectedIndices;
for (int index = 0; index < list.Count; index++)
{
Global.MovieSession.Movie.ClearFrame(list[index]);
}
UpdateValues();
}
private void clearToolStripMenuItem2_Click(object sender, EventArgs e)
{
ClearFrames();
}
} }
} }