Thread Tools Display Modes
Prev Previous Post   Next Post Next
06/04/14, 10:36 PM   #1
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
LibAddonMenu-2.0 - looking for a few people to poke at it

I finished LAM-2.0 last night. Here is a .zip of the file and some rough starter docs. Hoping to get a few ambitious people to play with it and see if anything breaks.


As usual, you need to grab LAM from LibStub first:
Lua Code:
  1. local lam = LibStub("LibAddonMenu-2.0")


METHOD: REGISTER ADDON PANEL
Lua Code:
  1. --registers your addon with LibAddonMenu and creates a panel
  2. --Usage:
  3. --  addonID = "string"; unique ID which will be the global name of your panel
  4. --  panelData = table; data object for your panel - see controls\panel.lua
  5. lam:RegisterAddonPanel(addonID, panelData)


METHOD: REGISTER OPTION CONTROLS
Lua Code:
  1. --registers the options you want shown for your addon
  2. --these are stored in a table where each key-value pair is the order
  3. --of the options in the panel and the data for that control, respectively
  4. --see exampleoptions.lua for an example
  5. --see controls\<widget>.lua for usage of each widget type
  6. --Usage:
  7. --  addonID = "string"; the same string passed to :RegisterAddonPanel
  8. --  optionsTable = table; the table containing all of the options controls and their data
  9. lam:RegisterOptionControls(addonID, optionsTable)


With the new LAM, you only need to make those two function calls and define your data in tables. (See exampleoptions.lua for an example of usage.) Everything else is handled by the library itself.

For power-users who wish to get their hands dirty, the widget controls are registered under the LAMCreateControls object. You can bypass LAM and create everything manually - either using your own window/panel, or registering for one through LAM. If you're not so ambitious, but still want something in your options panel that LAM doesn't provide, you can either register your own widget type (see the :RegisterWidget method) or use the "custom" widget type, which is basically just a container.


--------------

June 6 Update:
- fixed checkbox control for initial value bug
- localized game Settings menu lookup & encoded LAM-2.0 Lua file in UTF-8

--------------

June 8 Update:
- cleaned up ForceDefaults code
- set bg center of addon panel and addon menu to transparent
- fixed editbox multiline bug
- fixed description anchoring bug
- fixed defaults button and confirm dialog
- added optional custom function for when resetting defaults (will be called after all settings are reset)
Attached Files
File Type: zip LibAddonMenu-2.0.zip (198.2 KB, 1250 views)

Last edited by Seerah : 06/08/14 at 09:44 PM.
 
 

ESOUI » AddOns » Alpha/Beta AddOns » LibAddonMenu-2.0 - looking for a few people to poke at it

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off