m
no edit summary
(Removed Categories) |
mNo edit summary |
||
| Line 1: | Line 1: | ||
<center>'''LoadAddOn' | <center>'''LoadAddOn'''</center> | ||
Request the loading of an On-Demand AddOn. | Request the loading of an On-Demand AddOn. | ||
| Line 14: | Line 14: | ||
:;loaded : Flag - Indicates if the AddOn was loaded, 1 if it is, nil if it is not. | :;loaded : Flag - Indicates if the AddOn was loaded, 1 if it is, nil if it is not. | ||
:;reason : String - The reason why the AddOn cannot be loaded. This is nil if the addon was loaded, otherwise it contains a code indicating the reason. (Observed reason codes: "DISABLED", "NOT_DEMAND_LOADED", "MISSING", "CORRUPT") | :;reason : String - The reason why the AddOn cannot be loaded. This is nil if the addon was loaded, otherwise it contains a code indicating the reason. (Observed reason codes: "DISABLED", "NOT_DEMAND_LOADED", "MISSING", "CORRUPT", "INTERFACE_VERSION", "DEP_MISSING", "DEP_INTERFACE_VERSION" and I asume other DEP_ reasons) | ||
=== Usage === | === Usage === | ||
local loaded,reason = LoadAddOn("MyOtherAddOn") | local loaded,reason = LoadAddOn("MyOtherAddOn") | ||
| Line 24: | Line 25: | ||
elseif (reason == "CORRUPT") then | elseif (reason == "CORRUPT") then | ||
do something else | do something else | ||
elseif (reason == "INTERFACE_VERSION") then | |||
do something different | |||
end | end | ||
else | |||
do something special | |||
end | end | ||