diff options
-rw-r--r-- | plugins/MirLua/src/m_core.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index 91fe4df070..6a5b4cb2d0 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -201,6 +201,16 @@ static int lua_ReplaceVariables(lua_State *L) return 1;
}
+static int lua_GetFullPath(lua_State *L)
+{
+ TCHAR path[MAX_PATH];
+ GetModuleFileName(NULL, path, MAX_PATH);
+
+ lua_pushstring(L, ptrA(mir_utf8encodeT(path)));
+
+ return 1;
+}
+
luaL_Reg coreApi[] =
{
{ "CreateHookableEvent", lua_CreateHookableEvent },
@@ -225,6 +235,8 @@ luaL_Reg coreApi[] = { "Translate", lua_Translate },
{ "ReplaceVariables", lua_ReplaceVariables },
+ { "GetFullPath", lua_GetFullPath },
+
{ "NULL", NULL },
{ "INVALID_HANDLE_VALUE", NULL },
|