1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Add luacheck to check builtin (#7895)

This commit is contained in:
rubenwardy 2019-08-06 19:30:18 +01:00 committed by GitHub
parent 8da35c22d1
commit 8e757859d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 202 additions and 140 deletions

View 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.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)