Commit Graph
100 Commits
Author SHA1 Message Date
Glenn Maynard 59ad3f8222 ThemeManager::GetClassFallback 2006-09-22 06:41:27 +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
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
Glenn Maynard f752e86b47 0 -> false
1 -> true
2006-09-21 20:07:36 +00:00
Glenn Maynard 95faef1776 cleanup 2006-09-21 07:41:22 +00:00
Glenn Maynard d2df988807 use ToUnicodeEx if available 2006-09-21 07:32:34 +00:00
Glenn Maynard 9695b7bb50 because we just created things that didn't exist before; if "x/" doesn't
exist, you look up "x/*", then create "x/" and "x/y", looking up "x/*"
again may return a cached empty result (or it may not, but best to be
safe)
2006-09-21 06:38:00 +00:00
Glenn Maynard 9cbbda42e4 Init -> BeginScreen 2006-09-21 06:32:03 +00:00
Glenn Maynard 1a6da449dd fix options credits goes to the wrong screen 2006-09-21 06:30:08 +00:00
Glenn Maynard 39e89b5986 EndGame in GameLoop 2006-09-21 05:08:42 +00:00
Glenn Maynard cb288fbfba cleanup 2006-09-21 05:04:33 +00:00
Glenn Maynard e0e29285fe RegisterTypes() less 2006-09-21 04:58:41 +00:00
Glenn Maynard 10f0929551 don't crash if SCREENMAN isn't up (this should probably be done
by the caller)
2006-09-21 04:57:38 +00:00
Glenn Maynard 4be207e419 fixup 2006-09-21 04:49:55 +00:00
Glenn Maynard 1490cf8075 no longer needed 2006-09-21 04:45:49 +00:00
Glenn Maynard 578c6d5726 simplify singleton registration 2006-09-21 04:42:45 +00:00
Glenn Maynard 2b7e2849fd simplify singleton registration 2006-09-21 04:27:45 +00:00
Glenn Maynard e779328560 delete lua later 2006-09-21 04:23:31 +00:00
Glenn Maynard eb376fca1d simplify singleton registration. Add the singleton global
to Lua when the singleton is constructed, and not in the
binding class.  The binding just adds the class bindings
(the same as for a non-singleton class).  This way, the
binding is available to Lua as soon as the class is constructed.
2006-09-21 04:20:08 +00:00
Glenn Maynard 8d81ef8806 init Lua earlier 2006-09-21 04:06:44 +00:00
Glenn Maynard 92ade8fa90 reduce THEME->UpdateLuaGlobals() to LUA->RegisterTypes 2006-09-21 03:55:22 +00:00
Glenn Maynard bba1890f00 GetMetricRaw private 2006-09-21 03:39:11 +00:00
Glenn Maynard 8526204155 remove unused overload 2006-09-21 03:33:35 +00:00
Glenn Maynard d293c0a09a table.foreach deprecated in lua 5.1 2006-09-21 03:04:28 +00:00
Glenn Maynard 8b8d2af09f update 2006-09-21 03:00:35 +00:00
Glenn Maynard 65b8b8927d remove ActorCommands 2006-09-21 02:58:24 +00:00
Glenn Maynard 62f050aff2 remove ActorCommands.h 2006-09-21 02:57:20 +00:00
Glenn Maynard b3498dbb9f pull in LuaReference; was before from ActorCommands.h, needed
to destruct apActorCommands
2006-09-21 02:55:56 +00:00
Glenn Maynard ed81222b34 ActorCommands.h -> Actor.h or ActorUtil.h 2006-09-21 02:48:15 +00:00
Glenn Maynard 8961602964 remove ActorCommands.h 2006-09-21 02:43:57 +00:00
Glenn Maynard b30aaa63a7 ActorCommands.h -> Actor.h (for the type) or ActorUtil.h
(for ParseActorCommands)
2006-09-21 02:38:01 +00:00
Glenn Maynard 355fdd7264 ActorCommands -> ActorUtil::ParseActorCommands 2006-09-21 02:36:40 +00:00
Glenn Maynard d4cbd09737 apActorCommands in Actor.h 2006-09-21 02:35:30 +00:00
Glenn Maynard c2e5a38930 ActorCommands -> ActorUtil::ParseActorCommands 2006-09-21 02:25:10 +00:00
Glenn Maynard 3a57dca6c4 ActorCommands -> ActorUtil::ParseActorCommands 2006-09-21 02:24:22 +00:00
Glenn Maynard 039e263fbc LuaExpression unused 2006-09-21 02:11:54 +00:00
Glenn Maynard d04a5920fa LuaExpression -> LuaReference 2006-09-21 02:09:44 +00:00
Glenn Maynard fc510e7086 LuaExpression::SetFromExpression -> LuaReference::SetFromExpression 2006-09-21 02:06:42 +00:00
Glenn Maynard e0a68a235e eliminate LuaData type; move Serialize into LuaReference
Nothing uses Serialize right now.  I havn't decided whether
to keep it around.
2006-09-21 01:56:08 +00:00
Glenn Maynard e20eea62e9 flatten LuaTable -> LuaData -> LuaReference
to LuaTable -> LuaReference
2006-09-21 01:45:51 +00:00
Glenn Maynard 12a21ce930 remove old stuff 2006-09-21 01:41:37 +00:00
Glenn Maynard 8548f1cb33 simplify ActorCommands 2006-09-21 01:39:38 +00:00
Glenn Maynard 6fe7bf2683 clean up strange command code 2006-09-21 01:22:46 +00:00
Glenn Maynard d3e50d80c8 remove unused stuff
simplify ActorCommands

I thought about getting rid of m_sLuaFunction; it's not needed
anymore, and takes up memory (probably more memory than the
function itself), but I use it a lot to identify floating
references when I don't know what I'm looking at.  Store it
generically in LuaReference.
2006-09-21 01:19:18 +00:00
Glenn Maynard 7d1f669e93 remove unused LuaReference::BeforeResetAll, LuaReference::AfterResetAll 2006-09-21 00:00:57 +00:00
Glenn Maynard fe06c2e7fb simplify
don't BeforeResetAll, AfterResetAll
2006-09-20 23:56:11 +00:00
Glenn Maynard 5a5d9b655e don't need to lock in the ctor 2006-09-20 23:54:25 +00:00
Glenn Maynard 1749779ca8 merge ResetState into ctor 2006-09-20 23:47:08 +00:00
Glenn Maynard ab1fd34e76 Previously, changing themes attempted to preserve Lua data by
serializing data and tables while reinstantiating Lua.  That's
ugly, and can't serialize some things (eg. functions).

Instead, when changing themes, shut down the high-level objects
and unregister as much as we can from Lua, change the theme,
then reregister things.  This doesn't clean the slate as much;
globals won't be erased, etc.

A better way would be to clear everything that uses Lua
(delete singletons), then reload it all.  Singleton creation is
a bit of a mess currently so that would break a lot, and we
don't want to reload songs.
2006-09-20 23:45:38 +00:00
Glenn Maynard 494523f741 make RegisterTypes public 2006-09-20 23:31:54 +00:00
Glenn Maynard 41028ca167 NextTheme -> GetNextTheme 2006-09-20 23:10:15 +00:00
Glenn Maynard 65c9a8bd17 unused header 2006-09-20 23:07:00 +00:00
Glenn Maynard abacb7ef9d ThemeManager::ClearSubscribers 2006-09-20 23:05:52 +00:00
Glenn Maynard 70ed0d319e Clear() 2006-09-20 23:04:20 +00:00
Glenn Maynard 107fdf4c8f Remove Profile::m_SavedLuaData. Don't store data as
serialized Lua blobs.  The Lua blob format may change with
Lua upgrades, and it's hard to impossible to use the data
with other apps.  This wasn't used right now anyway, but
if it's needed, use an XML format.
2006-09-20 22:15:56 +00:00
Glenn Maynard 9b94f66bc0 fix leak 2006-09-20 22:09:44 +00:00
Glenn Maynard 45a159bd00 allow setting AutoActor directly 2006-09-20 22:09:16 +00:00
Glenn Maynard 4f555ddb66 remove unused forward decl 2006-09-20 21:56:05 +00:00
Glenn Maynard a273003bbf fix leak 2006-09-20 21:44:58 +00:00
Glenn Maynard 7210df525b remove coin debouncing; InputFilter does better generic debouncing
on all inputs
2006-09-19 09:42:25 +00:00
Glenn Maynard f9149b5b0d cleanup 2006-09-19 09:37:02 +00:00
Glenn Maynard 26fd04c73c in SpecialFiles.h 2006-09-19 09:22:01 +00:00
Glenn Maynard 106b0ae7a3 don't accept NULL to assignment
simplify
2006-09-18 23:42:32 +00:00
Glenn Maynard b8349ca68b ARRAYLEN 2006-09-18 23:28:10 +00:00