int viewport_height;
boolean changed = FALSE;
- if (part->last_anim_status == global.anim_status)
+ if (part->last_anim_status == global.anim_status &&
+ part->control_info.class != get_hash_from_key("pointer"))
return FALSE;
part->last_anim_status = global.anim_status;
part->drawing_stage = DRAW_GLOBAL_ANIM_STAGE_2;
}
+ else if (part->control_info.class == get_hash_from_key("pointer"))
+ {
+ viewport_x = gfx.mouse_x + part->control_info.x;
+ viewport_y = gfx.mouse_y + part->control_info.y;
+ viewport_width = part->graphic_info.width;
+ viewport_height = part->graphic_info.height;
+
+ part->drawing_stage = DRAW_GLOBAL_ANIM_STAGE_2;
+ }
else if (part->control_info.class == get_hash_from_key("door_1"))
{
viewport_x = DX;
part->anim_delay_counter =
(c->anim_delay_fixed + GetSimpleRandom(c->anim_delay_random));
+ part->post_delay_counter = 0;
+
part->init_event_state = (c->init_event != ANIM_EVENT_UNDEFINED);
part->anim_event_state = (c->anim_event != ANIM_EVENT_UNDEFINED);
part->step_yoffset = 0;
}
- if (c->x != ARG_UNDEFINED_VALUE)
- part->x = c->x;
- if (c->y != ARG_UNDEFINED_VALUE)
- part->y = c->y;
+ if (part->control_info.class != get_hash_from_key("pointer"))
+ {
+ if (c->x != ARG_UNDEFINED_VALUE)
+ part->x = c->x;
+ if (c->y != ARG_UNDEFINED_VALUE)
+ part->y = c->y;
+ }
if (c->position == POS_LAST &&
anim->last_x > -g->width && anim->last_x < part->viewport_width &&
if (anim_event_action == -1)
return FALSE;
- boolean action_executed = (DoGadgetAction(anim_event_action) ||
- DoScreenAction(anim_event_action) ||
- DoKeysymAction(anim_event_action));
+ PushUserEvent(USEREVENT_ANIM_EVENT_ACTION, anim_event_action, 0);
// check if further actions are allowed to be executed
if (part->control_info.style & STYLE_MULTIPLE_ACTIONS)
return FALSE;
- return action_executed;
+ return TRUE;
}
static void InitGlobalAnim_Clickable(void)
InitGlobalAnim_Clicked(-1, -1, ANIM_CLICKED_RESET);
}
-boolean HandleGlobalAnimClicks(int mx, int my, int button)
+boolean HandleGlobalAnimClicks(int mx, int my, int button, boolean force_click)
{
static boolean click_consumed = FALSE;
static int last_button = 0;
boolean release_event;
boolean click_consumed_current = click_consumed;
+ if (button != 0 && force_click)
+ last_button = 0;
+
// check if button state has changed since last invocation
press_event = (button != 0 && last_button == 0);
release_event = (button == 0 && last_button != 0);