diff options
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_mainmenu.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index 226620fc6..f2628d0a1 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -146,22 +146,36 @@ int ModApiMainMenu::l_set_background(lua_State *L) std::string backgroundlevel(luaL_checkstring(L, 1)); std::string texturename(luaL_checkstring(L, 2)); - bool retval = false; + bool tile_image = false; + bool retval = false; + unsigned int minsize = 16; + + if (!lua_isnone(L, 3)) { + tile_image = lua_toboolean(L, 3); + } + + if (!lua_isnone(L, 4)) { + minsize = lua_tonumber(L, 4); + } if (backgroundlevel == "background") { - retval |= engine->setTexture(TEX_LAYER_BACKGROUND,texturename); + retval |= engine->setTexture(TEX_LAYER_BACKGROUND, texturename, + tile_image, minsize); } if (backgroundlevel == "overlay") { - retval |= engine->setTexture(TEX_LAYER_OVERLAY,texturename); + retval |= engine->setTexture(TEX_LAYER_OVERLAY, texturename, + tile_image, minsize); } if (backgroundlevel == "header") { - retval |= engine->setTexture(TEX_LAYER_HEADER,texturename); + retval |= engine->setTexture(TEX_LAYER_HEADER, texturename, + tile_image, minsize); } if (backgroundlevel == "footer") { - retval |= engine->setTexture(TEX_LAYER_FOOTER,texturename); + retval |= engine->setTexture(TEX_LAYER_FOOTER, texturename, + tile_image, minsize); } lua_pushboolean(L,retval); |