added event actions (by triggering gadgets) for global animations
[rocksndiamonds.git] / src / libgame / gadgets.c
index c793ce13c599ecc2adb7050d98fcf9f7165d9796..6a3a9ac2145d786483a7251a566b31f65086d97c 100644 (file)
@@ -2286,3 +2286,20 @@ void DumpGadgetIdentifiers()
 
   printf("Done.\n");
 }
+
+boolean DoGadgetAction(int image_id)
+{
+  struct GadgetInfo *gi;
+
+  for (gi = gadget_list_first_entry; gi != NULL; gi = gi->next)
+  {
+    if (gi->mapped && gi->image_id == image_id)
+    {
+      gi->callback_action(gi);
+
+      return TRUE;
+    }
+  }
+
+  return FALSE;
+}