added "multiple_actions" option for clickable global animations
[rocksndiamonds.git] / src / anim.c
index a38a1c3dca867fd5bc10cb0841aea26829c3dc87..81441829e8694ef2b0fb8f44b27cb8443fe45e9e 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()
@@ -1601,7 +1607,7 @@ static boolean InitGlobalAnim_Clicked(int mx, int my, boolean clicked)
     }
   }
 
-  return anything_clicked;
+  return (anything_clicked || any_event_action);
 }
 
 static void ResetGlobalAnim_Clickable()