From: Holger Schemel Date: Sun, 20 Aug 2023 12:57:58 +0000 (+0200) Subject: added option to not trigger further animations if CE change event consumed X-Git-Tag: 4.3.7.0~26 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=3e76edd9591c599d4ec9b3a179e07c23c0aa135c;p=rocksndiamonds.git added option to not trigger further animations if CE change event consumed This adds the parameter "consume_ce_event" to the ".style" option of global animations to prevent any further global animation to be triggered by "ce_change" events (".init_event" or ".anim_event") if the event was already recognized by any other global animation (which therefore "consumes" this event). Using this option, several similar global animations can be defined that are triggered one after another by several custom element changes to make it possible to show several similar global animations for multiple CE changes at the same time. --- diff --git a/src/anim.c b/src/anim.c index 0e866110..68147f0b 100644 --- a/src/anim.c +++ b/src/anim.c @@ -1411,6 +1411,10 @@ static void InitGlobalAnim_Triggered_ByCustomElement(int nr, int page, part2->triggered = TRUE; + // do not trigger any other animation if CE change event was consumed + if (c->style == STYLE_CONSUME_CE_EVENT) + return; + #if 0 Debug("anim:InitGlobalAnim_Triggered_ByCustomElement", "%d.%d TRIGGERED BY CE %d", anim2_nr, part2_nr, nr + 1); diff --git a/src/files.c b/src/files.c index 11f4c142..d9addaf1 100644 --- a/src/files.c +++ b/src/files.c @@ -11915,6 +11915,9 @@ int get_parameter_value(char *value_raw, char *suffix, int type) if (string_has_parameter(value, "multiple_actions")) result |= STYLE_MULTIPLE_ACTIONS; + + if (string_has_parameter(value, "consume_ce_event")) + result |= STYLE_CONSUME_CE_EVENT; } else if (strEqual(suffix, ".fade_mode")) { diff --git a/src/libgame/system.h b/src/libgame/system.h index 05f9f08a..d74b057b 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -437,6 +437,7 @@ #define STYLE_BLOCK (1 << 4) #define STYLE_PASSTHROUGH (1 << 5) #define STYLE_MULTIPLE_ACTIONS (1 << 6) +#define STYLE_CONSUME_CE_EVENT (1 << 7) #define STYLE_DEFAULT STYLE_NONE