X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fmisc.c;h=6432523e41ce5c5755a6e385c28abd30995b5aee;hp=d31ed248b7d4c9322da95812042ab6fcf14716d0;hb=1c9456dab9709209a2462afe72c65373a1294de5;hpb=3e10387c490e2db8997d6e909d7d13d71fe876e3 diff --git a/src/libgame/misc.c b/src/libgame/misc.c index d31ed248..6432523e 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -2806,6 +2806,33 @@ int get_anim_parameter_value(char *s) return result; } +int get_anim_action_parameter_value(char *token) +{ + int result = getImageIDFromToken(token); + + if (result == -1) + { + char *gfx_token = getStringCat2("gfx.", token); + + result = getImageIDFromToken(gfx_token); + + checked_free(gfx_token); + } + + if (result == -1) + { + Key key = getKeyFromX11KeyName(token); + + if (key != KSYM_UNDEFINED) + result = -(int)key; + } + + if (result == -1) + result = ANIM_EVENT_ACTION_NONE; + + return result; +} + int get_parameter_value(char *value_raw, char *suffix, int type) { char *value = getStringToLower(value_raw); @@ -2887,6 +2914,11 @@ int get_parameter_value(char *value_raw, char *suffix, int type) // add optional "click:anim_X" or "click:anim_X.part_X" parameter result |= get_anim_parameter_value(value); } + else if (strEqual(suffix, ".init_event_action") || + strEqual(suffix, ".anim_event_action")) + { + result = get_anim_action_parameter_value(value_raw); + } else if (strEqual(suffix, ".class")) { result = (strEqual(value, ARG_UNDEFINED) ? ARG_UNDEFINED_VALUE : @@ -2904,6 +2936,12 @@ int get_parameter_value(char *value_raw, char *suffix, int type) if (string_has_parameter(value, "reverse")) result |= STYLE_REVERSE; + + if (string_has_parameter(value, "passthrough_clicks")) + result |= STYLE_PASSTHROUGH; + + if (string_has_parameter(value, "multiple_actions")) + result |= STYLE_MULTIPLE_ACTIONS; } else if (strEqual(suffix, ".fade_mode")) {