49
edits
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
== TOC file format == | == TOC file format == | ||
There are three main line types: lines beginning with "## " designate a .toc tag, which contains information that may be used by the client | There are three main line types: lines beginning with "## " designate a '.toc' tag, which contains information that may be used by the client. For instance, "## Title : Waiting for Bob" communicates to the client that the addon should be called "Waiting for Bob" in the addons list, rather than simply "Bob" as its folder name would imply. The lines without this prefix specify the files that should be loaded by the client when this addon is run: in this case, the Bob.xml file in the addon's folder should be loaded before Bob.lua in the same folder. | ||
## Interface: {{API LatestInterface}} | ## Interface: {{API LatestInterface}} | ||
| Line 14: | Line 14: | ||
Addon called "Waiting for Bob". | Addon called "Waiting for Bob". | ||
=== | === line types === | ||
* lines beginning with '#': designate a comment and are ignored | * lines beginning with '#': designate a comment and are ignored | ||
* lines beginning with '## ': designate a .toc tag and provide metadata about the AddOn | * lines beginning with '## ': designate a .toc tag and provide metadata about the AddOn | ||
| Line 36: | Line 36: | ||
Prefixing a line with a # will mark it as a comment, meaning that it will not be read. For example: | Prefixing a line with a # will mark it as a comment, meaning that it will not be read. For example: | ||
# This is a comment | # This is a comment | ||
== Naming the TOC file == | |||
There are special rules for naming a .toc file for an addon. | |||
=== Default name === | |||
The default name for a '.toc' file is the name of the addon folder with an extension of '.toc'. | |||
AddOns | |||
MyAddOn | |||
MyAddOn.toc | |||
code.lua | |||
frame.xml | |||
In this example the AddOn is named 'MyAddOn'. WoW will look for a file named MyAddOn.toc as the addons toc file, because the folder name was MyAddon. They must match. | |||
=== Names for WoW editions === | |||
Each WoW edition can load its own .toc file. Each addon can have more than one .toc that could be loaded by WoW. WoW will first look for a special .toc for that edition, and if not found will load the default .toc that has the same name as the addon folder, shown above. | |||
AddOns | |||
MyAddOn | |||
MyAddOn.toc | |||
MyAddOn_Wrath.toc | |||
MyAddOn_Vanilla.toc | |||
code.lua | |||
frame.xml | |||
In this example the AddOn has alternate .toc files for both Classic and WotLK, as well as the default .toc file. When the WotLK edition loads, it will look first for 'MyAddOn_Wrath.toc' then for 'MyAddOn.toc', if 'MyAddOn_Wrath.toc' is not found. if 'MyAddOn_Wrath.toc' is found it will only load that toc and ignore th others. If it's not found, it will load 'MyAddOn.toc' ignoring any others. | |||
=== Why multiple .toc files === | |||
There are two big reasons: | |||
# Code differences | |||
#: There are differences big enough between two editions of WoW, that it would be easier to use two or more different coded or XML files, and need a different .toc files to load different sets of code for an edition. | |||
# The 'Interface' version numbers | |||
#: Each edition has its own series of interface version numbers. Because of this and because you only have one '## Interface:' line to specify the number, you will actually need a .toc file for each supported edition. Otherwise, users will have to click the 'load outdated' checkbox to load your addon. | |||
== Details == | == Details == | ||