diff options
author | Johannes Schickel | 2012-06-10 04:49:42 +0200 |
---|---|---|
committer | Johannes Schickel | 2012-06-10 04:53:17 +0200 |
commit | 7c5cf1b400808865a5f601f70d624ad6704a0c8c (patch) | |
tree | 488862f566ac55bbadf84440115a12b91a213b5d /engines/dreamweb | |
parent | 9b05f4e1039ade7f2d0b774c18a6767113f2c848 (diff) | |
download | scummvm-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/dreamweb')
-rw-r--r-- | engines/dreamweb/saveload.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp index e659c03e13..ea9cdc0249 100644 --- a/engines/dreamweb/saveload.cpp +++ b/engines/dreamweb/saveload.cpp @@ -158,11 +158,8 @@ void DreamWebEngine::doLoad(int savegameId) { if (savegameId == -1) { // Open dialog to get savegameId - const EnginePlugin *plugin = NULL; - Common::String gameId = ConfMan.get("gameid"); - EngineMan.findGame(gameId, &plugin); GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false); - savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); + savegameId = dialog->runModalWithCurrentTarget(); delete dialog; } @@ -244,11 +241,8 @@ void DreamWebEngine::saveGame() { } return; } else { - const EnginePlugin *plugin = NULL; - Common::String gameId = ConfMan.get("gameid"); - EngineMan.findGame(gameId, &plugin); GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true); - int savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); + int savegameId = dialog->runModalWithCurrentTarget(); Common::String game_description = dialog->getResultString(); if (game_description.empty()) game_description = "Untitled"; |