aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarisa-Chan2014-11-08 13:04:27 +0600
committerMarisa-Chan2014-11-08 13:04:27 +0600
commit19e2251a7562defc560a25dd4655ededad4d5369 (patch)
tree28226d00f337dd2b423595dad1241a8eba0abb37
parent44eeb4027250a2989a9e34a303383fa8533a7a84 (diff)
downloadscummvm-rg350-19e2251a7562defc560a25dd4655ededad4d5369.tar.gz
scummvm-rg350-19e2251a7562defc560a25dd4655ededad4d5369.tar.bz2
scummvm-rg350-19e2251a7562defc560a25dd4655ededad4d5369.zip
ZVISION: Implement action:preferences
-rw-r--r--engines/zvision/scripting/actions.cpp21
-rw-r--r--engines/zvision/scripting/actions.h9
-rw-r--r--engines/zvision/scripting/scr_file_handling.cpp2
3 files changed, 31 insertions, 1 deletions
diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp
index fbf887f779..1e1b3b2862 100644
--- a/engines/zvision/scripting/actions.cpp
+++ b/engines/zvision/scripting/actions.cpp
@@ -474,6 +474,27 @@ bool ActionPanTrack::execute() {
}
//////////////////////////////////////////////////////////////////////////////
+// ActionPreferences
+//////////////////////////////////////////////////////////////////////////////
+
+ActionPreferences::ActionPreferences(ZVision *engine, int32 slotkey, const Common::String &line) :
+ ResultAction(engine, slotkey) {
+ if (line.compareToIgnoreCase("save") == 0)
+ _save = true;
+ else
+ _save = false;
+}
+
+bool ActionPreferences::execute() {
+ if (_save)
+ _engine->saveSettings();
+ else
+ _engine->loadSettings();
+
+ return true;
+}
+
+//////////////////////////////////////////////////////////////////////////////
// ActionPreloadAnimation
//////////////////////////////////////////////////////////////////////////////
diff --git a/engines/zvision/scripting/actions.h b/engines/zvision/scripting/actions.h
index fed620926d..dd771c1078 100644
--- a/engines/zvision/scripting/actions.h
+++ b/engines/zvision/scripting/actions.h
@@ -334,6 +334,15 @@ private:
int32 _framerate;
};
+class ActionPreferences : public ResultAction {
+public:
+ ActionPreferences(ZVision *engine, int32 slotkey, const Common::String &line);
+ bool execute();
+
+private:
+ bool _save;
+};
+
class ActionQuit : public ResultAction {
public:
ActionQuit(ZVision *engine, int32 slotkey) : ResultAction(engine, slotkey) {}
diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp
index ca92890b19..06354feaae 100644
--- a/engines/zvision/scripting/scr_file_handling.cpp
+++ b/engines/zvision/scripting/scr_file_handling.cpp
@@ -260,7 +260,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis
} else if (act.matchString("playpreload", true)) {
actionList.push_back(new ActionPlayPreloadAnimation(_engine, slot, args));
} else if (act.matchString("preferences", true)) {
- // TODO: Implement ActionPreferences
+ actionList.push_back(new ActionPreferences(_engine, slot, args));
} else if (act.matchString("quit", true)) {
actionList.push_back(new ActionQuit(_engine, slot));
} else if (act.matchString("random", true)) {