{
struct GraphicInfo *c = &part->control_info;
+ boolean clickable_any = FALSE;
boolean clickable_self = FALSE;
boolean clickable_triggered = FALSE;
+ if (mask & ANIM_EVENT_CLICK_ANY)
+ clickable_any = (c->init_event & ANIM_EVENT_CLICK_ANY ||
+ c->anim_event & ANIM_EVENT_CLICK_ANY);
+
if (mask & ANIM_EVENT_CLICK_SELF)
clickable_self = (c->init_event & ANIM_EVENT_CLICK_SELF ||
c->anim_event & ANIM_EVENT_CLICK_SELF);
clickable_triggered = (matchesAnimEventMask(c->init_event, mask) ||
matchesAnimEventMask(c->anim_event, mask));
- return (clickable_self || clickable_triggered);
+ return (clickable_any || clickable_self || clickable_triggered);
}
static boolean isClickedPart(struct GlobalAnimPartControlInfo *part,
continue;
}
- if (part->clickable &&
- isClickedPart(part, mx, my, clicked))
+ if (!part->clickable)
+ continue;
+
+ if (isClickablePart(part, ANIM_EVENT_CLICK_ANY))
+ any_part_clicked = part->clicked = TRUE;
+
+ if (isClickedPart(part, mx, my, clicked))
{
#if 0
printf("::: %d.%d CLICKED\n", anim_nr, part_nr);
return;
}
+ if (HandleGlobalAnimClicks(-1, -1, (key == KSYM_space ||
+ key == KSYM_Return ||
+ key == KSYM_Escape)))
+ {
+ /* do not handle this key event anymore */
+ if (key != KSYM_Escape) /* always allow ESC key to be handled */
+ return;
+ }
+
if (game_status == GAME_MODE_PLAYING && AllPlayersGone &&
(key == KSYM_Return || key == setup.shortcut.toggle_pause))
{
int dx = (left ? -1 : right ? 1 : 0);
int dy = (up ? -1 : down ? 1 : 0);
+ if (HandleGlobalAnimClicks(-1, -1, newbutton))
+ {
+ /* do not handle this button event anymore */
+ return;
+ }
+
switch (game_status)
{
case GAME_MODE_TITLE:
{
result = ANIM_EVENT_DEFAULT;
+ if (string_has_parameter(value, "any"))
+ result |= ANIM_EVENT_CLICK_ANY;
+
if (string_has_parameter(value, "click"))
result |= ANIM_EVENT_CLICK_SELF;
#define ANIM_EVENT_CLICK_PART_7 (1 << 14)
#define ANIM_EVENT_CLICK_PART_8 (1 << 15)
#define ANIM_EVENT_CLICK_SELF (1 << 16)
+#define ANIM_EVENT_CLICK_ANY (1 << 17)
#define ANIM_EVENT_CLICK_ANIM_ALL (ANIM_EVENT_CLICK_ANIM_1 | \
ANIM_EVENT_CLICK_ANIM_2 | \