Commit Graph

35 Commits

Author SHA1 Message Date
Glenn Maynard eaf717d2d7 entity fix in attributes 2007-04-17 20:40:35 +00:00
Steve Checkoway 7ca0f5996b Unused. 2007-02-23 08:35:48 +00:00
Glenn Maynard f59c963eab fix wrong actor order when creating more than 10 actors in Lua 2007-02-12 04:08:39 +00:00
Glenn Maynard cefa128034 change XNode children to a vector.
This means the order of children is preserved.

It also means the name of each node isn't duplicated.  This was
an opportunity for an inconsistent XNode tree.  Nodes can now be
renamed after being inserted into a tree.

Searching for children by name isn't efficient.  Use attributes for that.
2007-02-12 01:52:18 +00:00
Glenn Maynard 62b5c145db remove SetTextValue 2007-02-11 07:40:45 +00:00
Glenn Maynard b0430161b9 Merge text values into attributes; use TEXT_ATTRIBUTE_NAME for
the text value.

This means that FOREACH_Attr will iterate over the text value.
Compare with TEXT_ATTRIBUTE_NAME if you explicitly don't want
that.

This is simpler; an XNode branches out in two places--attributes
and children--instead of three.

It also means that nodes without any text data actually don't
have any text data--the attribute simply doesn't exist.  The
*TextValue functions are also no longer needed, though some
are left in now for compatibility (and maybe convenience).
2007-02-11 07:27:29 +00:00
Glenn Maynard fb8e73ac58 SetValue, etc -> SetTextValue 2007-02-11 06:26:06 +00:00
Glenn Maynard 96caf97851 use FOREACH_Attr 2007-02-11 00:44:57 +00:00
Glenn Maynard 5772a41b92 use accessors 2007-02-11 00:38:27 +00:00
Glenn Maynard 95fdd553de remove Command="%function" syntax from XML. Use Lua directly. 2007-02-10 23:47:39 +00:00
Glenn Maynard 070779520f use accessors 2007-02-10 22:17:43 +00:00
Steve Checkoway eebc1e9f3c Simplify. 2007-02-04 10:57:09 +00:00
Steve Checkoway 69b4f62a7a No need for this to be split out. 2007-02-04 10:49:42 +00:00
Steve Checkoway 6d2fa387d8 Cut xml writing time down by a third for catalog.xml by not concatenating strings before calling Write. 2007-02-04 10:44:45 +00:00
Glenn Maynard 2d5cbe6535 move MergeIniUnder to XmlFileUtil 2007-02-04 04:09:53 +00:00
Glenn Maynard 500074a10f error check 2007-01-23 06:54:29 +00:00
Steve Checkoway e3e5cf77e5 Don't include Foreach.h in RageUtil.h which does not use it. Instead, include it in the individual files that actually use it. 2006-11-01 11:18:46 +00:00
Steve Checkoway 4590dea0b3 Partial revert. Glenn knew what he was doing with lua_next(), even if I did not. =) 2006-10-15 08:47:31 +00:00
Steve Checkoway a183541eed Use FOREACH_LUATABLE. 2006-10-15 03:16:06 +00:00
Glenn Maynard fd2ff3481c remove special "Command" processing 2006-10-12 09:57:46 +00:00
Glenn Maynard 33a4b55076 fix stack imbalance on error; RunExpression does this 2006-10-11 04:52:22 +00:00
Steve Checkoway 9ad5ac4b3e Fix warning. 2006-10-09 08:25:28 +00:00
Glenn Maynard 7d795e5703 first-pass: actor descriptions in Lua 2006-10-09 05:51:12 +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
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 ba82cc8002 m_Value -> base pointer 2006-10-06 06:38:46 +00:00
Glenn Maynard 6808723b85 XNodeValue base class, Copy() 2006-10-06 06:26:53 +00:00
Glenn Maynard 1a89ddfccd pointer to attributes 2006-10-03 00:07:01 +00:00
Glenn Maynard 65d23319f1 api update 2006-10-02 22:47:53 +00:00
Glenn Maynard 76af4dba2f use GetName 2006-10-02 22:42:40 +00:00
Glenn Maynard 19e7328d78 move XML loading and saving into XmlFileUtil, reducing XNode
to a data structure
2006-10-02 05:53:56 +00:00
Steve Checkoway 08155c351a Simplify. 2006-10-01 12:52:00 +00:00
Steve Checkoway d778966fc6 The existence of an error is signaled by error_string being nonempty. 2006-10-01 12:39:50 +00:00
Steve Checkoway 9f9f61579c Unused. 2006-10-01 12:22:28 +00:00
Chris Danford 353e0c5b6e break up arch stuff into smaller .cpp files to fix smpackage build and not pull in unnecessary stuff 2005-12-16 04:16:09 +00:00