aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/director/lingo/lingo-events.cpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index b65e752388..b9d901e64a 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -149,23 +149,30 @@ void Lingo::processInputEvent(LEvent event) {
Frame *currentFrame = score->_frames[score->getCurrentFrame()];
assert(currentFrame != nullptr);
uint16 spriteId = score->_currentMouseDownSpriteId;
- if (event == kEventMouseDown) {
- if (_vm->getVersion() > 3) {
- g_lingo->processEvent(kEventMouseDown, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
- g_lingo->processEvent(kEventMouseDown, kCastScript, currentFrame->_sprites[spriteId]->_castId);
- }
- // TODO: Unhandled in D<3?
- } else if (event == kEventMouseUp) {
- if (_vm->getVersion() > 3) {
- // TODO: check that this is the order of script execution!
- g_lingo->processEvent(kEventMouseUp, kCastScript, currentFrame->_sprites[spriteId]->_castId);
- g_lingo->processEvent(kEventMouseUp, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
- } else {
- // Frame script overrides sprite script
- if (!currentFrame->_sprites[spriteId]->_scriptId)
- g_lingo->processEvent(kEventNone, kSpriteScript, currentFrame->_sprites[spriteId]->_castId + 1024);
- else
- g_lingo->processEvent(kEventNone, kFrameScript, currentFrame->_sprites[spriteId]->_scriptId);
+
+ primaryEventHandler(event);
+
+ if (g_lingo->dontPassEvent) {
+ g_lingo->dontPassEvent = false;
+ } else {
+ if (event == kEventMouseDown) {
+ if (_vm->getVersion() > 3) {
+ g_lingo->processEvent(kEventMouseDown, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
+ g_lingo->processEvent(kEventMouseDown, kCastScript, currentFrame->_sprites[spriteId]->_castId);
+ }
+ // TODO: Unhandled in D<3?
+ } else if (event == kEventMouseUp) {
+ if (_vm->getVersion() > 3) {
+ // TODO: check that this is the order of script execution!
+ g_lingo->processEvent(kEventMouseUp, kCastScript, currentFrame->_sprites[spriteId]->_castId);
+ g_lingo->processEvent(kEventMouseUp, kSpriteScript, currentFrame->_sprites[spriteId]->_scriptId);
+ } else {
+ // Frame script overrides sprite script
+ if (!currentFrame->_sprites[spriteId]->_scriptId)
+ g_lingo->processEvent(kEventNone, kSpriteScript, currentFrame->_sprites[spriteId]->_castId + 1024);
+ else
+ g_lingo->processEvent(kEventNone, kFrameScript, currentFrame->_sprites[spriteId]->_scriptId);
+ }
}
}
}