summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_popup.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2016-01-02 23:03:00 +0000
committerAlexander Lantsev <aunsane@gmail.com>2016-01-02 23:03:00 +0000
commita5e4d2be50ad50f639b7aabc6de7c115c435830e (patch)
tree2f4c62674adced1f20792a9870656e4b2fedcefc /plugins/MirLua/src/m_popup.cpp
parentbbd29a62e50b648ad5f40e997c094d02d8da5bc7 (diff)
MirLua:
- fixed m_schedule - massive function replace git-svn-id: http://svn.miranda-ng.org/main/trunk@16004 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_popup.cpp')
-rw-r--r--plugins/MirLua/src/m_popup.cpp45
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);