summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/lua.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/src/lua.cpp')
-rw-r--r--plugins/MirLua/src/lua.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/plugins/MirLua/src/lua.cpp b/plugins/MirLua/src/lua.cpp
new file mode 100644
index 0000000000..dd2fd64606
--- /dev/null
+++ b/plugins/MirLua/src/lua.cpp
@@ -0,0 +1,37 @@
+#include "stdafx.h"
+
+CMLua::CMLua() : L(nullptr)
+{
+ //MUUID muidLast = MIID_LAST;
+ //g_hMLuaLangpack = GetPluginLangId(muidLast, 0);
+}
+
+CMLua::~CMLua()
+{
+ Log("Unloading lua engine");
+
+ KillModuleIcons(g_hMLuaLangpack);
+ KillModuleSounds(g_hMLuaLangpack);
+ KillModuleMenus(g_hMLuaLangpack);
+ KillModuleHotkeys(g_hMLuaLangpack);
+
+ KillObjectEventHooks(L);
+ KillObjectServices(L);
+
+ lua_close(L);
+}
+
+lua_State* CMLua::GetState()
+{
+ return L;
+}
+
+void CMLua::Load()
+{
+ Log("Loading lua engine");
+ L = luaL_newstate();
+ Log("Loading standard modules");
+ luaL_openlibs(L);
+
+ lua_atpanic(L, luaM_atpanic);
+}