Rip out the sync settings hack

This commit is contained in:
adelikat 2014-08-02 17:49:10 +00:00
parent bcd78cc4b8
commit 8799f27f60
2 changed files with 9 additions and 16 deletions

View File

@ -35,9 +35,6 @@ namespace BizHawk.Client.Common
get { return QueuedMovie != null; }
}
//TODO: this shouldn't be a hack anymore, the contents of this should be reliably in QueuedMovie
public object SyncSettingsHack { get; set; }
public MultitrackRecording MultiTrack { get { return _multiTrack; } }
public IMovieController MovieControllerAdapter{ get; set; }
@ -482,12 +479,6 @@ namespace BizHawk.Client.Common
}
}
var s = Global.MovieSession.Movie.SyncSettingsJson;
if (!string.IsNullOrWhiteSpace(s))
{
SyncSettingsHack = ConfigService.LoadWithType(s);
}
if (record) // This is a hack really, we need to set the movie to its propert state so that it will be considered active later
{
movie.SwitchToRecord();

View File

@ -1836,11 +1836,15 @@ namespace BizHawk.Client.EmuHawk
private void CoreSyncSettings(object sender, RomLoader.SettingsLoadArgs e)
{
// _syncSetting solely exists because of a bad and confusing workflow
// A movie is loaded, then load rom is called, which closes the current rom which closes the current movie (which is the movie just loaded)
// As such the movie is "inactive". So instead we load the movie and populate the _syncSettingsHack
// Then let the rom logic work its magic, then use it here, as such it will be null unless a movie invoked the load rom call
e.Settings = Global.MovieSession.SyncSettingsHack ?? Global.Config.GetCoreSyncSettings(e.Core);
if (Global.MovieSession.QueuedMovie != null)
{
e.Settings = ConfigService.LoadWithType(Global.MovieSession.QueuedMovie.SyncSettingsJson);
}
else
{
e.Settings = Global.Config.GetCoreSyncSettings(e.Core);
}
}
private static void CoreSettings(object sender, RomLoader.SettingsLoadArgs e)
@ -3022,8 +3026,6 @@ namespace BizHawk.Client.EmuHawk
private void ShowLoadError(object sender, RomLoader.RomErrorArgs e)
{
Global.MovieSession.SyncSettingsHack = null; // ensure subsequent calls to LoadRom won't get the settings object created here
if (e.Type == RomLoader.LoadErrorType.MissingFirmware)
{
var result = MessageBox.Show(