ENGINES: Display a GUI error message when loading / saving failed

This commit is contained in:
Bastien Bouclet 2020-02-05 14:25:56 +01:00 committed by Filippos Karapetis
parent 602600b944
commit 35e0b72c21

View File

@ -703,10 +703,17 @@ bool Engine::loadGameDialog() {
pauseEngine(false);
delete dialog;
if (slotNum != -1)
return loadGameState(slotNum).getCode() == Common::kNoError;
if (slotNum < 0)
return false;
return false;
Common::Error loadError = loadGameState(slotNum);
if (loadError.getCode() != Common::kNoError) {
GUI::MessageDialog errorDialog(loadError.getDesc());
errorDialog.runModal();
return false;
}
return true;
}
bool Engine::saveGameDialog() {
@ -726,10 +733,17 @@ bool Engine::saveGameDialog() {
delete dialog;
if (slotNum != -1)
return saveGameState(slotNum, desc).getCode() == Common::kNoError;
if (slotNum < 0)
return false;
return false;
Common::Error saveError = saveGameState(slotNum, desc);
if (saveError.getCode() != Common::kNoError) {
GUI::MessageDialog errorDialog(saveError.getDesc());
errorDialog.runModal();
return false;
}
return true;
}
void Engine::quitGame() {