aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/zvision/script_manager.cpp28
-rw-r--r--engines/zvision/script_manager.h6
2 files changed, 19 insertions, 15 deletions
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<Control *>::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<Control *>::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);