Originally Posted by votan
Hi.
In the Wiki is stated, that a callback of EVENT_ADD_ON_LOADED is called for all addons.
This is the reason why we always have to check for our own addon name.
Isn't that exactly what you need?
Cheers
|
I like this the best - especially if the addon you are checking for doesn't have any global functions.
Just add the addon to your OptionalDependsOn and then
Lua Code:
if(addOnName == "otherAddon") then
flag = true
elseif(addOnName == "yourAddon") then
EVENT_MANAGER:UnregisterForEvent("addonLoadedFunction", EVENT_ADD_ON_LOADED)
else
return
end
I actually used a version of this for Advanced Filters to create a filter for Item Saver before I changed the way filters could be added.