summaryrefslogtreecommitdiff
path: root/plugins/MirLua/Modules
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2016-06-23 13:01:49 +0000
committerAlexander Lantsev <aunsane@gmail.com>2016-06-23 13:01:49 +0000
commit50b6a5ca2c5652fdf4e5fab69d9918c0f633cfb5 (patch)
tree47d14db48369b7aac927ab77189ec842f4ef9373 /plugins/MirLua/Modules
parent1406bb2d649a561151ea9c44f2a3da54704d3ff7 (diff)
MirLua: reworked m_core and CMLuaScript
git-svn-id: http://svn.miranda-ng.org/main/trunk@17023 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/Modules')
-rw-r--r--plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp b/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp
index de2fbdc021..004eee6b87 100644
--- a/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp
+++ b/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp
@@ -36,14 +36,14 @@ static int lua_AddButton(lua_State *L)
{
if (lua_type(L, 1) != LUA_TTABLE)
{
- lua_pushlightuserdata(L, 0);
+ lua_pushboolean(L, false);
return 1;
}
- BBButton* bbb = MakeBBButton(L);
+ BBButton *bbb = MakeBBButton(L);
INT_PTR res = CallService(MS_BB_ADDBUTTON, 0, (LPARAM)bbb);
- lua_pushinteger(L, res);
+ lua_pushboolean(L, !res);
return 1;
}
@@ -52,14 +52,14 @@ static int lua_ModifyButton(lua_State *L)
{
if (lua_type(L, 1) != LUA_TTABLE)
{
- lua_pushlightuserdata(L, 0);
+ lua_pushboolean(L, false);
return 1;
}
- BBButton* bbb = MakeBBButton(L);
+ BBButton *bbb = MakeBBButton(L);
INT_PTR res = CallService(MS_BB_MODIFYBUTTON, 0, (LPARAM)bbb);
- lua_pushinteger(L, res);
+ lua_pushboolean(L, !res);
mir_free(bbb->pszModuleName);
mir_free(bbb->ptszTooltip);
@@ -70,14 +70,15 @@ static int lua_ModifyButton(lua_State *L)
static int lua_RemoveButton(lua_State *L)
{
- ptrA szModuleName(mir_utf8decodeA(luaL_checkstring(L, 1)));
+ ptrA module(mir_utf8decodeA(luaL_checkstring(L, 1)));
+ int buttonId = luaL_checkinteger(L, 2);
BBButton mbb = { sizeof(BBButton) };
- mbb.pszModuleName = szModuleName;
- mbb.dwButtonID = luaL_checkinteger(L, 2);
+ mbb.pszModuleName = module;
+ mbb.dwButtonID = buttonId;
- INT_PTR res = ::CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&mbb);
- lua_pushinteger(L, res);
+ INT_PTR res = CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&mbb);
+ lua_pushboolean(L, !res);
return 1;
}