summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/mlua.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/src/mlua.cpp')
-rw-r--r--plugins/MirLua/src/mlua.cpp29
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");
}