WoW:API LoadAddOn: Difference between revisions

m
Move page script moved page API LoadAddOn to WoW:API LoadAddOn without leaving a redirect
No edit summary
m (Move page script moved page API LoadAddOn to WoW:API LoadAddOn without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 8: Line 8:


:;index : Integer - The index of the AddOn in the user's AddOn list. Note that you cannot access Blizzard-provided AddOns through this mechanism.
:;index : Integer - The index of the AddOn in the user's AddOn list. Note that you cannot access Blizzard-provided AddOns through this mechanism.
:;name : String - The name of the AddOn to be queries. You can access Blizzard-provided AddOns through this mechanism.
:;name : String - The name of the AddOn to be queried. You can access Blizzard-provided AddOns through this mechanism.
 
=== Returns ===
=== Returns ===
:loaded, reason
:loaded, reason
Line 16: Line 17:


=== Usage ===
=== Usage ===
  local loaded,reason = LoadAddOn("MyOtherAddOn")
  local loaded, reason = LoadAddOn("MyOtherAddOn")
  if (not loaded) then
   if (reason == "DISABLED") then
if not loaded then
    do stuff
   if reason == "DISABLED" then
   elseif (reason == "MISSING") then
    -- do stuff
    do other stuff
   elseif reason == "MISSING" then
   elseif (reason == "CORRUPT") then
    -- do other stuff
    do something else
   elseif reason == "CORRUPT" then
   elseif (reason == "INTERFACE_VERSION") then
    -- do something else
    do something different
   elseif reason == "INTERFACE_VERSION" then
    -- do something different
   end
   end
  else
else
   do something special
   -- do something special
  end
end


== Details ==
== Details ==
Line 49: Line 51:
:;MISSING : "Missing"; -- The addon is physically not there.
:;MISSING : "Missing"; -- The addon is physically not there.
:;NOT_DEMAND_LOADED : "Not loadable on demand"; -- As of 1.8 only addons marked as LoadOnDemand can be loaded via this function.
:;NOT_DEMAND_LOADED : "Not loadable on demand"; -- As of 1.8 only addons marked as LoadOnDemand can be loaded via this function.
:;INTERACE_VERSION : -- Unknown, presumably the interface version in the .toc file is incorrect
Anonymous user