]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - builtin/mainmenu/modmgr.lua
Add new leaves style - simple (glasslike drawtype)
[dragonfireclient.git] / builtin / mainmenu / modmgr.lua
index dcd1eb256e341d87cb267437aed2e7d4d77ff0cc..89292ed52e6298a302181365b7bec42a242f7256 100644 (file)
 
 --------------------------------------------------------------------------------
 function get_mods(path,retval,modpack)
+       local mods = core.get_dir_list(path, true)
+       
+       for i=1, #mods, 1 do
+               if mods[i]:sub(1,1) ~= "." then
+                       local toadd = {}
+                       local modpackfile = nil
+
+                       toadd.name = mods[i]
+                       toadd.path = path .. DIR_DELIM .. mods[i] .. DIR_DELIM
+                       if modpack ~= nil and
+                               modpack ~= "" then
+                               toadd.modpack = modpack
+                       else
+                               local filename = path .. DIR_DELIM .. mods[i] .. DIR_DELIM .. "modpack.txt"
+                               local error = nil
+                               modpackfile,error = io.open(filename,"r")
+                       end
 
-       local mods = core.get_dirlist(path,true)
-       for i=1,#mods,1 do
-               local toadd = {}
-               local modpackfile = nil
-
-               toadd.name = mods[i]
-               toadd.path = path .. DIR_DELIM .. mods[i] .. DIR_DELIM
-               if modpack ~= nil and
-                       modpack ~= "" then
-                       toadd.modpack = modpack
-               else
-                       local filename = path .. DIR_DELIM .. mods[i] .. DIR_DELIM .. "modpack.txt"
-                       local error = nil
-                       modpackfile,error = io.open(filename,"r")
-               end
-
-               if modpackfile ~= nil then
-                       modpackfile:close()
-                       toadd.is_modpack = true
-                       table.insert(retval,toadd)
-                       get_mods(path .. DIR_DELIM .. mods[i],retval,mods[i])
-               else
-                       table.insert(retval,toadd)
+                       if modpackfile ~= nil then
+                               modpackfile:close()
+                               toadd.is_modpack = true
+                               table.insert(retval,toadd)
+                               get_mods(path .. DIR_DELIM .. mods[i],retval,mods[i])
+                       else
+                               table.insert(retval,toadd)
+                       end
                end
        end
 end
@@ -92,7 +94,7 @@ function modmgr.getbasefolder(temppath)
                                }
        end
 
-       local subdirs = core.get_dirlist(temppath,true)
+       local subdirs = core.get_dir_list(temppath, true)
 
        --only single mod or modpack allowed
        if #subdirs ~= 1 then
@@ -319,8 +321,10 @@ function modmgr.get_worldconfig(worldpath)
        for key,value in pairs(worldfile:to_table()) do
                if key == "gameid" then
                        worldconfig.id = value
-               else
+               elseif key:sub(0, 9) == "load_mod_" then
                        worldconfig.global_mods[key] = core.is_yes(value)
+               else
+                       worldconfig[key] = value
                end
        end