Commit Graph
23174 Commits
Author SHA1 Message Date
Glenn Maynard ed6141c48f By default, don't return Invalid values from Enum::Check. It's the exception
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.)
2006-10-11 05:18:12 +00:00
Glenn Maynard 2201d813b2 cleanup more 2006-10-11 04:58:11 +00:00
Glenn Maynard 0b87622780 tighten up MergeActorXML: only merge commands, fix and clean up
warning
2006-10-11 04:54:08 +00:00
Glenn Maynard 33a4b55076 fix stack imbalance on error; RunExpression does this 2006-10-11 04:52:22 +00:00
Glenn Maynard f18cb36048 don't AtEval these args 2006-10-11 02:41:24 +00:00
Glenn Maynard 9cb1409964 fix comment 2006-10-11 02:39:53 +00:00
Glenn Maynard a8eda70454 remove unused 2006-10-11 02:10:54 +00:00
Glenn Maynard 98fd2986c9 update examples 2006-10-11 02:04:49 +00:00
Glenn Maynard aab51ed30e use standard command parsing for unlocks (eliminate one case
where Command's AtExpression stuff is used)
2006-10-11 02:02:31 +00:00
Glenn Maynard 00d1fc742c special case no longer needed 2006-10-11 01:29:15 +00:00
Glenn Maynard a55e52e0d8 code names are strings, not ints, so this isn't a hack anymore 2006-10-11 01:19:38 +00:00
Glenn Maynard 83b2e25cc5 remove Path 2006-10-09 09:05:09 +00:00
Glenn Maynard f59c8c0562 handle FT_Lua 2006-10-09 08:36:44 +00:00
Glenn Maynard aaf58aaa9e update enum 2006-10-09 08:27:47 +00:00
Steve Checkoway 9ad5ac4b3e Fix warning. 2006-10-09 08:25:28 +00:00
Glenn Maynard e11914d4bb LoadFromNode(sDir, pNode) -> LoadFromNode(pNode) 2006-10-09 08:24:10 +00:00
Glenn Maynard f1ca420069 use ActorUtil::GetWhere 2006-10-09 08:08:59 +00:00
Glenn Maynard 8e8a10f56c ActorUtil::GetWhere 2006-10-09 08:08:17 +00:00
Glenn Maynard bf8ded44c6 remove sAniDir 2006-10-09 07:49:40 +00:00
Glenn Maynard 295ab135b9 ActorUtil::GetAttrPath 2006-10-09 07:48:52 +00:00
Glenn Maynard ccf171dbc8 use GetAttrPath 2006-10-09 07:44:37 +00:00
Glenn Maynard 7477cd1e4f _Source, for real source paths in error messages 2006-10-09 07:42:18 +00:00
Glenn Maynard 0c74193c2c use Def 2006-10-09 07:32:39 +00:00
Glenn Maynard 5eafec5ab8 fixup 2006-10-09 07:32:26 +00:00
Glenn Maynard c8e76b5048 add Def{} helper.
(This uses the debug API.  This particular use seems OK, but maybe
should be abstracted.)
2006-10-09 07:30:48 +00:00
Glenn Maynard 52edd053bd enable debug library 2006-10-09 07:28:01 +00:00
Glenn Maynard 255501ead1 use "@path", like the rest of lua 2006-10-09 07:20:40 +00:00
Glenn Maynard 1f6aaf18b9 use ActorUtil::GetAttrPath 2006-10-09 06:55:28 +00:00
Glenn Maynard b113467c20 Mark the directory of actor definition XNodes in the nodes themselves.
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.)
2006-10-09 06:54:52 +00:00
Glenn Maynard e2aaa1841e first-pass test/example case: actor descriptions in Lua 2006-10-09 05:52:33 +00:00
Glenn Maynard 7d795e5703 first-pass: actor descriptions in Lua 2006-10-09 05:51:12 +00:00
Glenn Maynard d0ab27b056 simplify 2006-10-09 05:43:24 +00:00
Glenn Maynard 206f731d79 simplify 2006-10-09 05:18:17 +00:00
Glenn Maynard 612e2fa1df simplify 2006-10-09 05:16:35 +00:00
Glenn Maynard c54bdfc412 AppendAttrFrom 2006-10-09 05:14:23 +00:00
Glenn Maynard f588a033a8 avoid ambiguity with template AppendAttr 2006-10-09 05:13:08 +00:00
Glenn Maynard 9b0c213a03 fix inconsistent behavior because of out of date cache 2006-10-09 02:12:55 +00:00
Glenn Maynard d7776aba60 evaluate enums directly 2006-10-09 01:34:16 +00:00
Glenn Maynard e0b788de16 unneeded LuaHelpers::RunAtExpressionS 2006-10-09 01:22:17 +00:00
Glenn Maynard ce07b22b56 fix up Context handling 2006-10-09 01:15:49 +00:00
Glenn Maynard afa611c36d fix error handling 2006-10-09 01:15:09 +00:00
Glenn Maynard 40b8df3488 attribute update 2006-10-09 00:59:30 +00:00
Glenn Maynard 3cae60d6fd Currently, expression handling in XML is spotting and inconsistent.
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".)
2006-10-09 00:49:30 +00:00
Glenn Maynard 2e3b047880 fix demo 2006-10-09 00:38:27 +00:00
Steve Checkoway 0a88ac65f2 Narrow the Load() interface--there's no need to expose the initial offset or the returned offset. Call InitEntities() to make sure those are set up. 2006-10-08 23:44:58 +00:00
Glenn Maynard 6322ded0dc move command parsing into LuaHelpers. It's not Actor-specific other
than a few compatibility hacks.
2006-10-08 22:24:15 +00:00
Steve Checkoway b06cb5a268 LUA_USE_MACOSX 2006-10-08 21:05:06 +00:00
Steve Checkoway 4d8564e803 LUA_USE_LINUX 2006-10-08 21:04:22 +00:00
Glenn Maynard 5c1ffb5c6a simplify 2006-10-08 04:29:09 +00:00
Glenn Maynard fc255b06eb simplify, remove unused 2006-10-07 23:14:58 +00:00