new event-util macro: {CALL_FUNCTION}
This commit is contained in:
parent
999d4d1444
commit
3c5eaa03b9
1 changed files with 30 additions and 0 deletions
|
@ -167,3 +167,33 @@
|
|||
{ACTION_WML}
|
||||
[/event]
|
||||
#enddef
|
||||
|
||||
|
||||
#define CALL_FUNCTION FNAME PARAMS
|
||||
# This will fire an event with a set of parameters, for example:
|
||||
#! {CALL_FUNCTION my_event a,b,c=1,2,3}
|
||||
#
|
||||
# That example would fire an event with name "my_event"
|
||||
# and inside that event, $param.c will be equal to "3"
|
||||
# This will hold true even if the event is fired recursively
|
||||
[set_variables]
|
||||
mode=insert
|
||||
name=param[0]
|
||||
[value]
|
||||
{PARAMS}
|
||||
[/value]
|
||||
[/set_variables]
|
||||
[fire_event]
|
||||
name={FNAME}
|
||||
[primary_unit]
|
||||
x,y=$unit.x,$unit.y
|
||||
[/primary_unit]
|
||||
[second_unit]
|
||||
x,y=$second_unit.x,$second_unit.y
|
||||
[/second_unit]
|
||||
[/fire_event]
|
||||
[clear_variable]
|
||||
name=param[0]
|
||||
[/clear_variable]
|
||||
#enddef
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue