aboutsummaryrefslogtreecommitdiff
path: root/engines/toon
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/toon
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/toon')
-rw-r--r--engines/toon/toon.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp
index 9da06ce5be..be298e1236 100644
--- a/engines/toon/toon.cpp
+++ b/engines/toon/toon.cpp
@@ -2955,14 +2955,12 @@ Common::String ToonEngine::getSavegameName(int nr) {
}
bool ToonEngine::saveGame(int32 slot, const Common::String &saveGameDesc) {
- const EnginePlugin *plugin = NULL;
int16 savegameId;
Common::String savegameDescription;
- EngineMan.findGame(_gameDescription->gameid, &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 {
@@ -3051,13 +3049,11 @@ bool ToonEngine::saveGame(int32 slot, const Common::String &saveGameDesc) {
}
bool ToonEngine::loadGame(int32 slot) {
- const EnginePlugin *plugin = NULL;
int16 savegameId;
- EngineMan.findGame(_gameDescription->gameid, &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;