aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_stack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mohawk/riven_stack.cpp')
-rw-r--r--engines/mohawk/riven_stack.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/engines/mohawk/riven_stack.cpp b/engines/mohawk/riven_stack.cpp
index c39464558c..6fa1b15ad5 100644
--- a/engines/mohawk/riven_stack.cpp
+++ b/engines/mohawk/riven_stack.cpp
@@ -36,7 +36,8 @@ namespace Mohawk {
RivenStack::RivenStack(MohawkEngine_Riven *vm, uint16 id) :
_vm(vm),
- _id(id) {
+ _id(id),
+ _mouseIsDown(false) {
loadResourceNames();
loadCardIdMap();
setCurrentStackVariable();
@@ -223,6 +224,46 @@ void RivenStack::installCardTimer() {
}
+void RivenStack::onMouseDown(const Common::Point &mouse) {
+ _mouseIsDown = true;
+ _mousePosition = mouse;
+
+ if (_vm->getCard() && !_vm->_scriptMan->hasQueuedScripts()) {
+ _mouseDragStartPosition = mouse;
+
+ RivenScriptPtr script = _vm->getCard()->onMouseDown(mouse);
+
+ if (!script->empty()) {
+ _vm->_scriptMan->runScript(script, false);
+ }
+ }
+}
+
+void RivenStack::onMouseUp(const Common::Point &mouse) {
+ _mouseIsDown = false;
+ _mousePosition = mouse;
+
+ if (_vm->getCard() && !_vm->_scriptMan->hasQueuedScripts()) {
+ RivenScriptPtr script = _vm->getCard()->onMouseUp(mouse);
+
+ if (!script->empty()) {
+ _vm->_scriptMan->runScript(script, false);
+ }
+ }
+}
+
+void RivenStack::onMouseMove(const Common::Point &mouse) {
+ _mousePosition = mouse;
+
+ if (_vm->getCard() && !_vm->_scriptMan->hasQueuedScripts()) {
+ RivenScriptPtr script = _vm->getCard()->onMouseMove(mouse);
+
+ if (!script->empty()) {
+ _vm->_scriptMan->runScript(script, false);
+ }
+ }
+}
+
RivenNameList::RivenNameList() {
}