diff --git a/game/engines/default/engine/Birther.lua b/game/engines/default/engine/Birther.lua index 7e863559fdf046f0043cfe35fda2b0cb3ac3508e..c2d8ae0ba517f64d9fe60b27c923997269898931 100644 --- a/game/engines/default/engine/Birther.lua +++ b/game/engines/default/engine/Birther.lua @@ -50,7 +50,6 @@ end function _M:newBirthDescriptor(t) assert(t.name, "no birth name") assert(t.type, "no birth type") - print("==============**************************", t.name) t.short_name = t.short_name or t.name t.short_name = t.short_name:upper():gsub("[ ]", "_") t.display_name = t.display_name or t.name diff --git a/game/engines/default/engine/Module.lua b/game/engines/default/engine/Module.lua index 8fd5510ae95483cc784125ba235d45c5431dacae..704d30af56f4d7613017e39772d22fccb127a026 100644 --- a/game/engines/default/engine/Module.lua +++ b/game/engines/default/engine/Module.lua @@ -236,6 +236,34 @@ function _M:listVaultSavesForCurrent() return lss end +--- List all available addons +function _M:loadAddons(mod) + local load = function(dir) + local add_def = loadfile(team and (dir.."/mod/init.lua") or (dir.."/init.lua")) + if add_def then + local add = {} + setfenv(add_def, add) + add_def() + + if engine.version_string(add.version) == engine.version_string(mod.version) and add.for_module == mod.short_name then + print("Binding addon", add.long_name) + if add.superload then fs.mount(fs.getRealPath(dir).."/superload", "/mod/addons/"..add.short_name.."/superload", false) print(" * with superload") end + if add.overload then fs.mount(fs.getRealPath(dir).."/overload", "/", true) print(" * with overload") end + end + end + end + + local adds = {} + for i, short_name in ipairs(fs.list("/addons/")) do if short_name:find("^"..mod.short_name.."%-") then + local dir = "/addons/"..short_name + print("Checking addon", short_name, ":: (as dir)", fs.exists(dir.."/init.lua"), ":: (as teaa)", short_name:find(".teaa$"), "") + if fs.exists(dir.."/init.lua") then + load(dir) + elseif short_name:find(".team$") then + end + end end +end + --- Make a module loadscreen function _M:loadScreen(mod) core.display.forceRedraw() @@ -390,6 +418,8 @@ function _M:instanciate(mod, name, new_game, no_reboot) end end + self:loadAddons(mod) + profile:addStatFields(unpack(mod.profile_stats_fields or {})) profile:setConfigsBatch(true) profile:loadModuleProfile(mod.short_name, mod) diff --git a/ideas/DLCs.ods b/ideas/DLCs.ods index e3d9b6d32bf1ac0eacae8b061cc5db424770e5b4..05ad92a922ecf6cbfce64de6a99ebc0eb3d50759 100644 Binary files a/ideas/DLCs.ods and b/ideas/DLCs.ods differ diff --git a/ideas/setting-eyal.ods b/ideas/setting-eyal.ods index 72fec361aac7dd714174a9e4158ef272e7d2a8d3..c0ebb4b4d14c05f24ce8a35bfb13e731d929d90e 100644 Binary files a/ideas/setting-eyal.ods and b/ideas/setting-eyal.ods differ