Thread Tools Display Modes
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, 1292 views)

Last edited by Seerah : 06/08/14 at 09:44 PM.
 
06/05/14, 06:58 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Wow. It looks really great. Settings for all addons at one place is really good idea. It is much cleaner solution then in LAM 1.0.

I would just suggest adding some kind of transparency to the panel as it will feel more like part of default UI. Also it would be great if you can add an option to turn on/off addon, so all about addons is on the same place.

By the way write somewhere that I should not use the same name for my settings menu as I use for global table in my addon...

EDIT:
I think that default widgets should be "hardcoded" so their functionality will be guaranteed. It is really easy to break other addons, if you replace default widget.

Last edited by Garkin : 06/05/14 at 02:54 PM.
 
06/05/14, 01:44 PM   #3
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
I'll check it out!

edit: btw, I notice you use the term All Rights Reserved, but you probably want to use the actual word "Copyright" followed by the year and your entity name. At least in the US, that is the proper labelling.

I don't believe ARR means anything, legally.

Last edited by Vuelhering : 06/05/14 at 02:36 PM.
 
06/05/14, 07:55 PM   #4
Kentarii
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
Cool stuff, will take it for a spin this weekend.
 
06/06/14, 06:57 AM   #5
Froali
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 13
I'm getting this error, when i am trying to open the settings through the defined /-command:
Code:
user:/AddOns/ThurisazGuildInfo/lib/LibAddonMenu-2.0/LibAddonMenu-2.0.lua:52: attempt to index a nil value
stack traceback:
	user:/AddOns/ThurisazGuildInfo/lib/LibAddonMenu-2.0/LibAddonMenu-2.0.lua:52: in function 'func'
	EsoUI/Libraries/Globals/globalapi.lua:156: in function '(anonymous)'
Though the settings menu is accessible via ESC->Addon Settings and works so far.

If you need more information to reproduce it, let me know Great work so far. Thanks Seerah!

Edit: Just clicked through ZO_GameMenu_InGame via /zgoo. This is just dumb... the table
Code:
ZO_GameMenu_InGame.gameMenu.headerControls.Settings
is localized and has a different name in the german client i'm using:
Code:
ZO_GameMenu_InGame.gameMenu.headerControls.Einstellungen

Last edited by Froali : 06/06/14 at 07:01 AM.
 
06/06/14, 07:51 AM   #6
Froali
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 13
I think i found another little bug in checkbox.lua:70

In function UpdateValue. In order to set the checkbox initial value to the actual current value, shouldn't it be
Lua Code:
  1. else
  2.      control.value = control.data.getFunc()
  3. end
In your original code it simple sets value = .... resulting in the checkbox being false all the time
 

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


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