diff options
author | Marisa-Chan | 2014-11-08 12:44:00 +0600 |
---|---|---|
committer | Marisa-Chan | 2014-11-08 12:44:00 +0600 |
commit | 7ddfcfd17ec1e367896c223d5b8dc59b44d4029e (patch) | |
tree | 5b463c19667045fd5f64bf815a11d0a72ab54bdd /engines/zvision/scripting | |
parent | d0f6b61d7d86598c71c7ff8679f610bbd1341aaa (diff) | |
download | scummvm-rg350-7ddfcfd17ec1e367896c223d5b8dc59b44d4029e.tar.gz scummvm-rg350-7ddfcfd17ec1e367896c223d5b8dc59b44d4029e.tar.bz2 scummvm-rg350-7ddfcfd17ec1e367896c223d5b8dc59b44d4029e.zip |
ZVISION: Implement action:disable_venus and action:set_venus
Diffstat (limited to 'engines/zvision/scripting')
-rw-r--r-- | engines/zvision/scripting/actions.cpp | 32 | ||||
-rw-r--r-- | engines/zvision/scripting/actions.h | 10 | ||||
-rw-r--r-- | engines/zvision/scripting/scr_file_handling.cpp | 4 |
3 files changed, 44 insertions, 2 deletions
diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp index 3763eb6e30..33add9f8fa 100644 --- a/engines/zvision/scripting/actions.cpp +++ b/engines/zvision/scripting/actions.cpp @@ -189,6 +189,21 @@ bool ActionDisableControl::execute() { } ////////////////////////////////////////////////////////////////////////////// +// ActionDisableVenus +////////////////////////////////////////////////////////////////////////////// + +ActionDisableVenus::ActionDisableVenus(ZVision *engine, int32 slotkey, const Common::String &line) : + ResultAction(engine, slotkey) { + sscanf(line.c_str(), "%d", &_key); +} + +bool ActionDisableVenus::execute() { + _engine->getScriptManager()->setStateValue(_key, 0); + + return true; +} + +////////////////////////////////////////////////////////////////////////////// // ActionDisplayMessage ////////////////////////////////////////////////////////////////////////////// @@ -715,6 +730,23 @@ bool ActionSetScreen::execute() { return true; } + +////////////////////////////////////////////////////////////////////////////// +// ActionSetVenus +////////////////////////////////////////////////////////////////////////////// + +ActionSetVenus::ActionSetVenus(ZVision *engine, int32 slotkey, const Common::String &line) : + ResultAction(engine, slotkey) { + sscanf(line.c_str(), "%d", &_key); +} + +bool ActionSetVenus::execute() { + if (_engine->getScriptManager()->getStateValue(_key)) + _engine->getScriptManager()->setStateValue(StateKey_Venus, _key); + + return true; +} + ////////////////////////////////////////////////////////////////////////////// // ActionStop ////////////////////////////////////////////////////////////////////////////// diff --git a/engines/zvision/scripting/actions.h b/engines/zvision/scripting/actions.h index ade57ba14c..b80af9a6c5 100644 --- a/engines/zvision/scripting/actions.h +++ b/engines/zvision/scripting/actions.h @@ -180,6 +180,7 @@ public: bool execute(); private: + int32 _key; }; class ActionDisplayMessage : public ResultAction { @@ -392,6 +393,15 @@ private: Common::String _fileName; }; +class ActionSetVenus : public ResultAction { +public: + ActionSetVenus(ZVision *engine, int32 slotkey, const Common::String &line); + bool execute(); + +private: + int32 _key; +}; + class ActionStop : public ResultAction { public: ActionStop(ZVision *engine, int32 slotkey, const Common::String &line); diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp index 68840aa413..c7268e6111 100644 --- a/engines/zvision/scripting/scr_file_handling.cpp +++ b/engines/zvision/scripting/scr_file_handling.cpp @@ -236,7 +236,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis } else if (act.matchString("disable_control", true)) { actionList.push_back(new ActionDisableControl(_engine, slot, args)); } else if (act.matchString("disable_venus", true)) { - // TODO: Implement ActionDisableVenus + actionList.push_back(new ActionDisableVenus(_engine, slot, args)); } else if (act.matchString("display_message", true)) { actionList.push_back(new ActionDisplayMessage(_engine, slot, args)); } else if (act.matchString("dissolve", true)) { @@ -278,7 +278,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis } else if (act.matchString("set_screen", true)) { actionList.push_back(new ActionSetScreen(_engine, slot, args)); } else if (act.matchString("set_venus", true)) { - // TODO: Implement ActionSetVenus + actionList.push_back(new ActionSetVenus(_engine, slot, args)); } else if (act.matchString("stop", true)) { actionList.push_back(new ActionStop(_engine, slot, args)); } else if (act.matchString("streamvideo", true)) { |