aboutsummaryrefslogtreecommitdiff
path: root/engines/dialogs.cpp
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/dialogs.cpp
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/dialogs.cpp')
-rw-r--r--engines/dialogs.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp
index 3fa01ddcbf..9245d9fe62 100644
--- a/engines/dialogs.cpp
+++ b/engines/dialogs.cpp
@@ -214,12 +214,7 @@ void MainMenuDialog::reflowLayout() {
}
void MainMenuDialog::save() {
- const Common::String gameId = ConfMan.get("gameid");
-
- const EnginePlugin *plugin = 0;
- EngineMan.findGame(gameId, &plugin);
-
- int slot = _saveDialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
+ int slot = _saveDialog->runModalWithCurrentTarget();
if (slot >= 0) {
Common::String result(_saveDialog->getResultString());
@@ -250,12 +245,7 @@ void MainMenuDialog::save() {
}
void MainMenuDialog::load() {
- const Common::String gameId = ConfMan.get("gameid");
-
- const EnginePlugin *plugin = 0;
- EngineMan.findGame(gameId, &plugin);
-
- int slot = _loadDialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
+ int slot = _loadDialog->runModalWithCurrentTarget();
_engine->setGameToLoadSlot(slot);