aboutsummaryrefslogtreecommitdiff
path: root/builtin/mainmenu/textures.lua
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-08-06 19:30:18 +0100
committerGitHub <noreply@github.com>2019-08-06 19:30:18 +0100
commit8e757859d6a6bf6482480904e8485e9344e567ab (patch)
tree3304aa9393a753b85143389c6f6ffec990cfa12e /builtin/mainmenu/textures.lua
parent8da35c22d1c8933090330b2f3c44b4cf2c6e6760 (diff)
downloadminetest-8e757859d6a6bf6482480904e8485e9344e567ab.tar.gz
minetest-8e757859d6a6bf6482480904e8485e9344e567ab.tar.bz2
minetest-8e757859d6a6bf6482480904e8485e9344e567ab.zip
Add luacheck to check builtin (#7895)
Diffstat (limited to 'builtin/mainmenu/textures.lua')
-rw-r--r--builtin/mainmenu/textures.lua40
1 files changed, 20 insertions, 20 deletions
diff --git a/builtin/mainmenu/textures.lua b/builtin/mainmenu/textures.lua
index 68b05dc18..a3acbbdec 100644
--- a/builtin/mainmenu/textures.lua
+++ b/builtin/mainmenu/textures.lua
@@ -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.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,18 +48,18 @@ 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.settings:get_bool("menu_clouds") then
core.set_clouds(true)
@@ -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.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,7 +142,7 @@ function mm_texture.set_game(identifier, gamedetails)
return true
end
end
-
+
-- Find out how many randomized textures the game provides
local n = 0
local filename
@@ -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,7 +178,7 @@ function mm_texture.set_dirt_bg()
return true
end
end
-
+
-- Use universal fallback texture in textures/base/pack
local minimalpath = defaulttexturedir .. "menu_bg.png"
core.set_background("background", minimalpath, true, 128)