This is a compatibility issue I'm wrestling with in the current moment. To clarify this topic's title, a file loaded by "require" in one addon's
hooks/load.lua file breaks superloading of the same file in the other addon.
in addon1's
hooks/load.lua:
Code: Select all
require "engine.interface.ActorProject"
in addon2's
superload/load.lua (my addon, in this case):
Code: Select all
local _M = loadPrevious(...)
local base_project = _M.project
function _M:project(
--do_something
return base_project(self, params)
end)
return _M
This occurs when both addons are given the same weighting, or in any case when the file-requiring adding loads before the superloading addon. Of course, it can be fixed by setting the other creator's addon to load
after my superloaded function has been defined, but not only is this messy, it doesn't stop similar complications from arising. Other files are very often required by the hooks/load.lua file, and it'll be a continual matter of luck whether my load.lua file happens to reference functions superloaded in an addon that now loads before mine.
What's the best way to handle this? Does something need fixing? Or have I missed something glaringly obvious?
I'll spend some time sifting through the addon-loading code, but don't have time to for the minute. In the meantime, thank you for any clues you can throw my way!