Commit Graph
23195 Commits
Author SHA1 Message Date
AJ Kelly e991998e31 update to strings 2006-10-12 19:19:51 +00:00
Glenn Maynard fd2ff3481c remove special "Command" processing 2006-10-12 09:57:46 +00:00
Glenn Maynard 2c0b079412 update 2006-10-12 09:19:14 +00:00
Glenn Maynard dd8d265975 Add a custom syntax to Lua, to handle command strings.
function f = cmd(a,b;c,d)

is equivalent to

 function f = function(self, ...) self:a(b); self:c(d); end

This is equivalent to LuaHelpers::ParseCommandList, except:

 - Commands are not lowercased.  Do that yourself.
 - The "parent" parameter is not included.  Use self:GetParent().
 - "+5" is not valid.

The benefits are:

 - Better syntax checking.  Running "luac" on the Lua files will do syntax
   checking, and runtime syntax checks will find problems earlier.
 - Easier optimization.  Lua files can be compiled, and when using commands
   this way, commands will be precompiled, too.
 - Commands are compiled in the same scope, so upvalues work:
   local foo = 10; y = cmd(x,foo);
2006-10-12 09:18:05 +00:00
Glenn Maynard 9ae99e24d9 don't care about the args themselves 2006-10-12 09:08:13 +00:00
Steve Checkoway 6f426c169a Make sure that the correct function is actually overridden. See list. 2006-10-12 07:04:20 +00:00
Steve Checkoway bf641a3510 Change some settings. 2006-10-12 06:45:54 +00:00
Glenn Maynard 4f52f56195 revert. I think this is just hiding the warning. 2006-10-12 02:08:55 +00:00
Glenn Maynard eb9ab7382c ConvertValue 2006-10-12 02:05:48 +00:00
Glenn Maynard 6c0264620e probably safer: ConvertValue 2006-10-12 02:03:47 +00:00
Glenn Maynard ccfa2f16dd bOptional always true 2006-10-11 23:56:00 +00:00
Glenn Maynard 6ff22acb45 remove hacky Actor::IsType 2006-10-11 23:51:40 +00:00
Glenn Maynard ebfdac231c simplify; use dynamic_cast
(dynamic_cast is safe as long as it's used only on pointer
values; do not use it on reference types, since that can throw)
2006-10-11 23:50:41 +00:00
Steve Checkoway 6fd4694b79 Simplify. 2006-10-11 11:12:09 +00:00
Steve Checkoway 35a20193ef Fix "statement with no effect." 2006-10-11 10:50:17 +00:00
Steve Checkoway 8ef7317b57 Casting an rvalue to nonconst reference is illegal. I'm not positive why these are considered to be rvalues when they are cast. 2006-10-11 10:23:31 +00:00
Steve Checkoway 7046538f4e Casting an rvalue to nonconst reference is illegal. I'm not positive why these are considered to be rvalues when they are cast. 2006-10-11 10:15:36 +00:00
Steve Checkoway c532646ac1 Casting an rvalue to nonconst reference is illegal. I'm not positive why these are considered to be rvalues when they are cast. 2006-10-11 09:33:09 +00:00
Glenn Maynard 1c372a918c move code out of macro
move common code into ActorUtil::Create
2006-10-11 07:33:38 +00:00
Glenn Maynard bd9a210628 simplify 2006-10-11 06:56:42 +00:00
Glenn Maynard 12c903a2a4 use enum_add 2006-10-11 06:06:34 +00:00
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