Commit Graph

45 Commits

Author SHA1 Message Date
Glenn Maynard a88e37e7d6 lua cleanup 2005-06-15 08:26:56 +00:00
Glenn Maynard 52f0d9d74c pull code out of the header 2005-06-15 08:21:38 +00:00
Glenn Maynard e3a8b72639 lockable Lua object; "Lua" alias to replace "lua_State" 2005-06-15 08:16:28 +00:00
Renaud Lepage 1b124c16a5 Someone had made ifdefs that were confusing if compiling for Xbox. The conflictual situations have been resolved. 2005-05-30 23:43:37 +00:00
Glenn Maynard 2069d9cbeb register g_LuaFunctions in LuaManager::RegisterTypes
make RegisterTypes private
cleanup
2005-05-29 21:12:30 +00:00
Glenn Maynard f5dc5d75f3 simplify 2005-05-29 02:21:24 +00:00
Glenn Maynard e504164796 debugging message assumes that method calls ("x:y()") have an initial
self argument; we remove it, causing off-by-one error messages
2005-05-28 07:27:49 +00:00
Thad Ward 5949e5bc90 (this is possibly going to annoy some people, but..)
put all (obvious) MSVC lines in #if defined(_MSC_VER) blocks, primarilly
to allow alternative win32 compilers to be used.
2005-05-11 04:43:54 +00:00
Glenn Maynard 0d7cbe1d43 remove unused Push and FromStack overloads. 2005-04-30 03:08:52 +00:00
Glenn Maynard 7f43d744e9 fix pop 2005-04-25 09:42:54 +00:00
Charles Lohr e8729a82d0 VC6 doesn't seem to want to accept default parameter value for templated functions like this. Poor solution: just put in the default in the actual function call. 2005-03-14 00:07:56 +00:00
Chris Danford 8415b4466d fix VC7 template error: move templated methods out of LuaManager 2005-03-13 00:01:05 +00:00
Glenn Maynard 2d97c8e0ca fixes 2005-02-25 04:37:27 +00:00
Glenn Maynard 3b993dfa08 Replace PopStack with FromStack as a basic overloaded function.
Move Push and FromStack into a namespace, so other files can add to it;
that way, we can say Push(1) or Push(Actor*), instead of Push(1) and
pActor->PushSelf(), allowing easier templating.
Add presently unused/untested LuaHelpers::ReadArrayFromTable.
2005-02-24 20:03:07 +00:00
Chris Danford af4a407ffe fix VC7 warnings 2005-02-23 01:11:02 +00:00
Glenn Maynard f762300f49 PopStack() calls 2005-02-22 04:20:58 +00:00
Glenn Maynard 2350cc9b77 don't assert if LuaManager::RunScript is called with stuff on the stack 2005-02-22 03:27:06 +00:00
Glenn Maynard baf8ef940e RunScript cleanup, default to 0 return values 2005-02-22 01:21:38 +00:00
Chris Danford b688bff51d add pushing to vectors with any type 2005-02-21 06:51:10 +00:00
Chris Danford 9c29426f5f cleanup 2005-02-17 07:12:20 +00:00
Glenn Maynard 6f88bf18c0 Cleanup: change RunExpression to a RunScript helper. Never tack on
"return "; the caller can do that if it wants.  Instead, just act as a helper to
display a generic dialog on error.
2005-02-17 05:46:31 +00:00
Glenn Maynard d66163ab74 fix error dialog displayed twice: error handling for RunScript is up to the caller 2005-02-17 05:32:50 +00:00
Chris Danford da51076d91 revert last 2005-02-16 21:41:07 +00:00
Chris Danford 7e4a302ba4 fix precision loss (might be important someday) 2005-02-16 21:21:36 +00:00
Chris Danford c13accadc0 evaluate PlayerNumber as a lua expression 2005-02-16 21:20:33 +00:00
Chris Danford eb63c30d15 make hack more surgical 2005-02-16 17:33:28 +00:00
Glenn Maynard b8605eebf0 fix warning (atof returns a double, not a float) 2005-02-16 02:42:57 +00:00
Glenn Maynard 6175a16f24 Add LuaData, a reference type that restores itself over Lua resets. This
works only with static data types that can be restored: tables, strings,
numbers, and not functions, userdata, etc.
2005-02-16 00:38:40 +00:00
Chris Danford 4d31f3b4c1 evaluate TargetNumber as a Lua expression 2005-02-16 00:16:14 +00:00
Glenn Maynard 8584cbc0d7 when compiling a script from a file, don't dump the entire contents of the
script to the log/dialog
2005-02-15 07:17:49 +00:00
Glenn Maynard 0a0ad8714c allow LuaManager::RunExpression to return a function
show the filename when a full script has an error
use LuaManager::RunExpression in LuaExpression
2005-02-15 02:15:26 +00:00
Glenn Maynard 004d774889 simplify 2005-02-15 02:07:59 +00:00
Glenn Maynard 2103eb0531 bring RunExpression and RunScript closer together 2005-02-15 02:02:08 +00:00
Glenn Maynard 831e7c1825 remove LuaManager::PushNopFunction(). Just compile an empty function;
it'll be tiny, anyway.
2005-02-15 01:49:03 +00:00
Glenn Maynard fe6cd41543 update
add LuaManager::CreateTableFromArray, LuaManager::ReadArrayFromTable
2005-02-13 04:09:28 +00:00
Chris Danford e38164e74f yell louder on error when parsing scripts 2005-02-12 22:53:51 +00:00
Glenn Maynard a4de4c8c0d better function registration: store a reference, instead of making up a name 2005-02-05 23:03:20 +00:00
Chris Danford e2da825c30 re-register all ActorCommands after resetting Lua 2005-02-05 10:15:15 +00:00
Glenn Maynard 2eb9e8837b don't bother parsing for empty commands 2005-02-02 03:36:46 +00:00
Glenn Maynard 088b7bb356 Allow passing a lua_State to PushStack; make them static.
Add SetGlobal(bool), UnsetGlobal, PushStackNil.
Pass lua_State* to LUA_RETURN.
2005-01-30 02:01:27 +00:00
Glenn Maynard 703833d7d4 Simplify. RageException::Throw no longer actually throws; this makes
debugging much easier, since we don't lose the stack after a Lua error.
2005-01-28 19:42:44 +00:00
Chris Danford 8555a6da45 use Lua to execute commands
(needs cleanup)
2005-01-26 11:21:43 +00:00
Chris Danford ed6aa8b02e The Lua state needs to be reset on a theme change to reload scripts 2005-01-24 03:05:37 +00:00
Chris Danford cd9c48d645 LuaHelpers -> LuaManager 2005-01-24 02:26:55 +00:00
Chris Danford b055671a63 LuaHelpers.cpp -> LuaManager 2005-01-24 02:12:07 +00:00