mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 15:23:48 +01:00
Media: Expose more information (mods, overrides)
This commit is contained in:
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}
|
||||||
|
Loading…
Reference in New Issue
Block a user