Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Register
 
No edit summary
 
Line 1: Line 1:
  +
== Licensing ==
{{breadcrumb1|Interface Customization}} {{tocright}}
 
  +
{{Licensing|Mob}}
== So You Want To Write an Addon ==
 
<div style="margin-left: 3%;">
 
This article is designed to be a launching off point to the many points of helpful information that exist out there, as well as supplement that information.
 
</div>
 
 
== Editing Tools ==
 
<div style="margin-left: 3%;">
 
Before you can write any sort of code, you'll want to have a tool that lets you edit you addon files. All addon files are plain text files, meaning even Notepad will do. You can also get LUA and XML specific text editors, which is recommended.
 
 
To review the list of tools and get one you'd like, head to the [[Lua editors]] page.
 
</div>
 
 
== File Types ==
 
<div style="margin-left: 3%;">
 
There are three primary types of files that you'll need to worry about with addon editing:
 
* TOC File - You'll have to have one of these. This is the file that instructs WoW in some basics about your addon and what other files you want loaded.
 
* LUA Files - You'll likely have at least one of these. These files are the actual programming language files.
 
* XML Files - You'll likely have at least one of these if you're making any graphical UI parts. This file is what graphical parts your addon has.
 
 
===TOC File===
 
<div style="margin-left: 3%;">
 
As stated above, you'll have to have one of these. This is the file that instructs WoW in some basics about your addon and what other files you want loaded. Here's an example one:
 
 
## Interface: 20000
 
## Title : My AddOn
 
## Notes: This AddOn does nothing but display a frame with a button
 
## Author: My Name
 
## eMail: Author@Domain.com
 
## URL: http://www.wowwiki.com/
 
## Version: 1.0
 
## Dependencies: Sea
 
## OptionalDeps: Chronos
 
## DefaultState: enabled
 
## SavedVariables: settingName, otherSettingName
 
myAddOn.xml
 
MyFrame.xml
 
MyButton.xml
 
 
You can read more about what you need or can put in a TOC over at [[The TOC Format]]
 
</div>
 
 
=== LUA Files ===
 
<div style="margin-left: 3%;">
 
[[Lua]] files contain functional pieces of code. You may choose to only have one of these or break up your code into multiple files for a specfic purpose.
 
</div>
 
 
=== XML Files ===
 
<div style="margin-left: 3%;">
 
XML files are used to specify what your UI will look like if you have one. Check out [[XML User Interface]] for details.
 
</div>
 
 
</div>
 
 
== Slash Commands ==
 
<div style="margin-left: 3%;">
 
The [[HOWTO: Create a Slash Command]] page covers this pretty well.
 
</div>
 
 
== A Basic UI Frame ==
 
<div style="margin-left: 3%;">
 
Honestly, the [[XML User Interface]] page really does cover a lot of great basics.
 
</div>
 
 
== SavedVariables ==
 
<div style="margin-left: 3%;">
 
The [[HOWTO: Save Variables Between Game Sessions]] covers the key points. For folks new to Addons but not other programming languages, just bear in mind that:
 
* The SavedVariables is only read from on UI loading, not real time, and only saved to on UI unloading. This will generally be from a user logging in or logging out.
 
* Basically, WoW makes a SavedVariables file for you named after your addon. You only get to specify in your TOC *which* variables get saved into that file.
 
</div>
 
 
== Localization ==
 
<div style="margin-left: 3%;">
 
It's a good idea to plan from as early as possible to have your addon be localizable, even if you yourself only speak one language. Review this great article for some things to think about: [[HOWTO: Localize an AddOn]].
 
</div>
 
 
[[Category: HOWTOs|Get Started]]
 

Latest revision as of 21:23, 26 June 2011

Licensing