mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 21:27:12 +00:00
Reverted FOREACH, NEXT and REPEAT to their original forms
This is because the changes (9fb175c9d6) possibly break some existing uses for no reason.
This commit is contained in:
parent
9a288ab78c
commit
8bbe4189ed
@ -308,16 +308,24 @@ _"No gold carried over to the next scenario."#enddef
|
||||
# wmlindent: start ignoring
|
||||
#define FOREACH ARRAY_VALUE VAR
|
||||
# Macro to begin a WML clause that iterates over an array.
|
||||
[for]
|
||||
array={ARRAY_VALUE}
|
||||
variable={VAR}
|
||||
{VARIABLE {VAR} 0}
|
||||
[while]
|
||||
[variable]
|
||||
name={VAR}
|
||||
less_than=${ARRAY_VALUE}.length
|
||||
[/variable]
|
||||
[do]
|
||||
#enddef
|
||||
|
||||
#define NEXT VAR
|
||||
# Macro to end a WML clause that iterates over an array.
|
||||
[set_variable]
|
||||
name={VAR}
|
||||
add=1
|
||||
[/set_variable]
|
||||
[/do]
|
||||
[/for]
|
||||
[/while]
|
||||
{CLEAR_VARIABLE {VAR}}
|
||||
#enddef
|
||||
# wmlindent: stop ignoring
|
||||
|
||||
|
@ -215,13 +215,22 @@
|
||||
#! {REPEAT 5 (
|
||||
#! {QUAKE "rumble.ogg"}
|
||||
#! )}
|
||||
{VARIABLE REPEAT_i 0}
|
||||
|
||||
[while]
|
||||
[variable]
|
||||
name=REPEAT_i
|
||||
less_than={NUMBER}
|
||||
[/variable]
|
||||
|
||||
[repeat]
|
||||
times={NUMBER}
|
||||
[do]
|
||||
{BODY_WML}
|
||||
|
||||
{VARIABLE_OP REPEAT_i add 1}
|
||||
[/do]
|
||||
[/repeat]
|
||||
[/while]
|
||||
|
||||
{CLEAR_VARIABLE REPEAT_i}
|
||||
#enddef
|
||||
|
||||
#define LOOKUP_INDEX FROM_ARRAY_NAME WHERE_KEY_NAME WHERE_VALUE SAVE_AS_NAME
|
||||
|
Loading…
x
Reference in New Issue
Block a user