1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix background/overlay/footer/header handling

Add missing file headers
This commit is contained in:
sapier 2013-07-16 20:56:18 +02:00 committed by PilzAdam
parent 5160be91ae
commit e3827fbc23
6 changed files with 366 additions and 286 deletions

View file

@ -541,8 +541,7 @@ end
--------------------------------------------------------------------------------
function modmgr.installmod(modfilename,basename)
local modfile = identify_filetype(modfilename)
local modfile = modmgr.identify_filetype(modfilename)
local modpath = modmgr.extract(modfile)
if modpath == nil then
@ -1008,3 +1007,41 @@ function modmgr.refresh_globals()
{}
)
end
--------------------------------------------------------------------------------
function modmgr.identify_filetype(name)
if name:sub(-3):lower() == "zip" then
return {
name = name,
type = "zip"
}
end
if name:sub(-6):lower() == "tar.gz" or
name:sub(-3):lower() == "tgz"then
return {
name = name,
type = "tgz"
}
end
if name:sub(-6):lower() == "tar.bz2" then
return {
name = name,
type = "tbz"
}
end
if name:sub(-2):lower() == "7z" then
return {
name = name,
type = "7z"
}
end
return {
name = name,
type = "ukn"
}
end