From b66700212479bb05ce1367a43fe6341cdfca1b00 Mon Sep 17 00:00:00 2001 From: richiesams Date: Mon, 26 Aug 2013 14:10:37 -0500 Subject: ZVISION: Update ScriptManager::enableControl()/disableControl() to fit new Control syntax --- engines/zvision/script_manager.cpp | 28 ++++++++++++++++------------ engines/zvision/script_manager.h | 6 +++--- 2 files changed, 19 insertions(+), 15 deletions(-) (limited to 'engines') diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp index 50d7e58091..dcfcf02048 100644 --- a/engines/zvision/script_manager.cpp +++ b/engines/zvision/script_manager.cpp @@ -212,24 +212,28 @@ void ScriptManager::addToStateValue(uint32 key, uint valueToAdd) { _globalState[key] += valueToAdd; } -bool ScriptManager::enableControl(uint32 key) { - if (!_activeControls.contains(key)) { - return false; - } else { - return _activeControls[key]->enable(); +void ScriptManager::addControl(Control *control) { + _activeControls.push_back(control); +} + +void ScriptManager::enableControl(uint32 key) { + for (Common::List::iterator iter = _activeControls.begin(); iter != _activeControls.end(); iter++) { + if ((*iter)->getKey() == key) { + (*iter)->enable(); + break; + } } } -bool ScriptManager::disableControl(uint32 key) { - if (!_activeControls.contains(key)) { - return false; - } else { - return _activeControls[key]->disable(); +void ScriptManager::disableControl(uint32 key) { + for (Common::List::iterator iter = _activeControls.begin(); iter != _activeControls.end(); iter++) { + if ((*iter)->getKey() == key) { + (*iter)->disable(); + break; + } } } -void ScriptManager::addActionNode(ActionNode *node) { - _activeNodes.push_back(node); } void ScriptManager::changeLocation(char world, char room, char node, char view, uint32 offset) { diff --git a/engines/zvision/script_manager.h b/engines/zvision/script_manager.h index 28bce07dc8..27e2e61238 100644 --- a/engines/zvision/script_manager.h +++ b/engines/zvision/script_manager.h @@ -85,10 +85,10 @@ public: void setStateValue(uint32 key, uint value); void addToStateValue(uint32 key, uint valueToAdd); - bool enableControl(uint32 key); - bool disableControl(uint32 key); + void addControl(Control *control); - void addActionNode(ActionNode *node); + void enableControl(uint32 key); + void disableControl(uint32 key); void changeLocation(char world, char room, char node, char view, uint32 offset); -- cgit v1.2.3