Quantcast
MMOUI's Minion is a new AddOn manager optimized for use with ESO. Install, update & manage AddOns... Learn more!
Download
(36 Kb)
Download
Updated: 06/14/15 01:12 PM
Pictures
File Info
Compatibility:
Update 6 (1.6.5)
Updated:06/14/15 01:12 PM
Created:02/14/14 10:28 PM
Downloads:28,926
Favorites:168
MD5:
LibAddonMenu  Popular! (More than 5000 hits)
Version: 2.0 r18
by: sirinsidiator, Seerah
Since I (sirinsidiator) have taken over development of LAM-2.0 I decided it will be in the best interest of everyone to make future development a group effort.
With the consent of Seerah I have put LAM-2.0 under The Artistic License 2.0 and created a github project in order to make collaborations possible.
I also want to thank everyone who participated in planning and realizing upcoming changes, especially votan, merlight and Garkin.

If you came here because a message in chat told you so,
then you are using an outdated addon that relies on an older version of LAM-2.0 which might not be compatible with ESO update 6.
But no need to panic. There are a few things you can do in order to get it to work again:
  1. Update your addons. Maybe the author already fixed the problem.
  2. Try to find out which addon uses the outdated version and ask for help in the comment section.
  3. Ask for help in our comment section.
  4. Replace LibAddonMenu-2.0 in all your addons with the newest version.

LibAddonMenu-2.0 is now released!
Your addons will continue to work under LAM-1.0, however that version of the library will no longer be receiving updates, and you will not receive any benefits of LAM-2.0.

** NOTE: If you are using a version of LAM-2.0 earlier than r17, please update your copy of the lib in the addon. This will avoid problems with loading future versions of LAM.**


LibAddonMenu-2.0 is a library to aid addon authors in creating a configuration GUI for their addons which is located in the game's Settings menu. It supports the ability to have all of a user's addon options located in the same panel.

You may see ZAM_Stats for an example of usage.


HOW TO USE:

--Including the library with your addon--
You may either embed the library and LibStub in your addon and load the files from your addon manifest, or have the library installed like any other normal addon.

If your addon embeds the library, you may place this line in your manifest file, just in case the user also has a standalone version installed.
Code:
## OptionalDependsOn: LibAddonMenu-2.0
If you are depending on the library being installed separately and are not embedding it, then you must include this line in your text file.
Code:
## DependsOn: LibAddonMenu-2.0
Either way you choose, LibStub will ensure that only one copy of the library (the newest revision) is loaded into memory.

When embedding the libary, remove the internal LibAddonMenu-2.0 folder from the main library download. I usually place my libraries in a sub-folder called "libs", but you may put them wherever you like in your addon directory. This is how I would then list the files in my manifest. (LAM2's widget controls are broken out into their own files to keep their code clean - this is why there is so many. Good thing you only have to copy-paste this once!)

Code:
libs\LibAddonMenu-2.0\LibAddonMenu-2.0.lua
libs\LibAddonMenu-2.0\controls\panel.lua
libs\LibAddonMenu-2.0\controls\submenu.lua
libs\LibAddonMenu-2.0\controls\button.lua
libs\LibAddonMenu-2.0\controls\checkbox.lua
libs\LibAddonMenu-2.0\controls\colorpicker.lua
libs\LibAddonMenu-2.0\controls\custom.lua
libs\LibAddonMenu-2.0\controls\description.lua
libs\LibAddonMenu-2.0\controls\dropdown.lua
libs\LibAddonMenu-2.0\controls\editbox.lua
libs\LibAddonMenu-2.0\controls\header.lua
libs\LibAddonMenu-2.0\controls\slider.lua
libs\LibAddonMenu-2.0\controls\texture.lua
libs\LibAddonMenu-2.0\controls\iconpicker.lua
(Don't forget to also embed LibStub and have it listed to load prior to LibAddonMenu!)


--Getting the library from LibStub (required)--
Lua Code:
  1. local LAM = LibStub:GetLibrary("LibAddonMenu-2.0")
  2. --OR--
  3. local LAM = LibStub("LibAddonMenu-2.0")
  4.      --returns a reference to the library table


Please see the LAM-2.0 wiki on github for guides and docs, as well as a list of differences between LAM-1.0 and LAM-2.0

Details on LAM2 data tables
2.0 r18
- major overhaul of the addon menu style (thanks votan & merlight)
- NOTE: the menu is now a bit wider than before, if you created custom elements you might need to update them accordingly
- added search box to addon list (thanks votan & merlight)
- new icon picker widget
- removed micro freeze when opening a menu with many options for the first time
- changed tooltip property to accept functions that return a string (thanks Ayantir)
- changed the label on the defaults button and menu to avoid a grammar mistake in the french localization (thanks Ayantir)
- updated LibStub to r3 (support for '.' in minor version string, e.g. "17.5")

2.0 r17
- updated for changes in 100011
- fixed OpenToPanel function
- fixed possible error with combobox names
- half width control no longer have a fixed height and instead scale automatically now
- changed controls to no longer use top level windows
- fixed problems with the loading order and added warning if an old version gets initialized first
A big thank you to everyone who helped making these changes, especially votan, merlight and Garkin!

2.0 r16
- updated for changes in 100010
- thanks to Garkin for alerting me of changes needed and for testing on the test server
- Spanish support added, translation provided by Luisen75 for their Spanish project

2.0 r14
- fixed bug where the LAM-RefreshPanel callback was being registered with CALLBACK_MANAGER multiple times
- fixed highlighting of entries in the game Settings menu (Addon Settings now properly highlights and other entries go back to normal)

2.0 r13
- one last bug ran out from anunder the dresser - I smashed it hopefully!

2.0 r12
- fix one bug another shows up...

2.0 r11
- don't overwrite widgets list if table already exists (in case an external lib or addon registers a new widget type)
- headers, descriptions, submenus and custom widgets now have the ability to update their text when the panel and other controls refresh (simply change the name/text in the controlData table)
- custom controls now have the ability to refresh with other controls and your panel - there is a new optional field in the data table called refreshFunc (when the panel refreshes, this function will be called)

2.0 r10
- fixed display of warning icon for dropdown controls
- update LibStub.lua

2.0 r9
- added Russian locale support for RuESO project
- fixed anchoring issue with addon list (addon names are now properly in the scroll frame, so the few of you with tons installed should have no issue any longer)
- added ability to close submenus from the bottom of the submenu (there is a small strip along the bottom of the submenu that is clickable)
- edited each control to better support custom-created UIs via LAM and the parent passed through to the create functions

2.0 r8
- changed border texture around panel and addon list
- expanded maximum size of submenus from 1500 to 2500

2.0 r7
- shortened game menu entry for French and German localizations (so the text doesn't get cut off)
- fixed checkbox label coloring bug (when a checkbox that is set to "off" is re-enabled by another setting)
- fixed multi-line editbox bug (where text didn't display)
- added mousewheel scrolling for multi-line editboxes

2.0 r6
- added "LAM-PanelControlsCreated" callback when you panel has been shown for the first time and your controls have now been created
- fixed duplicate Addon Settings panels when you have a newer version of LAM overwriting an older version
- finished localizing stuff that wasn't localized yet
- added "sort" field to dropdown control

2.0 r5
- fix RefreshPanel function so that all controls now update
- add RefreshPanel call to ForceDefaults function

2.0 r4
- fix for me being an idiot. Sorry guys ><

2.0 r3
- fixed checkboxes making a sound when just refreshing
- fixed error when the lib is loaded standalone, but no addons are registered with it
- fixed error when LAM updates itself to a newer version (won't try to create two of the same frame)

2.0 r2
- LAM-2.0 is now released! See http://www.esoui.com/portal.php?&id=5&pageid=10 for a list of differences between LAM1 and LAM2, as well as a guide for usage and the library's docs

-----------------
1.0 r8
- updated APIVersion to 100004
- changed submenu so scroll bar doesn't overlap contents
- submenu should hopefully no longer occasionally show up behind the options panel

1.0 r7
- the defaults button now properly hides for each panel (Note: the keybind still works, I can't seem to get rid of that, but at least the prompt is hidden now)
- LAM now supports sub menus! See the description page for docs on usage

1.0 r6
- copy/paste fail when changing the name of an arg. Description titles will no longer hide from you.

1.0 r5
- exposed the widgets created via return

1.0 r4
-new widget: Description

1.0 r3
-fixed error with color picker in new patch

1.0 r2
-fixed bug when more than one addon panel is created
Archived Files (16)
File Name
Version
Size
Author
Date
2.0 r17
30kB
sirinsidiator
02/22/15 11:09 AM
2.0 r16
27kB
sirinsidiator
11/02/14 02:03 PM
2.0 r14
26kB
Seerah
07/27/14 10:17 PM
2.0 r13
26kB
Seerah
07/20/14 09:35 PM
2.0 r12
26kB
Seerah
07/20/14 07:55 PM
2.0 r11
26kB
Seerah
07/19/14 02:49 PM
2.0 r10
25kB
Seerah
07/13/14 09:18 PM
2.0 r9
25kB
Seerah
07/05/14 06:55 PM
2.0 r8
25kB
Seerah
06/22/14 09:47 PM
2.0 r7
25kB
Seerah
06/15/14 05:17 PM
2.0 r6
25kB
Seerah
06/13/14 11:28 PM
2.0 r5
25kB
Seerah
06/12/14 10:32 PM
2.0 r4
25kB
Seerah
06/11/14 08:56 PM
2.0 r3
25kB
Seerah
06/11/14 07:49 PM
2.0 r2
24kB
Seerah
06/10/14 10:06 PM
1.0 r8
6kB
Seerah
05/24/14 10:01 PM


Post A Reply Comment Options
Unread 02/03/16, 05:43 PM  
Terrillyn
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 14
Uploads: 3
ok, If possible, I'll also look into adding an align property to the controls.
Terrillyn is offline Report comment to moderator  
Reply With Quote
Unread 02/03/16, 05:26 PM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 436
File comments: 318
Uploads: 16
Just create the pull request. You can change things afterwards as often as you want. I will look through them tomorrow and let you know if everything is ok.
sirinsidiator is offline Report comment to moderator  
Reply With Quote
Unread 02/03/16, 04:58 PM  
Terrillyn
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 14
Uploads: 3
I just got done modifying the editbox controls, and here is what I've come up with

Any objections or suggestions before I make a pull request?
Terrillyn is offline Report comment to moderator  
Reply With Quote
Unread 02/03/16, 02:40 PM  
Terrillyn
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 14
Uploads: 3
pull request submitted, forgive me if I screwed up somehow though, that's first time I've done a pull request.
Terrillyn is offline Report comment to moderator  
Reply With Quote
Unread 02/03/16, 09:36 AM  
merlight
AddOn Author - Click to view AddOns

Forum posts: 608
File comments: 188
Uploads: 12
I think there should be constraints on the description control. Its children have fixed width, so width constraint is not necessary, max height serves no other purpose than hiding long text with no way to display it, and min height is not necessary either.
merlight is offline Report comment to moderator  
Reply With Quote
Unread 02/03/16, 05:32 AM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 436
File comments: 318
Uploads: 16
Please don't just introduce a new version of a widget control in your own addon. If you have a new version, place a pull request on github, so I can add it to the official version of LAM. Otherwise it will be a pain to figure out what is going on in the future when I update it and some user reports that some feature is not working and in the end it turns out that your version is loading before my version.
sirinsidiator is offline Report comment to moderator  
Reply With Quote
Unread 02/03/16, 05:08 AM  
Terrillyn
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 14
Uploads: 3
How does the ShissuLUAMemory addon manage it? after looking at the source his description text is quite long and multi-lined(\n) but it doesn't suffer this problem, I don't see any real difference in the way its displayed.

1. Introduce a widgetVersion 7 of the description control, which allows to specify a maxheight.
This is what I'm going to do^; maybe a max height or max lines property should be added to the table too?
I may take a look at a few of the other controls tomorrow, I also kinda wanted the edit box to be actual full width(across the panel) instead of half, and possibly even multiline.
Last edited by Terrillyn : 02/03/16 at 05:28 AM.
Terrillyn is offline Report comment to moderator  
Reply With Quote
Unread 02/03/16, 02:19 AM  
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view AddOns

Forum posts: 490
File comments: 646
Uploads: 23
The problem is you are using \n for your descrptions and it break LAM; you'll need to insert placeholders.

I had this in some addons it's the easiest way.

Just insert an empty desc. (in your case, you'll maybe need 3/4).
__________________
Obsessive Compulsive Coder

My little french Guild: Cercle de l'Eveil
Last edited by Ayantir : 02/03/16 at 02:20 AM.
Ayantir is offline Report comment to moderator  
Reply With Quote
Unread 02/03/16, 02:15 AM  
votan
 
votan's Avatar
AddOn Author - Click to view AddOns

Forum posts: 245
File comments: 299
Uploads: 13
These reason is quite simple: The description control height is limited to 104 screen units.

There are several ways you could fix that:
1. Introduce a widgetVersion 7 of the description control, which allows to specify a maxheight.
1b. Introduce a copy of the description control, which allows to specify a maxheight.
2. Register in "LAM-PanelControlsCreated" callback and change the dimension constraints.
3. Split the text into max 4 rows.

Good luck

/edit: To 1. Oh yes, forgotton to say that: And share it, of course. @sirinsidiator: sorry
__________________
@votan73 (EU - megaserver)
Last edited by votan : 02/03/16 at 05:48 AM.
votan is offline Report comment to moderator  
Reply With Quote
Unread 02/02/16, 06:38 PM  
Terrillyn
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 14
Uploads: 3
Is this enough?

menu section:
Lua Code:
  1. {
  2.     type = "description",
  3.     name = GetString(SXPB_CUST_RULES_NAME),
  4.     width = "full",
  5.     text = GetString(SXPB_CUST_RULES),
  6. },
lang file:
Lua Code:
  1. SXPB_CUST_RULES_NAME = "Custom text rules:",
  2. SXPB_CUST_RULES =   'Inputing any of the following will replace them with their respective values when displayed:\n' ..
  3.                     '<lvl>       = players lvl/rnk/chmp\n' ..
  4.                     "<lvlstr>    = the string 'Lvl', 'Rnk', 'Chmp' depending on character stats\n" ..
  5.                     '<xp>        = players current xp/vetpoints/champion points\n' ..
  6.                     '<xpmax>     = max xp/points for current level/rank\n' ..
  7.                     "<xpstr>     = the string 'XP', 'VP', 'CP' depending on character stats\n" ..
  8.                     '<mobs>      = how many more of the last killed mob til a level up\n' ..
  9.                     '<perc>      = the current levels progress percentage\n' ..
  10.                     '<nextlvl>   = value of <lvl>+1',
Terrillyn is offline Report comment to moderator  
Reply With Quote
Unread 02/02/16, 06:02 PM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 436
File comments: 318
Uploads: 16
Originally Posted by Terrillyn
I'm having issues with text overlapping other controls/text when using the description controls, any workaround for this? I can't seem to use text any longer than 3 lines.
Can you send me your code + a screenshot, then I can take a look at what's going wrong.
sirinsidiator is offline Report comment to moderator  
Reply With Quote
Unread 02/02/16, 05:41 PM  
Terrillyn
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 14
Uploads: 3
I'm having issues with text overlapping other controls/text when using the description controls, any workaround for this? I can't seem to use text any longer than 3 lines.
Terrillyn is offline Report comment to moderator  
Reply With Quote
Unread 01/31/16, 05:51 AM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 436
File comments: 318
Uploads: 16
That's because LAM currently has no support for nested sub menus. You can specify them as children of a sub menu like you showed, but they will produce unexpected behavior.
sirinsidiator is offline Report comment to moderator  
Reply With Quote
Unread 01/30/16, 11:55 PM  
circonian
AddOn Author - Click to view AddOns

Forum posts: 634
File comments: 784
Uploads: 27
When nesting submenus the controls inside the nested submenu do not get refreshed nor reset to default.

For controls inside the nested submenu: control.panel references the parent, which is the submenu that the controls submenu is nested in and not the main panel. The submenus .data does not contain the registerForRefresh or registerForDefaults keys so those controls never get added to the main panels controlsToRefresh table here:
Lua Code:
  1. if control.panel.data.registerForRefresh or control.panel.data.registerForDefaults then
  2.     tinsert(control.panel.controlsToRefresh, control)
  3. end
Even if the parent submenu contained those keys: registerForRefresh & registerForDefaults, the tinsert(control.panel.controlsToRefresh, ...) would fail because control.panel is the wrong panel and doesn't contain the .controlsToRefresh table.


If that didn't make sense, I'm talking about these controls:
Warning: Spoiler


It looks like it should be:
Lua Code:
  1. function LAMCreateControl.submenu(parent, submenuData, controlName)
  2.     control.panel = parent.panel or parent
  3.     -- instead of:
  4.     -- control.panel = parent
  5.    ...
  6. end
Not sure if that would cause problems anywhere else, but it fixes the refresh problem.
__________________
My Addons: JunkIt, FilterIt, WaypointIt, LootIt, TweakIt, ChatIt, SortIt
My Libs & Other Developer Stuff: Click4Info, LibNeed4Research, LibMsgWin, LibFilterIt, LibItemInfo
Other Files & Works In Progress can be found on my Dropbox: ESO Dropbox
Last edited by circonian : 01/31/16 at 12:07 AM.
circonian is offline Report comment to moderator  
Reply With Quote
Unread 01/30/16, 01:29 PM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 436
File comments: 318
Uploads: 16
Originally Posted by Agathorn
Any plans to update the APIVersion so that this doesn't keep showing up as out of date?
I'll upload a new version once the Thieves Guild is on PTS.
sirinsidiator is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: