WoW:Creating AddOn dependencies: Difference between revisions
m (→How do I designate a Dependent Addon?: fixed formatting) |
m (Move page script moved page Creating AddOn dependencies to Creating AddOn dependencies without leaving a redirect) |
||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
== What is a Dependent | == What is a Dependent AddOn? == | ||
A | A dependent [[AddOn]] is one that relies on another AddOn or code library for it's full functionality. Generally, an AddOn author should take into account that the user might not have the AddOn/Library required, notify the user with a single error, and suppress all other errors that might occur. | ||
== How do I designate a Dependent | == How do I designate a Dependent AddOn? == | ||
In order for a user to know your | In order for a user to know your AddOn is dependent, you must document this in the .toc file: | ||
Example Standalone | Example Standalone AddOn .toc file: | ||
<pre>##Interface: 1300 | |||
##Title: | ##Title: myAddOn | ||
##Description: Does stuff</ | ##Description: Does stuff</pre> | ||
Example Dependent | Example Dependent AddOn .toc file: | ||
<pre>##Interface: 1300 | |||
##Title: | ##Title: myAddOn | ||
##Description: Does stuff | ##Description: Does stuff | ||
##Dependencies: | ##Dependencies: ParentAddOn, OtherAddOn</pre> | ||
== What if other | == What if other AddOns only improve my AddOn? == | ||
If an | If an AddOn's code is only used to somehow improve the usability/functionality of your AddOn, but is not ''required'' for it to work, you can use the "OptionalDeps:" tag in your .toc file to have those AddOns loaded prior to your own: | ||
##Interface: 1300 | <pre>##Interface: 1300 | ||
##Title: | ##Title: myAddOn | ||
##Description: Does stuff | ##Description: Does stuff | ||
##Dependencies: | ##Dependencies: ParentAddOn, OtherAddOn | ||
##OptionalDeps: | ##OptionalDeps: MakeMyAddOnCooler</pre> | ||
Keep in mind that you must handle any errors that may occur if the user does not have the | Keep in mind that you must handle any errors that may occur if the user does not have the [[optionally dependent AddOn]]. | ||
[[Category:HOWTOs|Create AddOn Dependencies]] | |||
[[Category:AddOns|Create AddOn Dependencies]] | |||
Latest revision as of 04:47, 15 August 2023
What is a Dependent AddOn?
A dependent AddOn is one that relies on another AddOn or code library for it's full functionality. Generally, an AddOn author should take into account that the user might not have the AddOn/Library required, notify the user with a single error, and suppress all other errors that might occur.
How do I designate a Dependent AddOn?
In order for a user to know your AddOn is dependent, you must document this in the .toc file:
Example Standalone AddOn .toc file:
##Interface: 1300
##Title: myAddOn
##Description: Does stuff
Example Dependent AddOn .toc file:
##Interface: 1300
##Title: myAddOn
##Description: Does stuff
##Dependencies: ParentAddOn, OtherAddOn
What if other AddOns only improve my AddOn?
If an AddOn's code is only used to somehow improve the usability/functionality of your AddOn, but is not required for it to work, you can use the "OptionalDeps:" tag in your .toc file to have those AddOns loaded prior to your own:
##Interface: 1300
##Title: myAddOn
##Description: Does stuff
##Dependencies: ParentAddOn, OtherAddOn
##OptionalDeps: MakeMyAddOnCooler
Keep in mind that you must handle any errors that may occur if the user does not have the optionally dependent AddOn.