[Scummvm-git-logs] scummvm master -> 35e0b72c21f01ccf246ddb7672f1b84045b5f5b5
bluegr
bluegr at gmail.com
Fri Feb 7 07:25:15 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
35e0b72c21 ENGINES: Display a GUI error message when loading / saving failed
Commit: 35e0b72c21f01ccf246ddb7672f1b84045b5f5b5
https://github.com/scummvm/scummvm/commit/35e0b72c21f01ccf246ddb7672f1b84045b5f5b5
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2020-02-07T09:25:11+02:00
Commit Message:
ENGINES: Display a GUI error message when loading / saving failed
Changed paths:
engines/engine.cpp
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 30b304f..7140bbf 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -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() {
More information about the Scummvm-git-logs
mailing list