1. #1

    [LUA] Building an addon config panel

    Hey all,
    I've now got a solid grasp on writing LUA and had some fun experimentation with the possibilities of it within WoW. I'm now looking for some resources on how to create a configuration panel for my addons. Right now, all I know is how to create static frames and write code, but I don't know how to make (for example) checkboxes on that panel actually change settings relevant to my addon, and I certainly don't know how to integrate it with the game's interface>addons frame properly.

    For example, let's say I made a simple "ignore" addon - you add a characters name, they're added to a list, and then when you click an "ignore" button, it ignores everyone on the list. This is a simple example, since I know that the AddIgnore() function isn't protected or H-Req. I don't have a problem with looping through people in the list/I can handle the functional code without a problem logically, but I don't know how to loop through the actual UI element list, and the main subject, I don't know how to create config UI's for my addons. I'd assume that I'd take the items in the list, and put them into a table and then loop through that - it's the first part I'm having trouble with (again, just a simple example).

    Does anyone have any resources I can look at? I've had a search through the forums and Google, but couldn't find much I could actually learn from. I figure that an addon isn't much use to the general playerbase without some sort of easily configurable options.

  2. #2
    Ace3, specifically AceGUI, provides a library for a clean-looking UI. Many addons use it (Bartender4, BigWigs, Grid, WeakAuras, ... to name a few). A good starting point would be to tinker with an ace3 addon that you already use.

    I can't link to sites yet, but the api for ace3 is here:
    www . wowace.com/addons/ace3/pages/

    wow widget api (AceGUI is essentially an extention of this):
    www . wowpedia.org/Widget_API

  3. #3

    You're looking for widget script handlers.

    local b = CreateFrame("checkbutton")
    b:SetScript("OnClick", function(self, button, isDown) if ( self:GetChecked() ) then else end end)
    local e = CreateFrame("editbox")
    e:SetScript("OnEditFocusLost" function(self) end)

    I've never worked with the interface options panel, but here's some info:
    Last edited by Woogs; 2013-07-08 at 11:06 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts