respect GreenZoneSettings.txt even if greenzone is missing; fix ClientSettings.json loading (probably regressed in 42aa9d991dc3dde03234a15ddfdc2efdebf1c097?)

This commit is contained in:
CasualPokePlayer 2024-07-04 21:34:09 -07:00
parent a8b4e76c63
commit e48e6c69f2
2 changed files with 24 additions and 4 deletions

View File

@ -141,7 +141,7 @@ namespace BizHawk.Client.Common
}
});
ZwinderStateManagerSettings settings = new ZwinderStateManagerSettings();
var settings = new ZwinderStateManagerSettings();
bl.GetLump(BinaryStateLump.StateHistorySettings, abort: false, tr =>
{
var json = tr.ReadToEnd();
@ -155,11 +155,11 @@ namespace BizHawk.Client.Common
}
});
bl.GetLump(BinaryStateLump.StateHistory, abort: false, br =>
TasStateManager?.Dispose();
var hasHistory = bl.GetLump(BinaryStateLump.StateHistory, abort: false, br =>
{
try
{
TasStateManager?.Dispose();
TasStateManager = ZwinderStateManager.Create(br, settings, IsReserved);
}
catch
@ -173,6 +173,20 @@ namespace BizHawk.Client.Common
Session.PopupMessage("State history was corrupted, clearing and working with a fresh history.");
}
});
if (!hasHistory)
{
try
{
TasStateManager = new ZwinderStateManager(settings, IsReserved);
}
catch
{
TasStateManager = new ZwinderStateManager(
Session.Settings.DefaultTasStateManagerSettings,
IsReserved);
}
}
}
}
}

View File

@ -668,8 +668,14 @@ namespace BizHawk.Client.EmuHawk
}
else
{
var movie = MovieSession.Get(path, true);
var movie = MovieSession.Get(path, loadMovie: false);
// we can't load the movie yet, we need to set the callbacks first...
if (movie is ITasMovie pendingTasMovie)
{
SetTasMovieCallbacks(pendingTasMovie);
}
movie.Load();
var tasMovie = movie as ITasMovie ?? movie.ToTasMovie();
movieLoadSucceeded = LoadMovie(tasMovie);
}