diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 6fad87af7..7eaec84a1 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 86 +#define LUA_API_VERSION_MINOR 87 diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index bec918eef..6bf623e70 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -57,6 +57,7 @@ void CLuaInstCCWindow::CCWindowRegister(lua_State *L) { "footer_height", CLuaInstCCWindow::CCWindowGetFooterHeight_dep }, /* function 'footer_height' is deprecated */ { "setCenterPos", CLuaInstCCWindow::CCWindowSetCenterPos }, { "setDimensionsAll", CLuaInstCCWindow::CCWindowSetDimensionsAll }, + { "setBodyImage", CCWindowSetBodyImage }, { "__gc", CLuaInstCCWindow::CCWindowDelete }, { NULL, NULL } }; @@ -341,6 +342,20 @@ int CLuaInstCCWindow::CCWindowSetCenterPos(lua_State *L) return 0; } +int CLuaInstCCWindow::CCWindowSetBodyImage(lua_State *L) +{ + lua_assert(lua_istable(L,1)); + CLuaCCWindow *D = CCWindowCheck(L, 1); + if (!D) return 0; + + std::string image = ""; + if (lua_istable(L, -1)) + tableLookup(L, "image_path", image); + + D->w->setBodyBGImage(image); + return 0; +} + int CLuaInstCCWindow::CCWindowDelete(lua_State *L) { LUA_DEBUG("CLuaInstCCWindow::%s %d\n", __func__, lua_gettop(L)); diff --git a/src/gui/lua/lua_cc_window.h b/src/gui/lua/lua_cc_window.h index 2c5c961f3..936de6a09 100644 --- a/src/gui/lua/lua_cc_window.h +++ b/src/gui/lua/lua_cc_window.h @@ -52,6 +52,7 @@ class CLuaInstCCWindow : CCHeaderTypes static int CCWindowSetCenterPos(lua_State *L); static int CCWindowDelete(lua_State *L); static int CCWindowSetDimensionsAll(lua_State *L); + static int CCWindowSetBodyImage(lua_State *L); }; #endif //_LUACCWINDOW_H