Provide API for other mods to load their owm modules.

This commit is contained in:
IQuant 2024-10-12 13:55:31 +03:00
parent 0f55a96df4
commit d5e7f54ef1
7 changed files with 47 additions and 10 deletions

View file

@ -119,6 +119,13 @@ local function load_modules()
ctx.load_system("wand_charm")
end
local function load_extra_modules()
print("Starting to load extra stuff")
for _, file in ipairs(ModLuaFileGetAppends("mods/quant.ew/files/api/extra_modules.lua")) do
ctx.dofile_and_add_hooks(file)
end
end
local function is_suitable_target(entity)
return EntityGetIsAlive(entity) and not EntityHasTag(entity,"ew_notplayer")
end
@ -410,8 +417,9 @@ function OnModPreInit()
print("Entangled worlds init ok")
end
function OnModInit() end
function OnModInit()
load_extra_modules()
end
function OnModPostInit()
ctx.hook.on_late_init()