aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/saveload.cpp9
-rw-r--r--gui/saveload.h7
2 files changed, 16 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);
diff --git a/gui/saveload.h b/gui/saveload.h
index e6fea0fb52..dc0f0429c7 100644
--- a/gui/saveload.h
+++ b/gui/saveload.h
@@ -67,6 +67,13 @@ public:
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
void setList(const StringArray& list);
+ /**
+ * Runs the save/load chooser with the currently active config manager
+ * domain as target.
+ *
+ * @return The selcted save slot. -1 in case none is selected.
+ */
+ int runModalWithCurrentTarget();
int runModalWithPluginAndTarget(const EnginePlugin *plugin, const String &target);
void open();