aboutsummaryrefslogtreecommitdiffstats
path: root/Lua/src/lua/ULuaCore.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-04-20 12:47:39 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-04-20 12:47:39 +0000
commiteab0940bcf7577a9542b474848ee376c581d898c (patch)
treeedd09b7e00a6a8d29db5e9ae9307971d6c4809a5 /Lua/src/lua/ULuaCore.pas
parent6a44ff7dc1154b6bc5cf9ef250b536c5fc11519e (diff)
downloadusdx-eab0940bcf7577a9542b474848ee376c581d898c.tar.gz
usdx-eab0940bcf7577a9542b474848ee376c581d898c.tar.xz
usdx-eab0940bcf7577a9542b474848ee376c581d898c.zip
hookable event nearly finished(unhook function missing)
plugin Id now written to the lua states registry Usdx.Version added, Usdx.Hook added git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1689 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Lua/src/lua/ULuaCore.pas7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lua/src/lua/ULuaCore.pas b/Lua/src/lua/ULuaCore.pas
index 9f965567..403709dd 100644
--- a/Lua/src/lua/ULuaCore.pas
+++ b/Lua/src/lua/ULuaCore.pas
@@ -655,7 +655,12 @@ begin
lua_checkstack(State, 2);
lua_pushinteger(State, Id);
lua_pushcclosure(State, TLuaPlugin_Register, 1);
- lua_setglobal(State, PChar('register'));
+ lua_setglobal(State, PChar('register'));
+
+ // write plugin id to registry
+ lua_pushinteger(State, iId);
+ lua_setfield (State, LUA_REGISTRYINDEX, '_USDX_STATE_ID');
+ lua_pop(State, Lua_GetTop(State));
// now run the plugin_init function
// plugin_init() if false or nothing is returned plugin init is aborted