aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo
diff options
context:
space:
mode:
authorJohannes Schickel2012-06-10 04:49:42 +0200
committerJohannes Schickel2012-06-10 04:53:17 +0200
commit7c5cf1b400808865a5f601f70d624ad6704a0c8c (patch)
tree488862f566ac55bbadf84440115a12b91a213b5d /engines/hugo
parent9b05f4e1039ade7f2d0b774c18a6767113f2c848 (diff)
downloadscummvm-rg350-7c5cf1b400808865a5f601f70d624ad6704a0c8c.tar.gz
scummvm-rg350-7c5cf1b400808865a5f601f70d624ad6704a0c8c.tar.bz2
scummvm-rg350-7c5cf1b400808865a5f601f70d624ad6704a0c8c.zip
GUI: Add helper to SaveLoadChooser, which uses the currently active target.
This reduces the code duplication in all client code, which formerly duplicated the querying of the plugin, game id etc. and now simply calls the newly added method runModalWithCurrentTarget() on a SaveLoadChooser object.
Diffstat (limited to 'engines/hugo')
-rw-r--r--engines/hugo/file.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp
index 3c94b2ee3d..f94f3b0443 100644
--- a/engines/hugo/file.cpp
+++ b/engines/hugo/file.cpp
@@ -330,14 +330,12 @@ sound_pt FileManager::getSound(const int16 sound, uint16 *size) {
bool FileManager::saveGame(const int16 slot, const Common::String &descrip) {
debugC(1, kDebugFile, "saveGame(%d, %s)", slot, descrip.c_str());
- const EnginePlugin *plugin = NULL;
int16 savegameId;
Common::String savegameDescription;
- EngineMan.findGame(_vm->getGameId(), &plugin);
if (slot == -1) {
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save", true);
- savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
+ savegameId = dialog->runModalWithCurrentTarget();
savegameDescription = dialog->getResultString();
delete dialog;
} else {
@@ -435,13 +433,11 @@ bool FileManager::saveGame(const int16 slot, const Common::String &descrip) {
bool FileManager::restoreGame(const int16 slot) {
debugC(1, kDebugFile, "restoreGame(%d)", slot);
- const EnginePlugin *plugin = NULL;
int16 savegameId;
- EngineMan.findGame(_vm->getGameId(), &plugin);
if (slot == -1) {
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore", false);
- savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
+ savegameId = dialog->runModalWithCurrentTarget();
delete dialog;
} else {
savegameId = slot;