if (anim_event_action == -1)
return FALSE;
- return DoGadgetAction(anim_event_action);
+ return (DoGadgetAction(anim_event_action) ||
+ DoScreenAction(anim_event_action));
}
static void InitGlobalAnim_Clickable()
}
/* special key shortcuts for all game modes */
- if (is_string_suffix(cheat_input, ":dump-gadget-ids") ||
- is_string_suffix(cheat_input, ":dgi") ||
- is_string_suffix(cheat_input, ":DGI"))
+ if (is_string_suffix(cheat_input, ":dump-event-actions") ||
+ is_string_suffix(cheat_input, ":dea") ||
+ is_string_suffix(cheat_input, ":DEA"))
{
DumpGadgetIdentifiers();
+ DumpScreenIdentifiers();
}
}
break;
}
}
+
+void DumpScreenIdentifiers()
+{
+ int i;
+
+ Print("Active screen elements on current screen:\n");
+
+ for (i = 0; main_controls[i].nr != -1; i++)
+ {
+ struct MainControlInfo *mci = &main_controls[i];
+
+ if (mci->button_graphic != -1)
+ {
+ char *token = getTokenFromImageID(mci->button_graphic);
+
+ Print("- '%s'\n", token);
+ }
+ }
+
+ Print("Done.\n");
+}
+
+boolean DoScreenAction(int image_id)
+{
+ int i;
+
+ if (game_status != GAME_MODE_MAIN)
+ return FALSE;
+
+ for (i = 0; main_controls[i].nr != -1; i++)
+ {
+ struct MainControlInfo *mci = &main_controls[i];
+ struct MenuPosInfo *pos = mci->pos_button;
+
+ if (mci->button_graphic == image_id)
+ {
+ int x = mSX + pos->x;
+ int y = mSY + pos->y;
+
+ HandleMainMenu(x, y, 0, 0, MB_MENU_CHOICE);
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
void setHideRelatedSetupEntries();
+void DumpScreenIdentifiers(void);
+boolean DoScreenAction(int);
+
#endif /* SCREENS_H */