From 7c5cf1b400808865a5f601f70d624ad6704a0c8c Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 10 Jun 2012 04:49:42 +0200 Subject: 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. --- engines/toon/toon.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'engines/toon') 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; -- cgit v1.2.3