that Invalid has a meaning for an API call; most do not. As it was, every
function that used Enum::Check should have been checking for invalid
return values; this way, the check can be omitted.
(This applies to FromString, Pop and FromStack, too; I havn't decided
whether I want to propagate this into those.)
Use ActorUtil::GetAttrPath to look up a path, with automatic
handling of relative paths. This way, we don't need to do it
in every place we look up paths.
(For Lua nodes, this will be set by Lua.)
Each actor type needs to evaluate attributes; only a few do. Strings
are handled with the "@foo()" notation.
Instead, after loading an XML file for loading as an actor,
precompile all XML attributes as Lua expressions.
The primary difference to code is:
- previously, Attr="string" would act as a string if it was being
read as one. Now, specify Attr='"string"'. Attr="@string" is
a shorthand. (note that @strings will not be parsed as Lua
strings, so can not use Lua escape characters)
- previously, Attr="@func()" would evaluate func(), and the value
of the attribute would be the return value of the function. This
was only supported for a few attributes. Now, say Attr="func()",
and this will work for all fields.
- Attributes of other types are unchanged, except that all attributes
may be Lua expressions, eg. Width="SCREEN_WIDTH".
- Attributes names ending with "Command" are special, like metrics.
Prefix "%" to disable this.
This brings XML handling in line with metric handling. (This is an intermediary
step; I have another idea that follows from this that should eliminate the annoying
"'foo'"/"@foo".)