aboutsummaryrefslogtreecommitdiff
path: root/engines/dialogs.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2012-06-10 05:04:59 +0200
committerJohannes Schickel2012-06-10 05:04:59 +0200
commit49fafb48a7f089c97ed3baa9aefe65ec56dce682 (patch)
tree1e9ce4431017539cc4ecf519869f29cd394bd3f9 /engines/dialogs.cpp
parent7c5cf1b400808865a5f601f70d624ad6704a0c8c (diff)
downloadscummvm-rg350-49fafb48a7f089c97ed3baa9aefe65ec56dce682.tar.gz
scummvm-rg350-49fafb48a7f089c97ed3baa9aefe65ec56dce682.tar.bz2
scummvm-rg350-49fafb48a7f089c97ed3baa9aefe65ec56dce682.zip
GUI: Refactor default savegame description creation.
Formerly the GMM, AGI and SCI duplicated the logic for USE_SAVEGAME_TIMESTAMP. Now I added a method to SaveLoadChooser instead, which takes care of this. This might not be the best placement of such a functionality, thus I added a TODO which talks about moving it to a better place.
Diffstat (limited to 'engines/dialogs.cpp')
-rw-r--r--engines/dialogs.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp
index 9245d9fe62..cf3dfaa44b 100644
--- a/engines/dialogs.cpp
+++ b/engines/dialogs.cpp
@@ -220,15 +220,7 @@ void MainMenuDialog::save() {
Common::String result(_saveDialog->getResultString());
if (result.empty()) {
// If the user was lazy and entered no save name, come up with a default name.
- #if defined(USE_SAVEGAME_TIMESTAMP)
- TimeDate curTime;
- g_system->getTimeAndDate(curTime);
- curTime.tm_year += 1900; // fixup year
- curTime.tm_mon++; // fixup month
- result = Common::String::format("%04d.%02d.%02d / %02d:%02d:%02d", curTime.tm_year, curTime.tm_mon, curTime.tm_mday, curTime.tm_hour, curTime.tm_min, curTime.tm_sec);
- #else
- result = Common::String::format("Save %d", slot + 1);
- #endif
+ result = _saveDialog->createDefaultSaveDescription(slot);
}
Common::Error status = _engine->saveGameState(slot, result);