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: | 37,481 |
Total downloads: | 5,013,002 |
Favorites: | 2,826 |
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 |
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
04/13/16, 08:11 PM | |
|
I find LibAddonMenu very handy and easy to use and I was trying to do a little more with it and I am making some mistake and I wondered if you could see what I am doing wrong.
I have some checkboxes in my options panel but what I would really like is to have a button next to each of those checkboxes. As far as I can tell I can do this using the built in features of LibAddonMenu. A badly put together example Lua Code:
Is there a better way for me to do this? What am I doing wrong? Any help appreciated. |
|
Weolo |
View Public Profile |
Send a private message to Weolo |
Find More Posts by Weolo |
Add Weolo to Your Buddy List |
04/14/16, 04:44 AM | ||
Manually creating the controls like in your example is something you should not do for the standard settings panel. It is an advanced feature that can be used when you make a custom panel layout or want to use controls outside the settings menu. It requires you to manage all controls yourself, as the built-in layout function won't know what you plan to do and some change to LAM may break your layout in the future. In the built-in layout you can put 2 option controls in the same line with the help of the width attribute. Lua Code:
|
||
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
04/14/16, 12:11 PM | |
|
Thanks for the advice, I will give that a go
Last edited by Weolo : 04/14/16 at 12:11 PM.
|
|
Weolo |
View Public Profile |
Send a private message to Weolo |
Find More Posts by Weolo |
Add Weolo to Your Buddy List |
06/06/16, 10:28 AM | |
|
After DB update none of the addons that i use can create an iconpicker control.
Item Saver, for instance, reports the following: Code:
user:/AddOns/LoreBooks/Libs/LibAddonMenu-2.0/controls/iconpicker.lua:294: function expected instead of nil stack traceback: user:/AddOns/LoreBooks/Libs/LibAddonMenu-2.0/controls/iconpicker.lua:294: in function 'SetColor' user:/AddOns/LoreBooks/Libs/LibAddonMenu-2.0/controls/iconpicker.lua:432: in function 'LAMCreateControl.iconpicker' user:/AddOns/ItemSaver/ItemSaverSaveDialog.lua:200: in function 'ItemSaver_InitializeDialog' user:/AddOns/ItemSaver/ItemSaver.lua:311: in function 'ItemSaver_Loaded' Could you please take a look at it? |
|
dorrino |
View Public Profile |
Send a private message to dorrino |
Find More Posts by dorrino |
Add dorrino to Your Buddy List |
06/06/16, 10:46 AM | ||
Can you please try what happens when you run Code:
/script d(LibStub("LibAddonMenu-2.0").util.GetIconPickerMenu()) |
||
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
06/06/16, 07:44 PM | ||
|
Code:
[string "d(LibStub("LibAddonMenu-2.0").util.GetIconPickerMenu())"]:1: function expected instead of nil stack traceback: [string "d(LibStub("LibAddonMenu-2.0").util.GetIconPickerMenu())"]:1: in function '(main chunk)' EsoUI/Ingame/SlashCommands/SlashCommands_Shared.lua:5: in function 'fn' EsoUI/Ingame/SlashCommands/SlashCommands_Shared.lua:62: in function 'DoCommand' EsoUI/Ingame/ChatSystem/SharedChatSystem.lua:1806: in function 'SharedChatSystem:SubmitTextEntry' EsoUI/Ingame/ChatSystem/SharedChatSystem.lua:2489: in function 'ZO_ChatTextEntry_Execute' 14406795741938050902:3: in function '(main chunk)' (tail call): ? Here's the source of the problem: Latest veriosn of CyrHUD 1.3.0 uses LibAddonMenu version from your Github Code:
local MAJOR, MINOR = "LibAddonMenu-2.0", 999 -- only for test purposes. releases will get a smaller number Obviously copying LibAddonMenu v.20 over v.999 in CyrHUD folder fixed it. Now i'm gonna post this in CyrHUD comments. BTW, why addons don't use the LibAddonMenu version from their respected folders? I understand that your test version have higher version number and thus higher priority, but why should it matter for other addon if they're explicitely told to use both libstub and libaddonmenu from within their folders?
Last edited by dorrino : 06/06/16 at 07:59 PM.
|
|
|
dorrino |
View Public Profile |
Send a private message to dorrino |
Find More Posts by dorrino |
Add dorrino to Your Buddy List |
06/07/16, 04:44 AM | ||
The github version is not intended to be released in addons, but it has already happened more than once. I'll have to think of some measure to prevent it from happening again and again and I already have an idea. I am not 100% sure why libraries are set up like they are. As far as I am aware LibStub has been copied over from WOW where it has worked like this for years. Two reasons I can think of are that it is much easier to get a new version out there, because not every single addon has to update the bundled lib immediately and that it is to avoid problems with shared resources, because older versions may access them in a way that causes problems in a newer version. It may also just be that nobody really thought about how to do it properly. |
||
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
06/09/16, 06:26 AM | ||
|
Lua Code:
Last edited by merlight : 06/09/16 at 06:30 AM.
|
|
|
merlight |
View Public Profile |
Send a private message to merlight |
Find More Posts by merlight |
Add merlight to Your Buddy List |
06/09/16, 06:36 AM | |||
If someone bundles it, the file doesn't get loaded and the default version is 0. It also needs to be included by hand at least once so it works.
Last edited by sirinsidiator : 06/09/16 at 06:37 AM.
|
|||
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
06/09/16, 06:46 AM | ||
If I'm not wrong, saved variables are available starting with the EVENT_ADD_ON_LOADED, but at this moment the LibStub check has been passed already and all functions are updated. I like the idea of merlight. |
||
|
votan |
View Public Profile |
Send a private message to votan |
Find More Posts by votan |
Add votan to Your Buddy List |
06/09/16, 06:57 AM | ||
|
||
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
06/09/16, 07:03 AM | ||
|
Lua Code:
And set _LAM2_VERSION_NUMBER = 999 in the other file (loaded first, in stand-alone only). I think this might be better than my previous suggestion, because there were two issues with it: 1) if there is no other add-on with properly released LAM, the user will end up with no LAM at all 2) you'd have to change all control/*.lua, add LibStub.SILENT and check that LAM is not nil first Whereas the solution with global LAM version in stand-alone will just work, including the case where there's no other LAM version (version -1 is the highest in this case). |
|
|
merlight |
View Public Profile |
Send a private message to merlight |
Find More Posts by merlight |
Add merlight to Your Buddy List |
06/09/16, 07:24 AM | |||
|
|||
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
06/09/16, 07:27 AM | ||
Maybe the check should cause the Lua error dialog? |
||
|
votan |
View Public Profile |
Send a private message to votan |
Find More Posts by votan |
Add votan to Your Buddy List |