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 /gui/saveload.cpp | |
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 'gui/saveload.cpp')
-rw-r--r-- | gui/saveload.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gui/saveload.cpp b/gui/saveload.cpp index c7da94357f..366efa7a90 100644 --- a/gui/saveload.cpp +++ b/gui/saveload.cpp @@ -76,6 +76,15 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel, SaveLoadChooser::~SaveLoadChooser() { } +int SaveLoadChooser::runModalWithCurrentTarget() { + const Common::String gameId = ConfMan.get("gameid"); + + const EnginePlugin *plugin = 0; + EngineMan.findGame(gameId, &plugin); + + return runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); +} + int SaveLoadChooser::runModalWithPluginAndTarget(const EnginePlugin *plugin, const String &target) { if (_gfxWidget) _gfxWidget->setGfx(0); |