Slight and meaningless TAStudio stuff

This commit is contained in:
adelikat 2014-02-02 17:49:40 +00:00
parent 06338066c7
commit f72debc84e
2 changed files with 15 additions and 24 deletions

View File

@ -151,7 +151,7 @@ namespace BizHawk.Client.EmuHawk
this.NewTASMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); this.NewTASMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.NewTASMenuItem.Size = new System.Drawing.Size(186, 22); this.NewTASMenuItem.Size = new System.Drawing.Size(186, 22);
this.NewTASMenuItem.Text = "&New"; this.NewTASMenuItem.Text = "&New";
this.NewTASMenuItem.Click += new System.EventHandler(this.NewTASMenuItem_Click); this.NewTASMenuItem.Click += new System.EventHandler(this.NewTasMenuItem_Click);
// //
// OpenTASMenuItem // OpenTASMenuItem
// //
@ -159,7 +159,7 @@ namespace BizHawk.Client.EmuHawk
this.OpenTASMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); this.OpenTASMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.OpenTASMenuItem.Size = new System.Drawing.Size(186, 22); this.OpenTASMenuItem.Size = new System.Drawing.Size(186, 22);
this.OpenTASMenuItem.Text = "&Open"; this.OpenTASMenuItem.Text = "&Open";
this.OpenTASMenuItem.Click += new System.EventHandler(this.OpenTASMenuItem_Click); this.OpenTASMenuItem.Click += new System.EventHandler(this.OpenTasMenuItem_Click);
// //
// SaveTASMenuItem // SaveTASMenuItem
// //
@ -756,7 +756,7 @@ namespace BizHawk.Client.EmuHawk
this.Name = "TAStudio"; this.Name = "TAStudio";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "TAStudio"; this.Text = "TAStudio";
this.Load += new System.EventHandler(this.TAStudio_Load); this.Load += new System.EventHandler(this.Tastudio_Load);
this.TASMenu.ResumeLayout(false); this.TASMenu.ResumeLayout(false);
this.TASMenu.PerformLayout(); this.TASMenu.PerformLayout();
this.TasStatusStrip.ResumeLayout(false); this.TasStatusStrip.ResumeLayout(false);

View File

@ -143,14 +143,7 @@ namespace BizHawk.Client.EmuHawk
if (columnName == MarkerColumnName) if (columnName == MarkerColumnName)
{ {
if (_markers.CurrentFrame == index + 1) text = _markers.CurrentFrame == index + 1 ? ">" : string.Empty;
{
text = ">";
}
else
{
text = String.Empty;
}
} }
else if (columnName == FrameColumnName) else if (columnName == FrameColumnName)
{ {
@ -158,17 +151,17 @@ namespace BizHawk.Client.EmuHawk
} }
else else
{ {
text = _tas[index].IsPressed(columnName) ? columnText : String.Empty; text = _tas[index].IsPressed(columnName) ? columnText : string.Empty;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
text = String.Empty; text = string.Empty;
MessageBox.Show("oops\n" + ex); MessageBox.Show("oops\n" + ex);
} }
} }
private void TAStudio_Load(object sender, EventArgs e) private void Tastudio_Load(object sender, EventArgs e)
{ {
if (Global.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
@ -193,7 +186,6 @@ namespace BizHawk.Client.EmuHawk
_tas.ActivePlayers = new List<string> { "Player 1" }; // TODO _tas.ActivePlayers = new List<string> { "Player 1" }; // TODO
SetUpColumns(); SetUpColumns();
LoadConfigSettings(); LoadConfigSettings();
} }
@ -300,7 +292,7 @@ namespace BizHawk.Client.EmuHawk
{ {
_tas.SwitchToPlay(); _tas.SwitchToPlay();
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(_tas[frame].State.ToArray()))); Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(_tas[frame].State.ToArray())));
Global.Emulator.FrameAdvance(true, true); Global.Emulator.FrameAdvance(true);
GlobalWin.DisplayManager.NeedsToPaint = true; GlobalWin.DisplayManager.NeedsToPaint = true;
TasView.ensureVisible(frame); TasView.ensureVisible(frame);
TasView.Refresh(); TasView.Refresh();
@ -316,7 +308,7 @@ namespace BizHawk.Client.EmuHawk
// TODO: columns selected // TODO: columns selected
// TODO: clipboard // TODO: clipboard
var list = TasView.SelectedIndices; var list = TasView.SelectedIndices;
var message = string.Empty; string message;
if (list.Count > 0) if (list.Count > 0)
{ {
@ -354,13 +346,12 @@ namespace BizHawk.Client.EmuHawk
); );
} }
private void NewTASMenuItem_Click(object sender, EventArgs e) private void NewTasMenuItem_Click(object sender, EventArgs e)
{ {
StartNewSession(); StartNewSession();
} }
private void OpenTasMenuItem_Click(object sender, EventArgs e)
private void OpenTASMenuItem_Click(object sender, EventArgs e)
{ {
if (AskSave()) if (AskSave())
{ {
@ -371,7 +362,7 @@ namespace BizHawk.Client.EmuHawk
_tas.Load(); _tas.Load();
Global.Config.RecentTas.Add(_tas.Filename); Global.Config.RecentTas.Add(_tas.Filename);
TasView.ItemCount = _tas.InputLogLength; TasView.ItemCount = _tas.InputLogLength;
// TOOD: message to the user MessageStatusLabel.Text = Path.GetFileName(_tas.Filename) + " loaded.";
} }
} }
} }
@ -385,8 +376,8 @@ namespace BizHawk.Client.EmuHawk
else else
{ {
_tas.Save(); _tas.Save();
MessageStatusLabel.Text = Path.GetFileName(_tas.Filename) + " saved.";
} }
// TODO: inform the user it happened somehow
} }
private void SaveAsTasMenuItem_Click(object sender, EventArgs e) private void SaveAsTasMenuItem_Click(object sender, EventArgs e)
@ -397,7 +388,7 @@ namespace BizHawk.Client.EmuHawk
_tas.Filename = file.FullName; _tas.Filename = file.FullName;
_tas.Save(); _tas.Save();
Global.Config.RecentTas.Add(_tas.Filename); Global.Config.RecentTas.Add(_tas.Filename);
// TODO: inform the user it happened somehow MessageStatusLabel.Text = Path.GetFileName(_tas.Filename) + " saved.";
} }
} }
@ -547,7 +538,7 @@ namespace BizHawk.Client.EmuHawk
endVal = e.OldCell.Row.Value; endVal = e.OldCell.Row.Value;
} }
for (int i = startVal + 1; i <= endVal; i++) for (var i = startVal + 1; i <= endVal; i++)
{ {
TasView.SelectItem(i, true); TasView.SelectItem(i, true);
} }