summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/MirLua/src/m_database.cpp2
-rw-r--r--plugins/MirLua/src/m_genmenu.cpp14
2 files changed, 15 insertions, 1 deletions
diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp
index a165fed50e..ab9224bb1e 100644
--- a/plugins/MirLua/src/m_database.cpp
+++ b/plugins/MirLua/src/m_database.cpp
@@ -639,7 +639,7 @@ static int dbei__gc(lua_State *L)
mir_free(dbei->pBlob);
- return 1;
+ return 0;
}
static const luaL_Reg dbeiMeta[] =
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp
index 1c729c43c9..d47bf7c012 100644
--- a/plugins/MirLua/src/m_genmenu.cpp
+++ b/plugins/MirLua/src/m_genmenu.cpp
@@ -45,6 +45,19 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi)
lua_pop(L, 1);
}
+static int lua_CreateRoot(lua_State *L)
+{
+ int hMenuObject = lua_tointeger(L, 1);
+ const char *name = luaL_checkstring(L, 2);
+ int position = lua_tointeger(L, 3);
+ HANDLE hIcon = (HANDLE)lua_touserdata(L, -4);
+
+ HGENMENU res = Menu_CreateRoot(MO_MAIN, ptrT(Utf8DecodeT(name)), position, hIcon);
+ lua_pushlightuserdata(L, res);
+
+ return 1;
+}
+
static int lua_AddMenuItem(lua_State *L)
{
int hMenuObject = lua_tointeger(L, 1);
@@ -121,6 +134,7 @@ static int lua_RemoveMenuItem(lua_State *L)
static luaL_Reg genmenuApi[] =
{
+ { "CreateRoot", lua_CreateRoot },
{ "AddMenuItem", lua_AddMenuItem },
{ "ModifyMenuItem", lua_ModifyMenuItem },
{ "ShowMenuItem", lua_ShowMenuItem },