added being able to generally set global animations to passthrough clicks
[rocksndiamonds.git] / src / anim.c
index a38a1c3dca867fd5bc10cb0841aea26829c3dc87..b6ee0b933cb1b12307578c73fe3b2b18eb705825 100644 (file)
@@ -1450,8 +1450,14 @@ static boolean DoGlobalAnim_EventAction(struct GlobalAnimPartControlInfo *part)
   if (anim_event_action == -1)
     return FALSE;
 
-  return (DoGadgetAction(anim_event_action) ||
-         DoScreenAction(anim_event_action));
+  boolean action_executed = (DoGadgetAction(anim_event_action) ||
+                            DoScreenAction(anim_event_action));
+
+  // check if further actions are allowed to be executed
+  if (part->control_info.style & STYLE_MULTIPLE_ACTIONS)
+    return FALSE;
+
+  return action_executed;
 }
 
 static void InitGlobalAnim_Clickable()
@@ -1537,7 +1543,8 @@ static boolean InitGlobalAnim_Clicked(int mx, int my, boolean clicked)
          if (!any_event_action && DoGlobalAnim_EventAction(part))
            any_event_action = TRUE;
 
-         any_part_clicked = TRUE;
+         // determine if mouse clicks should be blocked from other animations
+         any_part_clicked = clickConsumed(part);
 
          if (isClickablePart(part, ANIM_EVENT_SELF))
          {
@@ -1601,7 +1608,7 @@ static boolean InitGlobalAnim_Clicked(int mx, int my, boolean clicked)
     }
   }
 
-  return anything_clicked;
+  return (anything_clicked || any_event_action);
 }
 
 static void ResetGlobalAnim_Clickable()