* Fix #3417 and improve handling of default.tasproj * expose SetMovieController in the MovieSession interface (please don't rely on it anywhere else) * don't use this explicit public in the interface (is this mentioned anywhere? i assume this is proper style) * use this helper function
This commit is contained in:
parent
10a38270e5
commit
9393e1b764
|
@ -62,6 +62,11 @@ namespace BizHawk.Client.Common
|
|||
return new Bk2Controller("", definition ?? MovieController.Definition);
|
||||
}
|
||||
|
||||
public void SetMovieController(ControllerDefinition definition)
|
||||
{
|
||||
MovieController = GenerateMovieController(definition);
|
||||
}
|
||||
|
||||
public void HandleFrameBefore()
|
||||
{
|
||||
if (Movie.NotActive())
|
||||
|
|
|
@ -54,6 +54,17 @@ namespace BizHawk.Client.Common
|
|||
/// </summary>
|
||||
IMovieController GenerateMovieController(ControllerDefinition definition = null);
|
||||
|
||||
/// <summary>
|
||||
/// Hack only used for TAStudio when starting a new movie
|
||||
/// This is due to needing to save a "dummy" default.tasproj
|
||||
/// This dummy file's initial save bypasses the normal queue/run
|
||||
/// new movie code (which normally sets the controller), although
|
||||
/// once it saves it goes through the normal queue/run code anyway.
|
||||
/// TODO: Stop relying on this dummy file so we do not need this ugly hack
|
||||
/// </summary>
|
||||
/// <param name="definition">current IEmulator ControllerDefinition</param>
|
||||
void SetMovieController(ControllerDefinition definition);
|
||||
|
||||
void HandleFrameBefore();
|
||||
void HandleFrameAfter();
|
||||
void HandleSaveState(TextWriter writer);
|
||||
|
|
|
@ -602,11 +602,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
Config.DefaultAuthor);
|
||||
|
||||
SetTasMovieCallbacks(tasMovie);
|
||||
MovieSession.SetMovieController(Emulator.ControllerDefinition); // hack, see interface comment
|
||||
tasMovie.ClearChanges(); // Don't ask to save changes here.
|
||||
tasMovie.Save();
|
||||
if (HandleMovieLoadStuff(tasMovie))
|
||||
{
|
||||
}
|
||||
// let's not keep this longer than we actually need
|
||||
// the user will be prompted to enter a proper name
|
||||
// when they want to save
|
||||
File.Delete(tasMovie.Filename);
|
||||
|
||||
// clear all selections
|
||||
TasView.DeselectAll();
|
||||
|
@ -780,11 +785,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
filename = SuggestedTasProjName();
|
||||
}
|
||||
|
||||
var file = SaveFileDialog(
|
||||
currentFile: filename,
|
||||
path: Config!.PathEntries.MovieAbsolutePath(),
|
||||
TAStudioProjectsFSFilterSet,
|
||||
this);
|
||||
FileInfo file;
|
||||
do
|
||||
{
|
||||
file = SaveFileDialog(
|
||||
currentFile: filename,
|
||||
path: Config!.PathEntries.MovieAbsolutePath(),
|
||||
TAStudioProjectsFSFilterSet,
|
||||
this);
|
||||
}
|
||||
while (file?.FullName == DefaultTasProjName()); // disallow saving as this reserved filename
|
||||
|
||||
if (file != null)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue