]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - builtin/mainmenu/textures.lua
GUIEditBox: Allow selecting and copying read-only texts
[dragonfireclient.git] / builtin / mainmenu / textures.lua
index 075f38ee073870c150776e911d8d3e990d4af170..a3acbbdeca880b69da8595dd106b38d72d35c6eb 100644 (file)
@@ -23,9 +23,9 @@ function mm_texture.init()
        mm_texture.defaulttexturedir = core.get_texturepath() .. DIR_DELIM .. "base" ..
                                                DIR_DELIM .. "pack" .. DIR_DELIM
        mm_texture.basetexturedir = mm_texture.defaulttexturedir
-       
-       mm_texture.texturepack = core.setting_get("texture_path")
-       
+
+       mm_texture.texturepack = core.settings:get("texture_path")
+
        mm_texture.gameid = nil
 end
 
@@ -39,7 +39,7 @@ function mm_texture.update(tab,gamedetails)
        if gamedetails == nil then
                return
        end
-       
+
        mm_texture.update_game(gamedetails)
 end
 
@@ -48,20 +48,20 @@ function mm_texture.reset()
        mm_texture.gameid = nil
        local have_bg      = false
        local have_overlay = mm_texture.set_generic("overlay")
-       
+
        if not have_overlay then
                have_bg = mm_texture.set_generic("background")
        end
-       
+
        mm_texture.clear("header")
        mm_texture.clear("footer")
        core.set_clouds(false)
-       
+
        mm_texture.set_generic("footer")
        mm_texture.set_generic("header")
-       
+
        if not have_bg then
-               if core.setting_getbool("menu_clouds") then
+               if core.settings:get_bool("menu_clouds") then
                        core.set_clouds(true)
                else
                        mm_texture.set_dirt_bg()
@@ -74,30 +74,30 @@ function mm_texture.update_game(gamedetails)
        if mm_texture.gameid == gamedetails.id then
                return
        end
-       
+
        local have_bg      = false
        local have_overlay = mm_texture.set_game("overlay",gamedetails)
-       
+
        if not have_overlay then
                have_bg = mm_texture.set_game("background",gamedetails)
        end
-       
+
        mm_texture.clear("header")
        mm_texture.clear("footer")
        core.set_clouds(false)
-       
+
        if not have_bg then
-               
-               if core.setting_getbool("menu_clouds") then
+
+               if core.settings:get_bool("menu_clouds") then
                        core.set_clouds(true)
                else
                        mm_texture.set_dirt_bg()
                end
        end
-       
+
        mm_texture.set_game("footer",gamedetails)
        mm_texture.set_game("header",gamedetails)
-       
+
        mm_texture.gameid = gamedetails.id
 end
 
@@ -116,7 +116,7 @@ function mm_texture.set_generic(identifier)
                        return true
                end
        end
-       
+
        if mm_texture.defaulttexturedir ~= nil then
                local path = mm_texture.defaulttexturedir .. DIR_DELIM .."menu_" ..
                                                                                identifier .. ".png"
@@ -124,13 +124,13 @@ function mm_texture.set_generic(identifier)
                        return true
                end
        end
-       
+
        return false
 end
 
 --------------------------------------------------------------------------------
 function mm_texture.set_game(identifier, gamedetails)
-       
+
        if gamedetails == nil then
                return false
        end
@@ -142,8 +142,8 @@ function mm_texture.set_game(identifier, gamedetails)
                        return true
                end
        end
-       
-       -- Find out how many randomized textures the subgame provides
+
+       -- Find out how many randomized textures the game provides
        local n = 0
        local filename
        local menu_files = core.get_dir_list(gamedetails.path .. DIR_DELIM .. "menu", false)
@@ -167,7 +167,7 @@ function mm_texture.set_game(identifier, gamedetails)
        if core.set_background(identifier, path) then
                return true
        end
-       
+
        return false
 end
 
@@ -178,8 +178,8 @@ function mm_texture.set_dirt_bg()
                        return true
                end
        end
-       
-       --use base pack
-       local minimalpath = defaulttexturedir .. "dirt_bg.png"
+
+       -- Use universal fallback texture in textures/base/pack
+       local minimalpath = defaulttexturedir .. "menu_bg.png"
        core.set_background("background", minimalpath, true, 128)
 end