diff options
author | Eric Fry | 2018-04-18 07:04:47 +1000 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | 783fd028937d1b5c16d945db4dbed3ba8ca307b2 (patch) | |
tree | d26b94691b2ebf7ccb23d55e4c38d6befb8bcd9e /engines/illusions/menusystem.cpp | |
parent | 95d6171b56eba42a86dad2a7e65341760cf10001 (diff) | |
download | scummvm-rg350-783fd028937d1b5c16d945db4dbed3ba8ca307b2.tar.gz scummvm-rg350-783fd028937d1b5c16d945db4dbed3ba8ca307b2.tar.bz2 scummvm-rg350-783fd028937d1b5c16d945db4dbed3ba8ca307b2.zip |
Work on save support
Diffstat (limited to 'engines/illusions/menusystem.cpp')
-rw-r--r-- | engines/illusions/menusystem.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/engines/illusions/menusystem.cpp b/engines/illusions/menusystem.cpp index 829756cf2f..4fb0f18834 100644 --- a/engines/illusions/menusystem.cpp +++ b/engines/illusions/menusystem.cpp @@ -621,4 +621,28 @@ void MenuActionLoadGame::execute() { } +// MenuActionSaveGame + + MenuActionSaveGame::MenuActionSaveGame(BaseMenuSystem *menuSystem, uint choiceIndex) + : BaseMenuAction(menuSystem), _choiceIndex(choiceIndex) { + } + + void MenuActionSaveGame::execute() { + const Plugin *plugin = NULL; + EngineMan.findGame(ConfMan.get("gameid"), &plugin); + GUI::SaveLoadChooser *dialog; + Common::String desc; + int slot; + + dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true); + slot = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); + + delete dialog; + + if (slot >= 0) { + _menuSystem->setSavegameSlotNum(slot); + _menuSystem->selectMenuChoiceIndex(_choiceIndex); + } + _menuSystem->closeMenu(); + } } // End of namespace Illusions |