Navigation menu

WoW:Getting started with writing addons: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
Line 20: Line 20:
* [[WoW AddOn]] - These pages explain the basic structure of a WoW AddOn.
* [[WoW AddOn]] - These pages explain the basic structure of a WoW AddOn.
* [[World of Warcraft API]] - These are the functions and ways to talk to WoW with Lua.
* [[World of Warcraft API]] - These are the functions and ways to talk to WoW with Lua.
* [[Curse]] - Find a real but simple example of an existing AddOn. However most real AddOns, even the simple ones, are honestly very difficult to read for getting started, with too many moving parts.
* [[Curse Forge]] or [[WoW Interface (site)|WoW Interface]] - Find a real but simple example of an existing AddOn. Most real AddOns, even the simple ones, however can be difficult to read for getting started, with many moving parts.
* [[Lua editors]] - A long list of code editors and other tools often used by other AddOn creators.
* [[Lua editors]] - A long list of code editors and other tools often used by other AddOn creators.


Line 45: Line 45:
=== File Types ===
=== File Types ===
There are three main types of files that you'll need to worry about with AddOn editing:
There are three main types of files that you'll need to worry about with AddOn editing:
* [[TOC File]] - This file is required for any WoW AddOn, and supplies WoW with information about your AddOn and its files.
* [[TOC file]] - This file is required for any WoW AddOn, and supplies WoW with information about your AddOn and its files.
* LUA Files - This contains Lua code for your AddOn.
* [[LUA file]] - This contains Lua code for your AddOn.
* XML Files - This holds the layout of UI windows, buttons, and similar for your AddOn.
* [[XML file]] - This holds the layout of UI windows, buttons, and similar for your AddOn.


=== TOC File ===
=== TOC File ===
Line 75: Line 75:


=== 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 can be used to specify the visual style of your frames. More importantly though a frame allows you to easily pass events to your Lua files. [[Frame XML]] files are how [[Blizzard]] defines most of their own UI windows in the game. Check out [[XML User Interface]] for details. Here's a short example of an XML file:


  <Script file="MyAddon.lua"/>  
  <Script file="MyAddon.lua"/>  
Line 87: Line 87:


== 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 to 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 [[WoW 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 to not steal code, and give credit where credit is due.


Beware Lua functions and variables are globals by default and are directly visible to the other addons. If authors blindly use simple and common names, like:
Beware Lua functions and variables are globals by default and are directly visible to the other addons. If authors blindly use simple and common names, like:
Line 126: Line 126:
After learning all of the basics, there are times where you may want to see how the Blizzard UI code works to help you in making your own AddOn. And getting information on how the WoW UI works can be helpful to making your AddOn function.
After learning all of the basics, there are times where you may want to see how the Blizzard UI code works to help you in making your own AddOn. And getting information on how the WoW UI works can be helpful to making your AddOn function.


See [[Extracting interface files]] for getting the Blizzard UI AddOn source code which can also be used as a reference.
See [[Extracting WoW user interface files]] for getting the Blizzard UI AddOn source code which can also be used as a reference.


=== Localization ===
=== Localization ===
Line 135: Line 135:
{{elink|site=FreeKode.org|link=http://freekode.org/wow-first-addon/|desc=World of Warcraft first addon|bydate=May 3, 2015}}
{{elink|site=FreeKode.org|link=http://freekode.org/wow-first-addon/|desc=World of Warcraft first addon|bydate=May 3, 2015}}
{{elink|prefix=&nbsp; &nbsp; &nbsp;|site=GitHub|link=https://github.com/freekode/TestAddon/|desc=freekode/TestAddon}}
{{elink|prefix=&nbsp; &nbsp; &nbsp;|site=GitHub|link=https://github.com/freekode/TestAddon/|desc=freekode/TestAddon}}
[[Category:HOWTOs|Get Started]]
[[Category:WoW  HOWTOs]]