1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Fix regression dirt texture not beeing default in non cloud menu

This commit is contained in:
sapier 2014-05-17 12:06:36 +02:00
parent 5b3bbde1ef
commit 7b3602bab3
6 changed files with 133 additions and 57 deletions

View file

@ -60,9 +60,12 @@ function mm_texture.reset()
mm_texture.set_generic("footer")
mm_texture.set_generic("header")
if not have_bg and
core.setting_getbool("menu_clouds") then
if not have_bg then
if core.setting_getbool("menu_clouds") then
core.set_clouds(true)
else
mm_texture.set_dirt_bg()
end
end
end
@ -83,9 +86,13 @@ function mm_texture.update_game(gamedetails)
mm_texture.clear("footer")
core.set_clouds(false)
if not have_bg and
core.setting_getbool("menu_clouds") then
if not have_bg then
if core.setting_getbool("menu_clouds") then
core.set_clouds(true)
else
mm_texture.set_dirt_bg()
end
end
mm_texture.set_game("footer",gamedetails)
@ -144,3 +151,16 @@ function mm_texture.set_game(identifier,gamedetails)
return false
end
function mm_texture.set_dirt_bg()
if mm_texture.texturepack ~= nil then
local path = mm_texture.texturepack .. DIR_DELIM .."default_dirt.png"
if core.set_background("background", path, true, 128) then
return true
end
end
--use base pack
local minimalpath = defaulttexturedir .. "dirt_bg.png"
core.set_background("background", minimalpath, true, 128)
end