AddOn programming tutorial/Page 2 - Point Me
For Page 2 of the Addon programming tutorial series, we are going to write a little AddOn called 'Point Me'.
What this AddOn is going to do is point you to the coordinates that you have selected so that you will know which way to travel. You will be able to specify the desired coordinates in a variety of ways. You will be able to Alt-Right-Click the main map, use an option panel, or enter a command to specify the coordinates.
Thus, we are going to have to learn a bit about reading mouse clicks, determining which mouse button was used, and determine if the Alt-key was being pressed at the same time. Then of course, we will need to create and use an option panel and the command line interpreter.
And you can bet we will run into errors while doing the code so we will explore some techniques for debugging your code, validating your XML, and commenting and formatting what you write so you will have fewer problems.
Initial Files Edit
Since the name of this AddOn will be 'Point Me', let's make the folder and initial file names be 'PointMe'. Refer to AddOn programming tutorial/Introduction if you don't recall where to place the PointMe folder.
Recall that the name of the .toc file must be the same name as the folder so that file name is 'PointMe.toc'. Go ahead and create the 'PointMe.xml' and 'PointMe.lua' files at this time as well. Remember that these names come from names you place in the .toc file
PointMe.toc (Remember you probably need to change the Interface: value)
## Interface: 20400 ## Title: Point Me ## Notes: Place a pointer onscreen to a selected destination ## Dependencies: PointMe.lua PointMe.xml
--[[ Point Me AddOn for World of Warcraft(tm). This is an example of a block comment where you can document the purpose of your program and whatnot. ]]
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\..\FrameXML\UI.xsd"> </Ui>