]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - builtin/mainmenu/dlg_settings_advanced.lua
Merge branch 'master' of https://github.com/minetest/minetest
[dragonfireclient.git] / builtin / mainmenu / dlg_settings_advanced.lua
index 320db7e40cb28eae5a5fe8416b3903343cc80a7f..d6f485cf73d29c2176b1c16a51bf8b2e94e9b2d4 100644 (file)
@@ -405,6 +405,36 @@ local function parse_config_file(read_all, parse_mods)
                                file:close()
                        end
                end
+
+               -- Parse clientmods
+               local clientmods_category_initialized = false
+               local clientmods = {}
+               get_mods(core.get_clientmodpath(), "clientmods", clientmods)
+               for _, clientmod in ipairs(clientmods) do
+                       local path = clientmod.path .. DIR_DELIM .. FILENAME
+                       local file = io.open(path, "r")
+                       if file then
+                               if not clientmods_category_initialized then
+                                       fgettext_ne("Clientmods") -- not used, but needed for xgettext
+                                       table.insert(settings, {
+                                               name = "Clientmods",
+                                               level = 0,
+                                               type = "category",
+                                       })
+                                       clientmods_category_initialized = true
+                               end
+
+                               table.insert(settings, {
+                                       name = clientmod.name,
+                                       level = 1,
+                                       type = "category",
+                               })
+
+                               parse_single_file(file, path, read_all, settings, 2, false)
+
+                               file:close()
+                       end
+               end
        end
 
        return settings