diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index 91a4099a0..fa8349ff7 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -57,6 +57,7 @@ void CLuaInstCCText::CCTextRegister(lua_State *L) { "new", CLuaInstCCText::CCTextNew }, { "paint", CLuaInstCCText::CCTextPaint }, { "hide", CLuaInstCCText::CCTextHide }, + { "kill", CLuaInstCCText::CCTextKill }, { "setText", CLuaInstCCText::CCTextSetText }, { "getLines", CLuaInstCCText::CCTextGetLines }, { "scroll", CLuaInstCCText::CCTextScroll }, @@ -201,6 +202,23 @@ int CLuaInstCCText::CCTextHide(lua_State *L) return 0; } +int CLuaInstCCText::CCTextKill(lua_State *L) +{ + lua_assert(lua_istable(L,1)); + CLuaCCText *D = CCTextCheck(L, 1); + if (!D) return 0; + + lua_Unsigned color_bg = (lua_Unsigned)COL_BACKGROUND_PLUS_0; + lua_Integer corner_radius = -1; + if (lua_istable(L, -1)){ + tableLookup(L, "color_bg", color_bg); + tableLookup(L, "corner_radius", corner_radius); + } + + D->ct->kill(color_bg, corner_radius, ~CC_FBDATA_TYPES); + return 0; +} + int CLuaInstCCText::CCTextSetText(lua_State *L) { lua_assert(lua_istable(L,1)); diff --git a/src/gui/lua/lua_cc_text.h b/src/gui/lua/lua_cc_text.h index c0f31d639..89e4c556d 100644 --- a/src/gui/lua/lua_cc_text.h +++ b/src/gui/lua/lua_cc_text.h @@ -46,6 +46,7 @@ class CLuaInstCCText static int CCTextNew(lua_State *L); static int CCTextPaint(lua_State *L); static int CCTextHide(lua_State *L); + static int CCTextKill(lua_State *L); static int CCTextSetText(lua_State *L); static int CCTextGetLines(lua_State *L); static int CCTextScroll(lua_State *L);