From e70895affa823bfe0f61174f4e14a983fda4ea0f Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 2 Sep 2015 21:07:38 +0000 Subject: MirLua: munu uid support git-svn-id: http://svn.miranda-ng.org/main/trunk@15161 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_genmenu.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp index 75be453dd4..25f0da5803 100644 --- a/plugins/MirLua/src/m_genmenu.cpp +++ b/plugins/MirLua/src/m_genmenu.cpp @@ -12,6 +12,16 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi) if (!(mi.flags & CMIF_TCHAR)) mi.flags |= CMIF_TCHAR; + lua_pushliteral(L, "Uid"); + lua_gettable(L, -2); + unsigned long a; + unsigned short b, c; + unsigned char d[8]; + if (sscanf_s((char*)luaL_checkstring(L, -1), "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + &a, &b, &c, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7])) + SET_UID(mi, a, b, c, d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7]); + lua_pop(L, 1); + lua_pushliteral(L, "Name"); lua_gettable(L, -2); mi.name.t = mir_utf8decodeT((char*)luaL_checkstring(L, -1)); -- cgit v1.2.3