diff options
author | sapier <Sapier at GMX dot net> | 2014-05-17 12:06:36 +0200 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2014-06-14 20:51:57 +0200 |
commit | 7b3602bab3a697a2729b057c5e8a354337482389 (patch) | |
tree | 5cc0ce970c724bdb984f6cdf9cf831b6b7c61631 /src/script | |
parent | 5b3bbde1efe61d2d515c9323b6d031621316100c (diff) | |
download | minetest-7b3602bab3a697a2729b057c5e8a354337482389.tar.gz minetest-7b3602bab3a697a2729b057c5e8a354337482389.tar.bz2 minetest-7b3602bab3a697a2729b057c5e8a354337482389.zip |
Fix regression dirt texture not beeing default in non cloud menu
Diffstat (limited to 'src/script')
-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); |