aboutsummaryrefslogtreecommitdiff
ModeNameSize
-rw-r--r--.gitattributes28logplain
-rw-r--r--.gitignore1481logplain
-rw-r--r--.mailmap2087logplain
-rw-r--r--.travis.yml349logplain
-rw-r--r--CMakeLists.txt8119logplain
-rw-r--r--README.txt21736logplain
d---------build / android34logplain
d---------builtin198logplain
d---------client71logplain
d---------cmake / Modules34logplain
d---------doc436logplain
d---------fonts3348logplain
d---------games / minimal34logplain
-rw-r--r--minetest.conf.example22951logplain
d---------misc359logplain
d---------mods41logplain
d---------po742logplain
d---------src10117logplain
d---------textures81logplain
d---------util416logplain
>"singleplayer" then mm_texture.reset() return end if gamedetails == nil then return end mm_texture.update_game(gamedetails) end -------------------------------------------------------------------------------- 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 core.set_clouds(true) else mm_texture.set_dirt_bg() end end end -------------------------------------------------------------------------------- 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 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 -------------------------------------------------------------------------------- function mm_texture.clear(identifier) core.set_background(identifier,"") end -------------------------------------------------------------------------------- function mm_texture.set_generic(identifier) --try texture pack first if mm_texture.texturepack ~= nil then local path = mm_texture.texturepack .. DIR_DELIM .."menu_" .. identifier .. ".png" if core.set_background(identifier,path) then return true end end if mm_texture.defaulttexturedir ~= nil then local path = mm_texture.defaulttexturedir .. DIR_DELIM .."menu_" .. identifier .. ".png" if core.set_background(identifier,path) then return true end end return false end -------------------------------------------------------------------------------- function mm_texture.set_game(identifier, gamedetails) if gamedetails == nil then return false end if mm_texture.texturepack ~= nil then local path = mm_texture.texturepack .. DIR_DELIM .. gamedetails.id .. "_menu_" .. identifier .. ".png" if core.set_background(identifier, path) then return true end end -- Find out how many randomized textures the subgame provides local n = 0 local filename local menu_files = core.get_dir_list(gamedetails.path .. DIR_DELIM .. "menu", false) for i = 1, #menu_files do filename = identifier .. "." .. i .. ".png"