You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move stuff around to make more sense for ask-user-about-saving-or-canceling flow even though not all asking and error handling is implemented yet. Also, fix: respect the cancel button.
/// This closes the game but does not set things up for using the client with the new null emulator.
4086
4071
/// This method should only be called (outside of <see cref="CloseRom(bool)"/>) if the caller is about to load a new game with no user interaction between close and load.
4087
4072
/// </summary>
4088
-
privatevoidCloseGame(boolclearSram=false)
4073
+
/// <returns>True if the game was closed. False if the user cancelled due to unsaved changes.</returns>
4074
+
privateboolCloseGame(boolclearSram=false)
4089
4075
{
4076
+
CommitCoreSettingsToConfig();// Must happen before stopping the movie, since it checks for active movie.
4077
+
4078
+
if(!Tools.AskSave())
4079
+
{
4080
+
returnfalse;
4081
+
}
4082
+
// There is a cheats tool, but cheats can be active while the "cheats tool" is not. And have auto-save option.
$"Failed to auto-save state. Do you want to try again?\n\nError details:\n{stateSaveResult.UserFriendlyErrorMessage()}\n{stateSaveResult.Exception.Message}",
4125
4134
"IOError while writing savestate",
4126
4135
EMsgBoxIcon.Error);
4127
-
if(tryAgain==null)return;
4136
+
if(tryAgain==null)returnfalse;
4128
4137
}
4129
4138
}while(tryAgain==true);
4130
4139
4131
4140
StopAv();
4132
4141
4133
-
CommitCoreSettingsToConfig();
4134
4142
DisableRewind();
4135
4143
4136
-
if(MovieSession.Movie.IsActive())// Note: this must be called after CommitCoreSettingsToConfig() because it checks if we have an active movie.
0 commit comments