Commit Graph

22675 Commits

Author SHA1 Message Date
Glenn Maynard bd2dd513b8 copy the name 2006-09-22 07:53:51 +00:00
Glenn Maynard 1bb569f8c4 LuaReference and apActorCommands are the same thing; apActorCommands
just sticks the result in AutoPtrCopyOnWrite.  apActorCommands might be
eliminated; it's reference counting a garbage collected object.  (It
used to be more useful, when we stored actual command lists; now I'm
not sure whether it is.  Need to benchmark LuaRef copying to see.)

So, we shouldn't be treating them differently, but we are:
GetMetric(apActorCommands) parses actor commands, and GetMetric(LuaRef)
does not.  I don't like that distinction; actor commands can be passed
around as a LuaReference, and other references can be put in
apActorCommands.  "Whether it's in a smart pointer" is a strange
way to decide which overload to use.

Also, we should have a consistent way to know whether a metric is to
be parsed as a command or as a Lua expression, based on the data
itself and not the code being used to read it.  Let's use the name:
all commands end with "Command".  We already depend on this elsewhere,
in ActorUtil::LoadAllCommandsFromName.

Note that "actor commands" are not specific to the Actor system,
other than a few compatibility hacks; they're just a shorthand
for writing Lua functions.
2006-09-22 07:50:05 +00:00
Glenn Maynard 0006a92712 commands end with Command 2006-09-22 07:46:21 +00:00
Glenn Maynard 13937cf7eb bools 2006-09-22 07:21:34 +00:00
Glenn Maynard 607cf44b31 old comment 2006-09-22 07:18:37 +00:00
Glenn Maynard 305d9a86f5 remove hack; no longer necessary 2006-09-22 07:18:20 +00:00
Glenn Maynard ec69abca83 use DynamicThemeMetric 2006-09-22 07:14:56 +00:00
Glenn Maynard 09a0981eaf handle Fallback metrics like the rest 2006-09-22 07:00:26 +00:00
Steve Checkoway 930af9db5c Add file. 2006-09-22 06:58:14 +00:00
Glenn Maynard 59ad3f8222 ThemeManager::GetClassFallback 2006-09-22 06:41:27 +00:00
Jason Felds d0c97aa6ed File update (untestable: normal updater hasn't been around). 2006-09-22 05:31:21 +00:00
Glenn Maynard 7f974f428b double quotes look cleaner than single quotes 2006-09-22 05:02:27 +00:00
Glenn Maynard f8c1675309 allocate later
don't set name for binary chunks
2006-09-22 04:56:35 +00:00
Glenn Maynard 4a9b1736f5 flip GetMetric(ref) and GetMetricR(), so there's an interface exposed that doens't
copy the reference.  Copying refs isn't expensive, but it does lock Lua.
2006-09-22 04:46:47 +00:00
Glenn Maynard 6b89313b09 cleanup 2006-09-22 04:38:42 +00:00
Glenn Maynard 6d616e8a86 major format update. This was done mostly by grepping the source
for ThemeMetric<RString> and GetMetric, and then doing a runthrough;
I probably missed some.
2006-09-22 04:36:53 +00:00
Glenn Maynard f90088d616 Currently all metrics except for strings and commands are valid
Lua expressions, and commands simply allow a shorthand that generates
valid Lua expressions.  Make strings Lua expressions.

This essentially reverses strings; rather than:
  Metric1=Text
  Metric2=@Text()

specify:

  Metric1="Text"
  Metric2=Text()

This means that every metric (except Fallback, currently) can be
treated as a Lua expression, except for Command metrics that just
need a bit of preprocessing.
2006-09-22 04:35:11 +00:00
Glenn Maynard 5bab52b368 use GetMetricR 2006-09-22 04:34:47 +00:00
Glenn Maynard 284ce49366 fix FromStack for negative iPos 2006-09-22 04:26:43 +00:00
Glenn Maynard 6f1dbf32d5 don't specify a dummy name for the expression, so RunScript
shows useful error messages
2006-09-22 04:25:38 +00:00
Glenn Maynard 53c831701d fixup colors 2006-09-22 04:20:48 +00:00
Glenn Maynard 38328196a3 use GetMetricR 2006-09-22 03:53:42 +00:00
Glenn Maynard 7a683dd839 unused 2006-09-22 03:49:19 +00:00
Glenn Maynard ce3ebd0293 use GetMetricR 2006-09-22 03:38:47 +00:00
Glenn Maynard d89cbcd133 SetTransformFromReference 2006-09-22 03:34:06 +00:00
Glenn Maynard 4ed3cb5970 Don't pass transform functions through a string metric; read it as
a Lua expression directly.
2006-09-22 03:32:50 +00:00
Glenn Maynard 494053c420 set the expression directly 2006-09-22 03:32:18 +00:00
Glenn Maynard 1b8b029eef re-add "get metric as Lua expression" 2006-09-22 03:31:38 +00:00
Glenn Maynard e592af10de SetTransformFromReference 2006-09-22 03:23:13 +00:00
Glenn Maynard 9152a81272 SetFromReference 2006-09-22 03:22:08 +00:00
Glenn Maynard 489fe6262d no @expr for colors 2006-09-22 02:36:19 +00:00
Glenn Maynard 141f48b032 Handle colors as Lua expressions, like int/float/bool metrics: "{1,1,1,1}"
instead of "1,1,1,1".
2006-09-22 02:35:42 +00:00
Glenn Maynard 6c398cf49d color(): return a table instead of four values 2006-09-22 02:14:34 +00:00
Glenn Maynard 591ef06969 use LuaReference::SetFromExpression 2006-09-22 02:08:00 +00:00
Glenn Maynard 2335fe585b fix color() not used 2006-09-22 02:04:00 +00:00
Jason Felds 6a3ebb89b8 Add RageTypes.cpp for committing. 2006-09-21 23:18:28 +00:00
Glenn Maynard 9e96b44d55 oops, fixup 2006-09-21 23:15:24 +00:00
Glenn Maynard 235729f7b3 only set name if not set 2006-09-21 23:11:43 +00:00
Glenn Maynard 81aa418b11 return error 2006-09-21 23:05:32 +00:00
Glenn Maynard 5a7b061639 do tween in lua 2006-09-21 22:13:18 +00:00
Glenn Maynard 52ae78a40e self:diffuse({1,1,1,1}) 2006-09-21 22:08:49 +00:00
Glenn Maynard d4da4afcad update 2006-09-21 22:07:15 +00:00
Glenn Maynard a4a8e41974 RageColor::PushTable, RageColor::FromStack
This is PushTable and not PushSelf, to distinguish this from
the PushSelf used in other classes.  Classes that can PushSelf
actually push a reference to itself to Lua, but that's only
valid for objects with a lifetime; many RageColors are temporaries.
2006-09-21 22:04:56 +00:00
Glenn Maynard b4406c9fb4 fix bool 2006-09-21 21:38:41 +00:00
Glenn Maynard 233521f120 cleanup 2006-09-21 20:34:50 +00:00
Glenn Maynard 30d394b665 Remove RunAtExpressionS (@expr) for most metric types. They're evaluated
as expressions anyway.  Still used for strings and colors, which aren't.
(Strings should be, and color metrics should be removed, I think.)
2006-09-21 20:18:23 +00:00
Glenn Maynard f04a03c321 don't use 0 and 1 for bools; use valid Lua expressions 2006-09-21 20:14:14 +00:00
Glenn Maynard 479aca5ff4 don't FontCharAliases::ReplaceMarkers for non-strings (GetMetricI, etc) 2006-09-21 20:13:21 +00:00
Glenn Maynard 625524f9ab 0 -> false
1 -> true
2006-09-21 20:12:27 +00:00
Glenn Maynard 83b12ecdb9 fix typo 2006-09-21 20:08:31 +00:00