Tastudio - simplify movie loading stuff
This commit is contained in:
parent
4e3aa0eb15
commit
56cc1fefff
|
@ -123,7 +123,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (AskSaveChanges())
|
if (AskSaveChanges())
|
||||||
{
|
{
|
||||||
WantsToControlStopMovie = false;
|
WantsToControlStopMovie = false;
|
||||||
StartNewMovieWrapper(false);
|
StartNewMovieWrapper(CurrentTasMovie);
|
||||||
WantsToControlStopMovie = true;
|
WantsToControlStopMovie = true;
|
||||||
RefreshDialog();
|
RefreshDialog();
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
MainForm.StartNewMovie(MovieService.Get(ofd.FileName), false);
|
MainForm.StartNewMovie(MovieService.Get(ofd.FileName), false);
|
||||||
ConvertCurrentMovieToTasproj();
|
ConvertCurrentMovieToTasproj();
|
||||||
_initialized = false;
|
_initialized = false;
|
||||||
StartNewMovieWrapper(false);
|
StartNewMovieWrapper(CurrentTasMovie);
|
||||||
SetUpColumns();
|
SetUpColumns();
|
||||||
SetTextProperty();
|
SetTextProperty();
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,10 +325,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (MovieSession.Movie.IsActive() && !(MovieSession.Movie is TasMovie))
|
if (MovieSession.Movie.IsActive() && !(MovieSession.Movie is TasMovie))
|
||||||
{
|
{
|
||||||
var result = MessageBox.Show("In order to use Tastudio, a new project must be created from the current movie\nThe current movie will be saved and closed, and a new project file will be created\nProceed?", "Convert movie", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
|
var result = MessageBox.Show("In order to use Tastudio, a new project must be created from the current movie\nThe current movie will be saved and closed, and a new project file will be created\nProceed?", "Convert movie", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
|
||||||
if (result == DialogResult.OK)
|
if (result.IsOk())
|
||||||
{
|
{
|
||||||
ConvertCurrentMovieToTasproj();
|
ConvertCurrentMovieToTasproj();
|
||||||
StartNewMovieWrapper(false);
|
StartNewMovieWrapper(CurrentTasMovie);
|
||||||
SetUpColumns();
|
SetUpColumns();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -705,7 +705,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
MovieSession.Movie = tasMovie;
|
MovieSession.Movie = tasMovie;
|
||||||
|
|
||||||
if (HandleMovieLoadStuff())
|
if (HandleMovieLoadStuff(tasMovie))
|
||||||
{
|
{
|
||||||
CurrentTasMovie.TasStateManager.Capture(); // Capture frame 0 always.
|
CurrentTasMovie.TasStateManager.Capture(); // Capture frame 0 always.
|
||||||
}
|
}
|
||||||
|
@ -720,22 +720,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
MarkerControl.Restart();
|
MarkerControl.Restart();
|
||||||
SetUpColumns();
|
SetUpColumns();
|
||||||
RefreshDialog();
|
RefreshDialog();
|
||||||
|
TasView.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool HandleMovieLoadStuff(TasMovie movie = null)
|
private bool HandleMovieLoadStuff(TasMovie movie)
|
||||||
{
|
{
|
||||||
bool result;
|
|
||||||
WantsToControlStopMovie = false;
|
WantsToControlStopMovie = false;
|
||||||
|
var result = StartNewMovieWrapper(movie);
|
||||||
if (movie == null)
|
|
||||||
{
|
|
||||||
movie = CurrentTasMovie;
|
|
||||||
result = StartNewMovieWrapper(movie.InputLogLength == 0, movie);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = StartNewMovieWrapper(false, movie);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
|
@ -753,15 +744,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool StartNewMovieWrapper(bool record, IMovie movie = null)
|
private bool StartNewMovieWrapper(TasMovie movie)
|
||||||
{
|
{
|
||||||
_initializing = true;
|
_initializing = true;
|
||||||
|
|
||||||
movie ??= CurrentTasMovie;
|
SetTasMovieCallbacks(movie);
|
||||||
|
|
||||||
SetTasMovieCallbacks(movie as TasMovie);
|
|
||||||
|
|
||||||
bool result = MainForm.StartNewMovie(movie, record);
|
bool result = MainForm.StartNewMovie(movie, false);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
CurrentTasMovie.TasStateManager.Capture(); // Capture frame 0 always.
|
CurrentTasMovie.TasStateManager.Capture(); // Capture frame 0 always.
|
||||||
|
|
Loading…
Reference in New Issue