TAStudio - start the "New" menu item, but it doesn't ask to save changes, it also freezes the GUI for some reason
This commit is contained in:
parent
20e8ddf673
commit
1f181f48db
|
@ -274,10 +274,15 @@ namespace BizHawk.Client.Common
|
|||
public void StartNewRecording()
|
||||
{
|
||||
SwitchToRecord();
|
||||
if (Global.Config.EnableBackupMovies && true/*TODO*/ && _records.Any())
|
||||
|
||||
// TODO: MakeBackup logic - Tastudio logic shoudl be to always make backups before saving!
|
||||
if (Global.Config.EnableBackupMovies && _records.Any() && !String.IsNullOrWhiteSpace(Filename))
|
||||
{
|
||||
// TODO
|
||||
Save();
|
||||
}
|
||||
|
||||
_records.Clear();
|
||||
Header.Clear();
|
||||
}
|
||||
|
||||
public bool Load()
|
||||
|
|
|
@ -146,11 +146,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
//
|
||||
// NewTASMenuItem
|
||||
//
|
||||
this.NewTASMenuItem.Enabled = false;
|
||||
this.NewTASMenuItem.Name = "NewTASMenuItem";
|
||||
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.Text = "&New";
|
||||
this.NewTASMenuItem.Click += new System.EventHandler(this.NewTASMenuItem_Click);
|
||||
//
|
||||
// OpenTASMenuItem
|
||||
//
|
||||
|
@ -190,7 +190,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
// toolStripSeparator3
|
||||
//
|
||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(149, 6);
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(57, 6);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
|
|
|
@ -138,10 +138,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
GlobalWin.OSD.AddMessage("TAStudio engaged");
|
||||
Global.MovieSession.Movie = new TasMovie();
|
||||
_tas = Global.MovieSession.Movie as TasMovie;
|
||||
_tas.StartNewRecording();
|
||||
_tas.OnChanged += OnMovieChanged;
|
||||
EngageTasStudio();
|
||||
|
||||
LoadConfigSettings();
|
||||
|
||||
|
@ -149,6 +146,26 @@ namespace BizHawk.Client.EmuHawk
|
|||
SetUpColumns();
|
||||
}
|
||||
|
||||
private void EngageTasStudio()
|
||||
{
|
||||
GlobalWin.OSD.AddMessage("TAStudio engaged");
|
||||
Global.MovieSession.Movie = new TasMovie();
|
||||
_tas = Global.MovieSession.Movie as TasMovie;
|
||||
_tas.StartNewRecording();
|
||||
_tas.OnChanged += OnMovieChanged;
|
||||
}
|
||||
|
||||
private void StartNewSession()
|
||||
{
|
||||
if (AskSave())
|
||||
{
|
||||
// TODO: power-cycle
|
||||
// TODO: UI flow that conveniently allows to start from savestate
|
||||
GlobalWin.OSD.AddMessage("new TAStudio session started");
|
||||
_tas.StartNewRecording();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMovieChanged(object sender, MovieRecord.InputEventArgs e)
|
||||
{
|
||||
//TODO: move logic needs to go here
|
||||
|
@ -247,6 +264,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
);
|
||||
}
|
||||
|
||||
private void NewTASMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
StartNewSession();
|
||||
}
|
||||
|
||||
|
||||
private void OpenTASMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var file = ToolHelpers.GetTasProjFileFromUser(_tas.Filename);
|
||||
|
@ -268,7 +291,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private void SaveAsTASMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var file = ToolHelpers.GetTasProjSaveFileFromUser(_tas.Filename);
|
||||
if (DialogResult != null)
|
||||
if (file != null)
|
||||
{
|
||||
_tas.Filename = file.FullName;
|
||||
_tas.Save();
|
||||
|
|
Loading…
Reference in New Issue