m
Move page script moved page API LoadAddOn to WoW:API LoadAddOn without leaving a redirect
(Moved Reason Codes to →Details) |
m (Move page script moved page API LoadAddOn to WoW:API LoadAddOn without leaving a redirect) |
||
| (4 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
{{wowapi}} | {{wowapi}} | ||
Request the loading of an On-Demand AddOn. | Request the loading of an On-Demand AddOn. | ||
loaded, reason = LoadAddOn(index or "name") | |||
== Parameters == | == Parameters == | ||
=== Arguments === | === Arguments === | ||
| Line 10: | 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 | :;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 18: | Line 17: | ||
=== Usage === | === Usage === | ||
local loaded,reason = LoadAddOn("MyOtherAddOn") | local loaded, reason = LoadAddOn("MyOtherAddOn") | ||
if | if not loaded then | ||
if reason == "DISABLED" then | |||
elseif | -- do stuff | ||
elseif reason == "MISSING" then | |||
elseif | -- do other stuff | ||
elseif reason == "CORRUPT" then | |||
elseif | -- do something else | ||
elseif reason == "INTERFACE_VERSION" then | |||
-- do something different | |||
end | end | ||
else | |||
do something special | -- do something special | ||
end | |||
== Details == | == Details == | ||
| Line 51: | 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 | |||
-- | |||