View Single Post
11/26/14, 02:26 PM   #6
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
Originally Posted by votan View Post
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:
  1. if(addOnName == "otherAddon") then
  2.     flag = true
  3. elseif(addOnName == "yourAddon") then
  4.     EVENT_MANAGER:UnregisterForEvent("addonLoadedFunction", EVENT_ADD_ON_LOADED)
  5. else
  6.     return
  7. 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.

Last edited by Randactyl : 11/26/14 at 02:28 PM.
  Reply With Quote