}
else if (mode & ANIM_LEVEL_NR) // play frames by level number
{
- int level_pos = level_nr - leveldir_current->first_level;
+ int level_pos = level_nr - gfx.anim_first_level;
frame = level_pos % num_frames;
}
(struct GlobalAnimPartControlInfo *)obj2;
int compare_result;
- if (o1->control_info.draw_order != o2->control_info.draw_order)
- compare_result = o1->control_info.draw_order - o2->control_info.draw_order;
- else
- compare_result = o1->nr - o2->nr;
+ // do not sort animations parts by draw order (as it would be confusing)
+ compare_result = o1->nr - o2->nr;
return compare_result;
}
anim->state = ANIM_STATE_INACTIVE;
+ // if draw order is undefined, set to default value "0"
+ if (anim->control_info.draw_order == ARG_UNDEFINED_VALUE)
+ anim->control_info.draw_order = 0;
+
part_nr = 0;
for (p = 0; p < NUM_GLOBAL_ANIM_PARTS_ALL; p++)
anim->has_base = TRUE;
}
- // apply special settings for pointer-style animations
- if (part->control_info.class == get_hash_from_key("pointer"))
- {
- // force animation to be on top (must set anim and part control)
- if (anim->control_info.draw_order == 0)
- anim->control_info.draw_order = 1000000;
- if (part->control_info.draw_order == 0)
- part->control_info.draw_order = 1000000;
-
- // force animation to pass-through clicks (must set part control)
- if (part->control_info.style == STYLE_DEFAULT)
- part->control_info.style |= STYLE_PASSTHROUGH;
- }
+ // force pointer-style animations to pass-through clicks
+ if (part->control_info.class == get_hash_from_key("pointer") &&
+ part->control_info.style == STYLE_DEFAULT)
+ part->control_info.style |= STYLE_PASSTHROUGH;
+
+ // if draw order is undefined, inherit it from main animation
+ if (part->control_info.draw_order == ARG_UNDEFINED_VALUE)
+ part->control_info.draw_order = anim->control_info.draw_order;
}
if (anim->num_parts > 0 || anim->has_base)
{
struct GlobalAnimPartControlInfo *part = &anim->part[part_nr];
+ // if request dialog is active, only handle pointer-style animations
+ if (game.request_active &&
+ part->control_info.class != get_hash_from_key("pointer"))
+ continue;
+
if (clicked_event == ANIM_CLICKED_RESET)
{
part->clicked = FALSE;