Improve UX of loading a savestate from an older (or newer) version
This commit is contained in:
parent
c3e3ffbe27
commit
ee241dc626
|
@ -125,13 +125,27 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
public bool Load(string path)
|
||||
public bool Load(string path, IDialogParent dialogParent)
|
||||
{
|
||||
// try to detect binary first
|
||||
using var bl = ZipStateLoader.LoadAndDetect(path);
|
||||
if (bl is null) return false;
|
||||
var succeed = false;
|
||||
|
||||
if (!VersionInfo.DeveloperBuild)
|
||||
{
|
||||
bl.GetLump(BinaryStateLump.BizVersion, true, tr => succeed = tr.ReadLine() == VersionInfo.GetEmuVersion());
|
||||
if (!succeed)
|
||||
{
|
||||
var result = dialogParent.ModalMessageBox2(
|
||||
"This savestate was made with a different version, so it's unlikely to work.\nChoose OK to try loading it anyway.",
|
||||
"Savestate version mismatch",
|
||||
EMsgBoxIcon.Question,
|
||||
useOKCancel: true);
|
||||
if (!result) return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Movie timeline check must happen before the core state is loaded
|
||||
if (_movieSession.Movie.IsActive())
|
||||
{
|
||||
|
|
|
@ -4176,7 +4176,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return;
|
||||
}
|
||||
|
||||
if (new SavestateFile(Emulator, MovieSession, QuickBmpFile, MovieSession.UserBag).Load(path))
|
||||
if (new SavestateFile(Emulator, MovieSession, QuickBmpFile, MovieSession.UserBag).Load(path, this))
|
||||
{
|
||||
OSD.ClearGuiText();
|
||||
EmuClient.OnStateLoaded(this, userFriendlyStateName);
|
||||
|
|
Loading…
Reference in New Issue