49
edits
No edit summary |
|||
| Line 1: | Line 1: | ||
{{cleanup|Needs to be less MS Windows-centric.}} | {{cleanup|Needs to be less MS Windows-centric.}} | ||
{{ | {{uiaddon}} | ||
The idea of picking up any programming language can be daunting, and when you have to tie your program into someone else's APIs it can be nearly overwhelming. Creating your own addon will be a difficult process for novice coders, but the end satisfaction is worth it. | The idea of picking up any programming language can be daunting, and when you have to tie your program into someone else's APIs it can be nearly overwhelming. Creating your own addon will be a difficult process for novice coders, but the end satisfaction is worth it. | ||
== First Steps == | == First Steps == | ||
Figure out what you want your addon to do. Don't try and get into the details too much, just decide what you want the overall goal to be. I usually start by asking myself these questions: | Figure out what you want your addon to do. Don't try and get into the details too much, just decide what you want the overall goal to be. I usually start by asking myself these questions: | ||
:*What's my end goal? | :*What's my end goal? | ||
:*What information will I need from WoW for my addon to work? | :*What information will I need from WoW for my addon to work? | ||
| Line 12: | Line 15: | ||
=== Get Your Information: The WoW API === | === Get Your Information: The WoW API === | ||
Getting information from WoW is critical to making your addon function. The [[World of Warcraft API]] has a list of functions that will give you that information. These are your building blocks, and if you don't have a block you need (or thought you needed) then you'll have to find another way to get information for your addon. Don't be discouraged, as with any programming language there are many different ways to accomplish your goal, so keep looking until you find a way. | Getting information from WoW is critical to making your addon function. The [[World of Warcraft API]] has a list of functions that will give you that information. These are your building blocks, and if you don't have a block you need (or thought you needed) then you'll have to find another way to get information for your addon. Don't be discouraged, as with any programming language there are many different ways to accomplish your goal, so keep looking until you find a way. | ||
| Line 29: | Line 33: | ||
== Editing Tools == | == Editing Tools == | ||
Before you can write any sort of code, you'll want to have a tool that lets you edit your 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 will highlight syntax for you, in turn making your coding a lot easier. | Before you can write any sort of code, you'll want to have a tool that lets you edit your 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 will highlight syntax for you, in turn making your coding a lot easier. | ||
To review the list of tools and get one you'd like, head to the [[Lua editors]] page. | To review the list of tools and get one you'd like, head to the [[Lua editors]] page. | ||
== File Types == | == File Types == | ||
There are three primary types of files that you'll need to worry about with addon editing: | There are three primary types of files that you'll need to worry about with addon editing: | ||
* TOC File - This file is required for any addon. This is the file that supplies WoW with information about your addon and which files are required for your addon to work. | * TOC File - This file is required for any addon. This is the file that supplies WoW with information about your addon and which files are required for your addon to work. | ||
| Line 39: | Line 45: | ||
===TOC File=== | ===TOC File=== | ||
This is the file that instructs WoW in some basics about your addon and what other files you want loaded. Here's a short example of one: | This is the file that instructs WoW in some basics about your addon and what other files you want loaded. Here's a short example of one: | ||
| Line 50: | Line 57: | ||
=== LUA Files === | === LUA Files === | ||
[[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 specific purpose. Here's a short example of one: | [[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 specific purpose. Here's a short example of one: | ||
| Line 59: | Line 67: | ||
=== XML Files === | === XML Files === | ||
XML files are used to specify the visual style of your frames. More importantly though a frame allows you to easily pass events to your Lua files. Check out [[XML User Interface]] for details. Here's a short example of an XML file: | XML files are used to specify the visual style of your frames. More importantly though a frame allows you to easily pass events to your Lua files. Check out [[XML User Interface]] for details. Here's a short example of an XML file: | ||
| Line 71: | Line 80: | ||
== Start Coding! == | == Start Coding! == | ||
Start with the tutorials extracted by the [http://us.blizzard.com/support/article.xml?locale=en_US&articleId=21466 Interface AddOn Kit]. The [[HOWTOs]] here has a ton of great examples to help you learn. Don't be shy to dig through someone else's addon for help, just be sure not steal code and give credit where credit is due. | Start with the tutorials extracted by the [http://us.blizzard.com/support/article.xml?locale=en_US&articleId=21466 Interface AddOn Kit]. The [[HOWTOs]] here has a ton of great examples to help you learn. Don't be shy to dig through someone else's addon for help, just be sure not steal code and give credit where credit is due. | ||
== Slash Commands == | == Slash Commands == | ||
A slash command is one way for the user to interact with your addon. These will be the easiest way for a beginner to let the user supply command and change options. | A slash command is one way for the user to interact with your addon. These will be the easiest way for a beginner to let the user supply command and change options. | ||
The [[HOWTO: Create a Slash Command]] page covers this pretty well. | The [[HOWTO: Create a Slash Command]] page covers this pretty well. | ||
== A Basic UI Frame == | == A Basic UI Frame == | ||
The [[XML User Interface]] page covers a lot of a great basics. | The [[XML User Interface]] page covers a lot of a great basics. | ||
== SavedVariables == | == SavedVariables == | ||
The [[Saving variables between game sessions]] article covers the key points. For folks new to Addons but not other programming languages, just bear in mind that: | The [[Saving variables between game sessions]] article 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. | * 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. | ||
| Line 86: | Line 99: | ||
== Localization == | == Localization == | ||
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]]. | 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]]. | ||
[[Category:HOWTOs|Get Started]] | [[Category:HOWTOs|Get Started]] | ||