aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/core/project_item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/core/project_item.cpp')
-rw-r--r--engines/titanic/core/project_item.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 90e6d06ed1..7546f20936 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -189,10 +189,15 @@ void CProjectItem::saveGame(int slotId) {
Common::String::format("slot%d.gam", slotId));
file.open(saveFile);
+ // Signal the game is being saved
+ preSave();
+
// Save the contents out
saveData(&file, this);
+ // Close the file and signal that the saving has finished
file.close();
+ postSave();
}
void CProjectItem::clear() {
@@ -288,6 +293,16 @@ void CProjectItem::postLoad() {
petControl->postLoad();
}
+void CProjectItem::preSave() {
+ if (_gameManager)
+ _gameManager->preSave(this);
+}
+
+void CProjectItem::postSave() {
+ if (_gameManager)
+ _gameManager->postSave();
+}
+
CPetControl *CProjectItem::getPetControl() const {
CDontSaveFileItem *fileItem = getDontSaveFileItem();
CTreeItem *treeItem;