Media: Expose more information (mods, overrides)

This commit is contained in:
Lars Mueller 2022-05-13 11:35:32 +02:00
parent f0d888d44d
commit 0a6d3b9848

@ -42,12 +42,20 @@ local function collect_media(modname)
return media return media
end end
-- TODO clean this up eventually
local paths = {} local paths = {}
local mods = {}
local overridden_paths = {}
for _, mod in ipairs(modlib.minetest.get_mod_load_order()) do for _, mod in ipairs(modlib.minetest.get_mod_load_order()) do
local mod_media = collect_media(mod.name) local mod_media = collect_media(mod.name)
for medianame, path in pairs(mod_media) do for medianame, path in pairs(mod_media) do
if paths[medianame] then
overridden_paths[medianame] = overridden_paths[medianame] or {}
table.insert(overridden_paths[medianame], paths[medianame])
end
paths[medianame] = path paths[medianame] = path
mods[medianame] = mod.name
end end
end end
return {paths = paths} return {paths = paths, mods = mods, overridden_paths = overridden_paths}