diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 571ad7e35..ee87741d5 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -239,6 +239,7 @@ namespace NLGUI int luaShowDiv(CLuaState &ls); int luaParseHtml(CLuaState &ls); int luaRenderHtml(CLuaState &ls); + int luaSetBackground(CLuaState &ls); REFLECT_EXPORT_START(CGroupHTML, CGroupScrollText) REFLECT_LUA_METHOD("browse", luaBrowse) @@ -252,6 +253,7 @@ namespace NLGUI REFLECT_LUA_METHOD("showDiv", luaShowDiv) REFLECT_LUA_METHOD("parseHtml", luaParseHtml) REFLECT_LUA_METHOD("renderHtml", luaRenderHtml) + REFLECT_LUA_METHOD("setBackground", luaSetBackground) REFLECT_STRING("url", getURL, setURL) REFLECT_STRING("html", getHTML, setHTML) REFLECT_FLOAT("timeout", getTimeout, setTimeout) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index c0721f3ed..a2906f017 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -4509,6 +4509,23 @@ namespace NLGUI return 0; } +// *************************************************************************** + int CGroupHTML::luaSetBackground(CLuaState &ls) + { + const char *funcName = "renderHtml"; + CLuaIHM::checkArgCount(ls, funcName, 3); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); + CLuaIHM::checkArgType(ls, funcName, 2, LUA_TBOOLEAN); + CLuaIHM::checkArgType(ls, funcName, 3, LUA_TBOOLEAN); + std::string image = ls.toString(1); + bool scale = ls.toBoolean(2); + bool repeat = ls.toBoolean(3); + + setBackground(image, scale, repeat); + + return 0; + } + // *************************************************************************** int CGroupHTML::luaInsertText(CLuaState &ls) {