[Scummvm-git-logs] scummvm master -> 6160f3842c96f5548c228c18a55ff5a5a79e02db
dreammaster
dreammaster at scummvm.org
Sun Jan 28 03:55:34 CET 2018
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ac7ec1febe XEEN: Hopeful compilation fix
6160f3842c XEEN: Implement save manager save/load methods
Commit: ac7ec1febea7b1960f580b3c49c0f5627400ee79
https://github.com/scummvm/scummvm/commit/ac7ec1febea7b1960f580b3c49c0f5627400ee79
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-01-27T21:54:39-05:00
Commit Message:
XEEN: Hopeful compilation fix
Changed paths:
engines/xeen/dialogs.h
diff --git a/engines/xeen/dialogs.h b/engines/xeen/dialogs.h
index 536bd27..6117fbd 100644
--- a/engines/xeen/dialogs.h
+++ b/engines/xeen/dialogs.h
@@ -92,9 +92,15 @@ public:
void restoreButtons();
void addButton(const Common::Rect &bounds, int val,
- SpriteResource *sprites = nullptr);
+ SpriteResource *sprites);
void addButton(const Common::Rect &bounds, int val,
- uint frameNum, SpriteResource *sprites = nullptr);
+ uint frameNum, SpriteResource *sprites);
+ void addButton(const Common::Rect &bounds, int val) {
+ addButton(bounds, val, nullptr);
+ }
+ void addButton(const Common::Rect &bounds, int val, uint frameNum) {
+ addButton(bounds, val, frameNum, nullptr);
+ }
void addPartyButtons(XeenEngine *vm);
Commit: 6160f3842c96f5548c228c18a55ff5a5a79e02db
https://github.com/scummvm/scummvm/commit/6160f3842c96f5548c228c18a55ff5a5a79e02db
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-01-27T21:55:26-05:00
Commit Message:
XEEN: Implement save manager save/load methods
Changed paths:
engines/xeen/saves.cpp
diff --git a/engines/xeen/saves.cpp b/engines/xeen/saves.cpp
index 46b2709..f94a0fa 100644
--- a/engines/xeen/saves.cpp
+++ b/engines/xeen/saves.cpp
@@ -24,8 +24,10 @@
#include "common/algorithm.h"
#include "common/memstream.h"
#include "common/substream.h"
+#include "common/translation.h"
#include "graphics/scaler.h"
#include "graphics/thumbnail.h"
+#include "gui/saveload.h"
#include "xeen/saves.h"
#include "xeen/files.h"
#include "xeen/xeen.h"
@@ -222,13 +224,32 @@ Common::String SavesManager::generateSaveName(int slot) {
}
bool SavesManager::loadGame() {
- // TODO
- return false;
+ if (!g_vm->canLoadGameStateCurrently())
+ return false;
+
+ GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load"), false);
+ int slotNum = dialog->runModalWithCurrentTarget();
+ delete dialog;
+
+ if (slotNum != -1)
+ loadGameState(slotNum);
+
+ return slotNum != -1;
}
bool SavesManager::saveGame() {
- // TODO
- return false;
+ if (!g_vm->canSaveGameStateCurrently())
+ return false;
+
+ GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
+ int slotNum = dialog->runModalWithCurrentTarget();
+ Common::String saveName = dialog->getResultString();
+ delete dialog;
+
+ if (slotNum)
+ saveGameState(slotNum, saveName);
+
+ return slotNum != -1;
}
} // End of namespace Xeen
More information about the Scummvm-git-logs
mailing list