Understanding the Feed Reader Addon
Now that we have a basic understanding of how addons work, let's look at how our Feed Reader addon is built.
Dissecting Feed Reader
The first thing we should do is look at all of the files that make up the Feed Reader addon, as shown in Figure 3-10.
Figure 3-10. The four files that make up the Feed Reader addon
The first thing to notice is that Feed Reader is defined in a subdirectory of Users\Public\Games\World of Warcraft\Interface\AddOns\FeedReader. All Warcraft addons must be in their own custom subdirectory under that path.
Feed Reader includes the following files:
- FeedReader.toc
This is Feed Reader's table of contents (TOC) that defines the addon name, author, version, and, most importantly, the list of all the files in the addon. AddOn Studio will automatically create your TOC file for you, so you won't have to hand-edit these files (click the Project menu to view the addon TOC settings).
- Frame.xml
This defines the look and feel of Feed Reader, including buttons, controls, positioning, colors, and more.
- Frame.lua
This defines a set of Lua functions that map to event handlers for widgets in Frame.xml.
- Slash.lua
This is a standalone Lua file that includes slash commands, which are text commands that are registered to Warcraft's chat window (see Figure 3-3).
How Feed Reader and Feed Grabber Work
Next, let's take a 10,000-foot view at the order of execution ...
Get Coding4Fun now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.