lots of mod info added

This commit is contained in:
2026-09-11 00:07:19 -06:00
parent 30f175a5da
commit 95bf06a012
92 changed files with 6466 additions and 67 deletions
+55 -17
View File
@@ -2,25 +2,63 @@
package.path = (arg[0]:match("@?(.*/)") or arg[0]:match("@?(.*\\)")) .. "lib" .. package.config:sub(1, 1) .. "?.lua;" .. package.path
local utility = require "utility"
local mods = {}
local blacklist = { ".DS_Store", }
utility.list("mods", function(file_name)
for _, item in ipairs(blacklist) do
if item == file_name then
return
local data = utility.load_data("info.json")
local check_dependencies = function(pack_name)
local pack_mods = data.packs[pack_name].mods
local provided_mods = {}
for mod_name in pairs(pack_mods) do
local function loop()
local selected_mod = data.mods[mod_name]
if not selected_mod then
print("Error: " .. mod_name .. " is not defined!")
return
end
if selected_mod.provides then
for _, name_provided in ipairs(selected_mod.provides) do
provided_mods[name_provided] = mod_name
end
end
end
loop()
end
mods[file_name] = true
end)
for mod_name in pairs(pack_mods) do
local function loop()
local selected_mod = data.mods[mod_name]
if not selected_mod then return end
local data = {
packs = {
["Unnamed Luanti TechAge Pack"] = {
mods = mods
}
},
mods = mods,
}
if selected_mod.required then
for _, name_required in ipairs(selected_mod.required) do
if not (pack_mods[name_required] or provided_mods[name_required]) then
print("Missing: " .. mod_name .. " requires " .. name_required)
end
end
end
end
loop()
end
end
utility.save_data(data, "info.json")
local standardize_data = function()
for name, data in pairs(data.mods) do
local function loop()
if not (type(data) == "table") then
return
end
if data.optional then table.sort(data.optional) end
if data.provides then table.sort(data.provides) end
if data.required then table.sort(data.required) end
end
loop()
end
end
check_dependencies("Unnamed Luanti TechAge Pack")
standardize_data()
utility.save_data(data)