Go to Page... |
Compatibility: | Gold Road (10.0.0) |
Updated: | 06/03/24 01:19 PM |
Created: | 02/14/14 10:28 PM |
Monthly downloads: | 146,767 |
Total downloads: | 4,876,758 |
Favorites: | 2,790 |
MD5: |
IMPORTANT In case you get an error that contains text like this: user:/AddOns/<some other addon>/Libs/LibAddonMenu-2.0 Some other addon you have installed likely contains an old version of LibAddonMenu which is loaded before the most current one. Make sure to search for LibAddonMenu-2.0 folders in your AddOns folder and delete all of them. Afterwards install the latest version of LibAddonMenu-2.0 separately. Check Kyzderp's guide for more detailed instructions |
## DependsOn: LibAddonMenu-2.0
## DependsOn: LibAddonMenu-2.0>=30
local LAM = LibAddonMenu2 local saveData = {} -- TODO this should be a reference to your actual saved variables table local panelName = "MyAddOnSettingsPanel" -- TODO the name will be used to create a global variable, pick something unique or you may overwrite an existing variable! local panelData = { type = "panel", name = "MyAddOn Settings", author = "me", } local panel = LAM:RegisterAddonPanel(panelName, panelData) local optionsData = { { type = "checkbox", name = "My First Checkbox", getFunc = function() return saveData.myValue end, setFunc = function(value) saveData.myValue = value end } } LAM:RegisterOptionControls(panelName, optionsData)
- use the callbacks "LAM-PanelControlsCreated", "LAM-PanelOpened" and "LAM-PanelClosed" instead- updated Brazilian translation (thanks FelipeS11)
- the panel control is returned by RegisterAddonPanel- added "translation", "feedback" and "donation" properties to panel (#88, thanks Baertram)
- all three (and also the "website" property) accept a function or a string- added "disabled" and "disabledLabel" property for submenus (#86, #90, thanks klingo)
- the function receives the value, min and max as arguments and has to return a clamped value- added optional support for LibDebugLogger
- in case it is loaded, it logs the full error when control creation failed- updated LibStub to r5
- when set to true it changes the text color of the button to red and opens a dialog which shows the label and the warning text before running the callback- added new options for sliders and fixed some bugs (#49)
- autoSelect (boolean): when set to true it makes the input field select all text when it gains focus- for other internal code changes take a look at the git history
- inputLocation (string): setting it to "right" will move the input field to the right side of the slider and make it slightly bigger. For aesthetic reasons this should only be used in custom panels and not in the addon menu
- clampInput (boolean): true by default and if set to false it allows the input values of the slider to exceed the min and max value
- 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)
File Name |
Version |
Size |
Uploader |
Date |
2.0 r36 |
49kB |
sirinsidiator |
03/10/24 04:21 PM |
|
2.0 r35 |
49kB |
sirinsidiator |
10/31/23 01:16 PM |
|
2.0 r34 |
48kB |
sirinsidiator |
06/06/22 05:35 AM |
|
2.0 r33 |
48kB |
sirinsidiator |
03/14/22 02:51 PM |
|
2.0 r32 |
48kB |
sirinsidiator |
12/17/20 02:04 PM |
|
2.0 r31 |
49kB |
sirinsidiator |
06/21/20 03:06 PM |
|
2.0 r30 |
48kB |
sirinsidiator |
10/21/19 03:23 AM |
|
2.0 r29 |
48kB |
sirinsidiator |
05/07/19 11:00 AM |
|
2.0 r28 |
47kB |
sirinsidiator |
05/01/19 09:33 AM |
|
2.0 r27 |
47kB |
sirinsidiator |
04/18/19 03:07 PM |
|
2.0 r26 |
45kB |
sirinsidiator |
05/21/18 02:36 AM |
|
2.0 r25 |
45kB |
sirinsidiator |
09/29/17 12:28 PM |
|
2.0 r24 |
45kB |
sirinsidiator |
07/14/17 01:00 PM |
|
2.0 r23 |
42kB |
sirinsidiator |
10/30/16 10:00 AM |
|
2.0 r22 |
39kB |
sirinsidiator |
08/06/16 07:42 AM |
|
2.0 r21 |
38kB |
sirinsidiator |
07/17/16 11:04 AM |
|
2.0 r20 |
41kB |
sirinsidiator |
03/26/16 10:45 AM |
|
2.0 r19 |
37kB |
sirinsidiator |
02/24/16 12:24 PM |
|
2.0 r18 |
36kB |
sirinsidiator |
06/14/15 01:12 PM |
|
2.0 r17 |
30kB |
sirinsidiator |
02/22/15 11:09 AM |
|
2.0 r16 |
27kB |
Seerah |
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 |
![]() |
Comment Options |
Seerah |
View Public Profile |
Send a private message to Seerah |
Find More Posts by Seerah |
Add Seerah to Your Buddy List |
![]() |
|
Forum posts: 0
File comments: 3
Uploads: 0
|
![]() Hi, very new to ESOUI and Lua, but have managed to get my add-on working with LibAddOnMenu2 (cool stuff!). I'm wondering if there's an easy way to handle re-inits once - only when the settings page is closed. I have it working now where updates are triggered each time an individual setting is changed, but this is very tedious to code, and all I need is a one-time re-init. I could also add an "apply" button, but that's far from ideal.
Thanks! |
![]() |
![]() |
dvstans |
View Public Profile |
Send a private message to dvstans |
Find More Posts by dvstans |
Add dvstans to Your Buddy List |
![]() |
||
|
Re: How to handle setting updates on close
Are you talking about when your settings actually take place and the set function is called? If you want all of the settings to be applied at once then you would create an "Apply" button for your config. Otherwise, most everyone has their settings take effect in real-time. |
|
![]() |
![]() |
Seerah |
View Public Profile |
Send a private message to Seerah |
Find More Posts by Seerah |
Add Seerah to Your Buddy List |
![]() |
|||
Forum posts: 0
File comments: 3
Uploads: 0
|
Re: Re: How to handle setting updates on close
|
||
![]() |
![]() |
dvstans |
View Public Profile |
Send a private message to dvstans |
Find More Posts by dvstans |
Add dvstans to Your Buddy List |
![]() |
||
|
Re: Re: Re: How to handle setting updates on close
|
|
![]() |
![]() |
Seerah |
View Public Profile |
Send a private message to Seerah |
Find More Posts by Seerah |
Add Seerah to Your Buddy List |
![]() |
|||
Forum posts: 0
File comments: 3
Uploads: 0
|
Re: Re: Re: Re: How to handle setting updates on close
![]() So, in this case a delayed module init might be a better choice. A good time to perform the (re)init in this case is when the settings panel is closed or hidden (or you could require the user to press a button, but the automagic way would be nicer!). |
||
![]() |
![]() |
dvstans |
View Public Profile |
Send a private message to dvstans |
Find More Posts by dvstans |
Add dvstans to Your Buddy List |
![]() |
|
|
Yes, but that isn't intuitive for the user (to not have an apply button). If all of their other addons update in real-time and yours does not, and they don't see a way that they have to apply their settings, they'll think something's broken.
If it is indeed causing a delay, then you'll want to either
|
![]() |
![]() |
Seerah |
View Public Profile |
Send a private message to Seerah |
Find More Posts by Seerah |
Add Seerah to Your Buddy List |
![]() |
|
![]() Just realized I've been using pre r6 version of LibAddonMenu-2.0 in DataDaedra. Felt like an idiot and updated it, and double-checked the instructions on the doc on your portal page, copied and pasted the new LAM2:Registeretc. lines.
And poof, all the settings disappeared, but only in my addon's settings (I have many addons that use LibAddonMenu-2.0; this makes me happy. Everything in one place). It's not quite a bug--error occurred between chair and keyboard--but I have a few clumps of hair and a half hour missing to show for the fact that you've renamed "optionsTable" (previous LAM2 versions, exampleoptions.lua) to "optionsData". And that little change was oh so easy to miss. Now that I know what the issue is, of course, I'll name that table whatever I please, but you may want to update either the portal doc or the exampleoptions.lua; I'm pretty sure I'm not the only one who does most of their coding late at night, long after useful consciousness has ended. Otherwise quite pleased, you took all the work out of something I really wasn't looking forward to writing on my own (a GUI settings menu); thank you ![]() |
|
![]() |
![]() |
Deome |
View Public Profile |
Send a private message to Deome |
Send email to Deome |
Find More Posts by Deome |
Add Deome to Your Buddy List |
![]() |
|
|
I'm... sorry?
![]() It's a table. You can name it whatever you want, so long as you pass the correct variable reference to the function. In fact, you don't even *need* to assign your table to a variable - you can make an anonymous table right within the function call, so long as you don't need to access it later. (Though this is bad for readability. ![]() In fact, I believe the reason why I named it differently in exampleOptions.lua (I'm pretty sure it was always called optionsTable in that file - I don't remember changing it at least) was to show that the reference *can* be different from what's in the docs. It's just an example, though, not something that has to be followed literally. But I'm just a teacher, so what do I know? ![]() /edit: oh, and you're welcome ![]()
Last edited by Seerah : 07/25/14 at 09:54 PM.
|
![]() |
![]() |
Seerah |
View Public Profile |
Send a private message to Seerah |
Send email to Seerah |
Find More Posts by Seerah |
Add Seerah to Your Buddy List |
![]() |
|
Hello Seerah,
Thank you for your hard work on providing this (and other) libraries, I'm certain they make the lives of addon authors much easier. I put in some time this weekend on finally bringing my addon, Foundry Tactical Combat, up to speed with the 2.0 version of LibAddonMenu. Unfortunately, I abandoned the work halfway through and have decided to stick with the 1.0 version of the lib (at least for now). I thought I would give a bit of feedback as to why. My addon is modular, there are 5 different "core components", each of which has the option of being toggled outright (enable/disable). For components that are enabled, each component has several options for its configuration. In the 1.0 version of the lib, I was able to generate my addon menu controls using conditional logic, if the component is enabled, display the sub-options for that component, if it's not enabled, display nothing (or something else). In the 2.0 version of the lib, it seems like I have to declare all my menu controls at once, and pass the construction of them through an arguments table. While this is probably easier for most users of the lib, it's definitely less flexible than the 1.0 version. Perhaps there is already a way to do this in a clever way with the 2.0 lib, and I'm missing it. If so please let me know. Otherwise, it would be nice for a future version if you would consider a way to allow menu controls to be configured conditionally. I hope this feedback is clear. Keep up the good work! |
|
![]() |
![]() |
Atropos |
View Public Profile |
Send a private message to Atropos |
Send email to Atropos |
Visit Atropos's homepage! |
Find More Posts by Atropos |
Add Atropos to Your Buddy List |
![]() |
|
|
@Atropos
What you want to do is 100% possible with LAM-2.0. Especially since you reload the UI when enabling/disabling modules in FTC - this becomes even simpler. There are several ways this can be accomplished. You can set the controls for that module to be disabled (and greyed out) if the module is not active (this is actually the easiest way, and then you don't even need to reload the UI), or you can do the below if you don't want the settings to show up at all (and still reload the UI when modules are turned on/off). Lua Code:
Last edited by Seerah : 07/27/14 at 09:16 PM.
|
![]() |
![]() |
Seerah |
View Public Profile |
Send a private message to Seerah |
Send email to Seerah |
Visit Seerah's homepage! |
Find More Posts by Seerah |
Add Seerah to Your Buddy List |
![]() |
|
Hi Seerah,
Thanks for the response, glad to know this is easier than I initially thought. I looked over the docs on your portal but it wasn't obvious to me at the time that this was possible. Turns out this is the link I need: http://www.esoui.com/portal.php?&id=5&pageid=15 I'll take another crack at this and try to get FTC running on AddonMenu2.0 for my next update. Thanks for your support. Atropos |
|
![]() |
![]() |
Atropos |
View Public Profile |
Send a private message to Atropos |
Send email to Atropos |
Visit Atropos's homepage! |
Find More Posts by Atropos |
Add Atropos to Your Buddy List |
![]() |
||
|
![]() |
|
![]() |
![]() |
Seerah |
View Public Profile |
Send a private message to Seerah |
Send email to Seerah |
Visit Seerah's homepage! |
Find More Posts by Seerah |
Add Seerah to Your Buddy List |
![]() |
|
Forum posts: 2
File comments: 51
Uploads: 0
|
Documentation for the "default" parameter for the colorpicker widget is wrong in the controls\colorpicker.lua
In the lua file Lua Code:
But here on the web its Lua Code:
Only the variant described here on the web works. (Which is a pain imho, since it's makes for a much more complicated code on my side ![]() By just adding a few lines to the controls\colorpicker.lua both variants can be supported. Lua Code:
Last edited by wmrojer : 08/02/14 at 06:19 AM.
|
![]() |
![]() |
wmrojer |
View Public Profile |
Send a private message to wmrojer |
Send email to wmrojer |
Visit wmrojer's homepage! |
Find More Posts by wmrojer |
Add wmrojer to Your Buddy List |
![]() |
||
Lua Code:
|
||
![]() |
![]() |
Garkin |
View Public Profile |
Send a private message to Garkin |
Send email to Garkin |
Visit Garkin's homepage! |
Find More Posts by Garkin |
Add Garkin to Your Buddy List |
![]() |