AddOn: Difference between revisions
Line 13: | Line 13: | ||
You need to create a file named <YourAddOnDirectoryName>.toc in "Interface\AddOns\YourAddOnDirectoryName\". | You need to create a file named <YourAddOnDirectoryName>.toc in "Interface\AddOns\YourAddOnDirectoryName\". | ||
This file needs to have two things - an interface keyword with a correct interface number, and the filename of an xml file you want to load. | This file needs to have two things - an interface keyword with a correct interface number, and the filename of an xml file you want to load. However, Blizzard asks that you include at least four lines. | ||
Minimal .toc file contents: | Minimal .toc file contents: | ||
## Interface: 4062 | ## Interface: 4062 | ||
## Title: My Add On | |||
## Description: What my addon does | |||
YourAddOnDirectoryName.xml | YourAddOnDirectoryName.xml | ||
Revision as of 21:07, 18 November 2004
What is an AddOn?
AddOns are, basically, somewhat self-contained UI pieces. AddOns can be dependent on other AddOns to work though. There is currently no size restriction on AddOns, so you can make one huge lump of lua/xml if you want.
How do I create an AddOn?
First of all, you need to create a new directory in Interface\AddOns. The name of this directory is kinda important, as it is what other AddOns use to refer to your AddOn (in dependencies and stuff). I would therefore recommend that you do not use version numbers in your AddOn directory name, or you will run the risk of having other AddOns "break" when you upgrade the version. This will probably lead to people either not depending on your AddOn or, worse, that they'll keep using an old version.
Major version numbers as part of AddOn directory names might work, though.
What is this .toc file?
You need to create a file named <YourAddOnDirectoryName>.toc in "Interface\AddOns\YourAddOnDirectoryName\".
This file needs to have two things - an interface keyword with a correct interface number, and the filename of an xml file you want to load. However, Blizzard asks that you include at least four lines.
Minimal .toc file contents:
## Interface: 4062 ## Title: My Add On ## Description: What my addon does YourAddOnDirectoryName.xml
Special case : Bindings.xml
If you include a Bindings.xml file, it does not have to be included in your .toc list of files to load - WoW loads this file automatically.
For a more detailed look on Bindings.xml, click the wiki word.
What other keywords are there in the .toc file?
Please check out AddOn_Keywords for a more detailed list.