mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
Try to add a detour to whatever is called by RegisterSpawnFunction
This commit is contained in:
parent
c6524b07bb
commit
fbdbb30d60
2 changed files with 20 additions and 19 deletions
|
@ -1,5 +1,23 @@
|
|||
local orig_RegisterSpawnFunction = RegisterSpawnFunction
|
||||
|
||||
local orig_do_mod_appends = do_mod_appends
|
||||
|
||||
-- The root file that imported everything else.
|
||||
-- TODO: maybe dofile should be patched?
|
||||
EwImportRoot = "???"
|
||||
|
||||
orig_do_mod_appends = do_mod_appends
|
||||
do_mod_appends = function(filename, ...)
|
||||
--do_mod_appends = orig_do_mod_appends
|
||||
orig_do_mod_appends(filename, ...)
|
||||
EwImportRoot = filename
|
||||
end
|
||||
|
||||
function RegisterSpawnFunction(color, fn_name)
|
||||
|
||||
end
|
||||
local root_id = "???" -- TODO, this should be id (path) of a file that actually calls RegisterSpawnFunction, that we can dofile to call related functions manually.
|
||||
detour_fn_name = "ew_detour_"..fn_name
|
||||
_G[detour_fn_name] = function(...)
|
||||
_G[fn_name](...)
|
||||
end
|
||||
RegisterSpawnFunction(color, detour_fn_name)
|
||||
end
|
||||
|
|
|
@ -2,21 +2,4 @@ ModLuaFileAppend("data/scripts/director_helpers.lua", "mods/quant.ew/files/syste
|
|||
|
||||
local module = {}
|
||||
|
||||
local module.files_with_spawnhooks = {}
|
||||
|
||||
for line in string.gmatch(ModTextFileGetContent("mods/quant.ew/files/system/wang_hooks/files_with_spawnhooks.txt"), "(.-)\n") do
|
||||
-- print("Interned", line)
|
||||
table.insert(module.files_with_spawnhooks, line)
|
||||
end
|
||||
|
||||
local function patch_file(filename)
|
||||
|
||||
end
|
||||
|
||||
function module.on_late_init()
|
||||
for _, filename in ipairs(module.files_with_spawnhooks) do
|
||||
patch_file(filename)
|
||||
end
|
||||
end
|
||||
|
||||
return module
|
Loading…
Add table
Add a link
Reference in a new issue