diff options
Diffstat (limited to 'plugins/MirLua/src/m_popup.cpp')
-rw-r--r-- | plugins/MirLua/src/m_popup.cpp | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/plugins/MirLua/src/m_popup.cpp b/plugins/MirLua/src/m_popup.cpp index 2127f70f5f..c99ea7c146 100644 --- a/plugins/MirLua/src/m_popup.cpp +++ b/plugins/MirLua/src/m_popup.cpp @@ -4,33 +4,27 @@ static POPUPDATAT* MakePopupData(lua_State *L) {
POPUPDATAT *ppd = (POPUPDATAT*)mir_calloc(sizeof(POPUPDATAT));
- lua_pushliteral(L, "ContactName");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "ContactName");
mir_tstrcpy(ppd->lptzContactName, ptrT(mir_utf8decodeT(lua_tostring(L, -1))));
lua_pop(L, 1);
- lua_pushliteral(L, "Text");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "Text");
mir_tstrcpy(ppd->lptzText, ptrT(mir_utf8decodeT(luaL_checkstring(L, -1))));
lua_pop(L, 1);
- lua_pushliteral(L, "hContact");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "hContact");
ppd->lchContact = lua_tointeger(L, -1);
lua_pop(L, 1);
- lua_pushliteral(L, "ColorBack");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "ColorBack");
ppd->colorBack = lua_tonumber(L, -1);
lua_pop(L, 1);
- lua_pushliteral(L, "ColorText");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "ColorText");
ppd->colorText = lua_tonumber(L, -1);
lua_pop(L, 1);
- lua_pushliteral(L, "Seconds");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "Seconds");
ppd->iSeconds = lua_tointeger(L, -1);
lua_pop(L, 1);
@@ -58,51 +52,42 @@ static POPUPDATA2* MakePopupData2(lua_State *L) POPUPDATA2 *ppd = (POPUPDATA2*)mir_calloc(sizeof(POPUPDATA2));
ppd->cbSize = sizeof(POPUPDATA2);
- lua_pushliteral(L, "Flags");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "Flags");
ppd->flags = lua_tointeger(L, -1);
lua_pop(L, 1);
if (!(ppd->flags & PU2_TCHAR))
ppd->flags |= PU2_TCHAR;
- lua_pushliteral(L, "Title");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "Title");
ppd->lptzTitle = mir_utf8decodeT(lua_tostring(L, -1));
lua_pop(L, 1);
- lua_pushliteral(L, "Text");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "Text");
ppd->lptzText = mir_utf8decodeT(luaL_checkstring(L, -1));
lua_pop(L, 1);
- lua_pushliteral(L, "hContact");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "hContact");
ppd->lchContact = lua_tointeger(L, -1);
lua_pop(L, 1);
- lua_pushliteral(L, "ColorBack");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "ColorBack");
ppd->colorBack = lua_tonumber(L, -1);
lua_pop(L, 1);
- lua_pushliteral(L, "ColorText");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "ColorText");
ppd->colorText = lua_tonumber(L, -1);
lua_pop(L, 1);
- lua_pushliteral(L, "hEvent");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "hEvent");
ppd->lchEvent = lua_touserdata(L, -1);
lua_pop(L, 1);
- lua_pushliteral(L, "Timestamp");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "Timestamp");
ppd->dwTimestamp = lua_tonumber(L, -1);
lua_pop(L, 1);
- lua_pushliteral(L, "Timeout");
- lua_gettable(L, -2);
+ lua_getfield(L, -1, "Timeout");
ppd->iSeconds = lua_tointeger(L, -1);
lua_pop(L, 1);
|