When loading a movie that specified quicknes or neshawk (or bsnes vs snes9x), don't permanently override the user's core preference

This commit is contained in:
adelikat 2014-11-09 17:14:16 +00:00
parent 150dcae98d
commit b0eb4ee791
2 changed files with 21 additions and 0 deletions

View File

@ -436,6 +436,11 @@ namespace BizHawk.Client.Common
} }
} }
// The behavior here is to only temporarily override these settings when playing a movie and then restore the user's preferred settings
// A more elegant approach would be appreciated
public bool? PreviousNES_InQuickNES = null;
public bool? PreviousSNES_InSnes9x = null;
public void QueueNewMovie(IMovie movie, bool record) public void QueueNewMovie(IMovie movie, bool record)
{ {
if (!record) // The semantics of record is that we are starting a new movie, and even wiping a pre-existing movie with the same path, but non-record means we are loading an existing movie into playback mode if (!record) // The semantics of record is that we are starting a new movie, and even wiping a pre-existing movie with the same path, but non-record means we are loading an existing movie into playback mode
@ -469,10 +474,12 @@ namespace BizHawk.Client.Common
// If either is specified use that, else use whatever is currently set // If either is specified use that, else use whatever is currently set
if (movie.Core == quicknesName) if (movie.Core == quicknesName)
{ {
PreviousNES_InQuickNES = Global.Config.NES_InQuickNES;
Global.Config.NES_InQuickNES = true; Global.Config.NES_InQuickNES = true;
} }
else if (movie.Core == neshawkName) else if (movie.Core == neshawkName)
{ {
PreviousNES_InQuickNES = Global.Config.NES_InQuickNES;
Global.Config.NES_InQuickNES = false; Global.Config.NES_InQuickNES = false;
} }
} }
@ -483,10 +490,12 @@ namespace BizHawk.Client.Common
if (movie.Core == snes9xName) if (movie.Core == snes9xName)
{ {
PreviousSNES_InSnes9x = Global.Config.SNES_InSnes9x;
Global.Config.SNES_InSnes9x = true; Global.Config.SNES_InSnes9x = true;
} }
else else
{ {
PreviousSNES_InSnes9x = Global.Config.SNES_InSnes9x;
Global.Config.SNES_InSnes9x = false; Global.Config.SNES_InSnes9x = false;
} }
} }

View File

@ -32,6 +32,18 @@ namespace BizHawk.Client.EmuHawk
LoadRom(GlobalWin.MainForm.CurrentlyOpenRom); LoadRom(GlobalWin.MainForm.CurrentlyOpenRom);
if (Global.MovieSession.PreviousNES_InQuickNES.HasValue)
{
Global.Config.NES_InQuickNES = Global.MovieSession.PreviousNES_InQuickNES.HasValue;
Global.MovieSession.PreviousNES_InQuickNES = null;
}
if (Global.MovieSession.PreviousSNES_InSnes9x.HasValue)
{
Global.Config.SNES_InSnes9x = Global.MovieSession.PreviousSNES_InSnes9x.HasValue;
Global.MovieSession.PreviousSNES_InSnes9x = null;
}
Global.Config.RecentMovies.Add(movie.Filename); Global.Config.RecentMovies.Add(movie.Filename);
if (movie.StartsFromSavestate) if (movie.StartsFromSavestate)