diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-06-21 18:40:46 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-06-21 18:40:46 +0000 |
commit | b048ea322fac0d6cb59b9f1645fad9d7a898fc57 (patch) | |
tree | 77cab073f0cca54369cf47dadb973bf45d640e15 /plugins/MirLua/src/mlua.cpp | |
parent | 78f36745d03f03d4772e09720eef976cff5a4d9b (diff) |
MirLua: Scripts reloading pt.2
git-svn-id: http://svn.miranda-ng.org/main/trunk@14304 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/mlua.cpp')
-rw-r--r-- | plugins/MirLua/src/mlua.cpp | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp index 5945947441..f9772e0021 100644 --- a/plugins/MirLua/src/mlua.cpp +++ b/plugins/MirLua/src/mlua.cpp @@ -23,39 +23,24 @@ void CMLua::Load() lua_pop(L, 1);
LoadMirandaModules();
+
+ hScriptsLangpack = GetPluginLangId(MIID_LAST, 0);
+
+ CLuaLoader loader(this);
+ loader.LoadScripts();
}
void CMLua::Unload()
{
if (L)
lua_close(L);
+ KillModuleMenus(hScriptsLangpack);
}
void CMLua::Reload()
{
- /*lua_getglobal(L, "m");
- lua_getfield(L, -1, "OnPreShutdown");
- if (lua_isfunction(L, -1))
- {
- lua_pushlightuserdata(L, NULL);
- lua_pushlightuserdata(L, NULL);
- if (lua_pcall(L, 2, 1, 0))
- printf("%s\n", lua_tostring(L, -1));
- }
- lua_pop(L, 1);*/
Unload();
-
Load();
- /*lua_getglobal(L, "m");
- lua_getfield(L, -1, "OnModulesLoaded");
- if (lua_isfunction(L, -1))
- {
- lua_pushlightuserdata(L, NULL);
- lua_pushlightuserdata(L, NULL);
- if (lua_pcall(L, 2, 1, 0))
- printf("%s\n", lua_tostring(L, -1));
- }
- lua_pop(L, 1);*/
}
void CMLua::LoadModule(const char *name, lua_CFunction loader)
@@ -69,7 +54,7 @@ void CMLua::LoadModule(const char *name, lua_CFunction loader) void CMLua::LoadCoreModule()
{
luaL_newlib(L, coreLib);
- lua_pushlightuserdata(L, NULL); + lua_pushlightuserdata(L, NULL);
lua_setfield(L, -2, "NULL");
lua_setglobal(L, "m");
}
|