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/cge | |
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/cge')
-rw-r--r-- | engines/cge/events.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/engines/cge/events.cpp b/engines/cge/events.cpp index e903584100..095aac2412 100644 --- a/engines/cge/events.cpp +++ b/engines/cge/events.cpp @@ -70,11 +70,8 @@ bool Keyboard::getKey(Common::Event &event) { return false; case Common::KEYCODE_F5: if (_vm->canSaveGameStateCurrently()) { - const EnginePlugin *plugin = NULL; - EngineMan.findGame(_vm->_gameDescription->gameid, &plugin); - GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save", true); - int16 savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); + int16 savegameId = dialog->runModalWithCurrentTarget(); Common::String savegameDescription = dialog->getResultString(); delete dialog; @@ -84,11 +81,8 @@ bool Keyboard::getKey(Common::Event &event) { return false; case Common::KEYCODE_F7: if (_vm->canLoadGameStateCurrently()) { - const EnginePlugin *plugin = NULL; - EngineMan.findGame(_vm->_gameDescription->gameid, &plugin); - GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore", false); - int16 savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); + int16 savegameId = dialog->runModalWithCurrentTarget(); delete dialog; if (savegameId != -1) |