Skip to content

Commit

Permalink
ZVISION: Implement action:disable_venus and action:set_venus
Browse files Browse the repository at this point in the history
  • Loading branch information
Marisa-Chan committed Nov 8, 2014
1 parent d0f6b61 commit 7ddfcfd
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
32 changes: 32 additions & 0 deletions engines/zvision/scripting/actions.cpp
Expand Up @@ -188,6 +188,21 @@ bool ActionDisableControl::execute() {
return true;
}

//////////////////////////////////////////////////////////////////////////////
// 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
//////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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
//////////////////////////////////////////////////////////////////////////////
Expand Down
10 changes: 10 additions & 0 deletions engines/zvision/scripting/actions.h
Expand Up @@ -180,6 +180,7 @@ class ActionDisableVenus : public ResultAction {
bool execute();

private:
int32 _key;
};

class ActionDisplayMessage : public ResultAction {
Expand Down Expand Up @@ -392,6 +393,15 @@ class ActionSetScreen : public ResultAction {
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);
Expand Down
4 changes: 2 additions & 2 deletions engines/zvision/scripting/scr_file_handling.cpp
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 7ddfcfd

Please sign in to comment.