loopier / animatron

Animatron for Godot 4.x <
15 stars 1 forks source link

Add "evaluate expressions" flag to CommandDescription (for defs, routines, ...) #21

Open totalgee opened 7 months ago

totalgee commented 7 months ago

We need to add a flag so that certain commands (namely /def, /routine, /for -- and possibly future /if, /else and related conditionals) will not evaluate expressions (described by {expr}) or variables (described by $var). These evaluations need to be deferred, so that variables such as time or random numbers are evaluated at the "last moment", just before actually being executed. In the case of /def and /routine, these commands are only storing a list of commands to be evaluated later.

We currently have argsAsArray and toGdScript flags, so we should just add another one, evalExpressions.

totalgee commented 7 months ago

This was implemented (for /def and /routine) in b48222a3. I added an inner class CommandDescription.Flags to be used to make initialization of commands more explicit (it was confusing to have three bools in a row!).