From 7b3602bab3a697a2729b057c5e8a354337482389 Mon Sep 17 00:00:00 2001 From: sapier Date: Sat, 17 May 2014 12:06:36 +0200 Subject: Fix regression dirt texture not beeing default in non cloud menu --- builtin/mainmenu/textures.lua | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'builtin') diff --git a/builtin/mainmenu/textures.lua b/builtin/mainmenu/textures.lua index cec12235c..56992c0c5 100644 --- a/builtin/mainmenu/textures.lua +++ b/builtin/mainmenu/textures.lua @@ -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 -- cgit v1.2.3