View Single Post
02-04-12, 06:41 PM   #9
Xuerian
A Fallenroot Satyr
 
Xuerian's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 27
Honestly, for your need of a button to toggle it in interface options, here is a basic reference.

lua Code:
  1. local frame = CreateFrame('Frame', 'MyConfigPanel', UIParent)
  2. frame.name = 'MyAddon'
  3. -- create a button and attach it to frame here
  4. InterfaceOptions_AddCategory(frame)
  5.  
  6. -- Show the panel somewhere, ex slash handler
  7. InterfaceOptionsFrame_OpenToCategory(frame)

It's really pretty simple.


Now, as far as a full-on config goes, use Ace3's AceConfig. This coming from someone who wanted to shun libraries and ended up rolling his own when he realized he needed to do the same thing for more than one addon.

As everyone else has basically stated, as soon as another addon uses the lib you used, the code is shared - only one copy of the library stays loaded in memory.
  Reply With Quote