Go to Page... |
Compatibility: | Scions of Ithelia (9.3.0) Endless Archive (9.2.5) |
Updated: | 03/10/24 04:21 PM |
Created: | 02/14/14 10:28 PM |
Monthly downloads: | 82,199 |
Total downloads: | 4,672,912 |
Favorites: | 2,748 |
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 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 |
Terrillyn |
View Public Profile |
Send a private message to Terrillyn |
Find More Posts by Terrillyn |
Add Terrillyn to Your Buddy List |
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
01/18/16, 11:37 PM | |
|
two questions
I have two questions:
How do I go about deleting a control at runtime (e.g. an entire submenu)? How are references used and how might I use them to accomplish the above?and Context: I'm trying to delete and add entire submenus at runtime on certain events and I dont want to interrupt the user with ReloadUI calls. Thanks for any answers! Sorry if this was already answered, I don't see any search function for addon threads.
Last edited by Terrillyn : 01/18/16 at 11:37 PM.
|
|
Terrillyn |
View Public Profile |
Send a private message to Terrillyn |
Find More Posts by Terrillyn |
Add Terrillyn to Your Buddy List |
11/08/15, 02:54 AM | |
Changing name will be added. Someone else also asked me about it recently.
Dynamic changing of the layout is not easily possible right now. The controls are all anchored together on creation and changing the width of specific elements is bound to cause problems. Especially because the width property is a dirty hack in the first place. There are a few other changes to LAM necessary before that will be feasible. |
|
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
11/07/15, 07:51 PM | |
Still my dynamic requests
So, in BMR, I would like that the name of my control be dynamic. I got control 1 (dropdown) , when I set it to a value, some values are updated like this : Lua Code:
Then, I would like to set my other control the value set by this function in another control Lua Code:
Then 2 others requests : A "visible" option A dynamic configuration (function) of width too. A screen to explain why : Feel free to say "no", if a bit too hard ^^
Last edited by Ayantir : 11/07/15 at 08:11 PM.
|
|
|
Ayantir |
View Public Profile |
Send a private message to Ayantir |
Visit Ayantir's homepage! |
Find More Posts by Ayantir |
Add Ayantir to Your Buddy List |
11/03/15, 03:44 PM | |
This is something that also has bothered me since I wrote the first version of Social Indicators, so I am also interested in making this possible. Reading your comments I think you are over complicating it though.
I wouldn't change the existing choices array to support putting localized labels into the list, but instead would add an optional choicesLabels array. In addition the choices array would also accept other value types besides string as long as the choicesLabels array is present and return these values to the getFunc. From an addon authors perspective everything pretty much stays the same and it is 100% backwards compatible with only minimal changes to the dropdown widget. |
|
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Visit sirinsidiator's homepage! |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
11/03/15, 03:38 PM | ||
|
I have an idea how the fail action (assert or warning) could be optionally overridden, but that's fancy stuff that can be added later if deemed useful. Back to my auto-junk example: when it suddenly stops junking stuff it's nothing serious, the user will probably check settings, see it's been reset; maybe post a complaint; but then set the desired value and be fine. No need to trigger error from LAM in this particular case. |
|
|
merlight |
View Public Profile |
Send a private message to merlight |
Visit merlight's homepage! |
Find More Posts by merlight |
Add merlight to Your Buddy List |
11/03/15, 02:30 PM | ||||
|
But just to go ahead and clarify what I meant (for working backwards compatibility), although you may not be saving the actual "value" in saved vars, you do still have the value to pass in, your just converting your saved var first to find the value. Your code would not have to change at all, it would still be:
Warning: Spoiler
Lua Code:
But now I see you were focused on the "best" way to use the new tables and I agree this would be much easier & more flexible, but would also prevent setting any selected item other than whats in dataItems. I don't have a problem with that, I just wanted to point it out. Lua Code:
As for the idea of using defaults to fallback on, think about what would happen in your example. If it defaulted back to normal it would start junking items it was not supposed to because the quality setting was to low. Ok, so you could change that default to LEGENDARY, but your addon would still end up doing unexpected things. Now it stops junking things that it should. Could you eventually track it down & find the problem? Sure, but I'de rather have an error than have my addon doing unexpected things, causing potential harm, because settings are changing. After thinking about this some more I changed my mind on the fail scenario. If were going to go that route and prevent setting/selecting items that aren't in the dataItems table then I would actually rather have it throw an assert() error than just fail the selection if the item doesn't exist in the list so I know something needs fixed rather than have it select something else (or fail to select anything) and have me & users confused as to why something is not working due to an error that got hidden. |
|||
|
circonian |
View Public Profile |
Send a private message to circonian |
Send email to circonian |
Visit circonian's homepage! |
Find More Posts by circonian |
Add circonian to Your Buddy List |
11/03/15, 06:48 AM | ||||
|
Warning: Spoiler
Lua Code:
With the lookup implemented in LAM, it would look like this:
Warning: Spoiler
Lua Code:
For example if ZOS renamed ITEM_QUALITY_ARTIFACT to ITEM_QUALITY_RELIC and I updated the add-on without fixing saved vars, my getFunc would return now non-existent "ITEM_QUALITY_ARTIFACT". In this case it should probably default to NORMAL. |
|||
|
merlight |
View Public Profile |
Send a private message to merlight |
Send email to merlight |
Visit merlight's homepage! |
Find More Posts by merlight |
Add merlight to Your Buddy List |
11/02/15, 05:15 PM | ||
|
name is just the key for value and that key is always called name, for everyone. Right now with LAM we/it passes the value to/from the getFunc & setFunc. That is what everyone is using now. CreateItemData() creates the table Lua Code:
This method isn't implemented, so if it is when people start using it you will have the full entry table because you will save it or create it. If you mean for old code not using the tables, you are correct that they do not have a "full entry table" to get, but they do have the value. That is why I said we could just pack it into an entry table for them, the only data that is needed for people not using tables is the value which they already have. As for your idea about using GetItems(), I started to disagree, but the more I think about it I think I like that idea. I hadn't even considered that, being able to select the item based on some key/value pair in the table other than the name. I'm not sure about this though: Lua Code:
I have two thoughts on that:
We shouldn't do both: Prevent setting the selected item to something that's not in the dataItems, but then set the selected name to value & the selectedItemData to nil if its not found. I think it should be one or the other.
|
|
|
circonian |
View Public Profile |
Send a private message to circonian |
Send email to circonian |
Visit circonian's homepage! |
Find More Posts by circonian |
Add circonian to Your Buddy List |
11/02/15, 05:42 AM | ||
One could create a new control type or add a new option (.useKeyValuePair). This way, you don't need to do implicit legacy conversion. I must admit, I was too lazy for the first option |
||
|
votan |
View Public Profile |
Send a private message to votan |
Send email to votan |
Visit votan's homepage! |
Find More Posts by votan |
Add votan to Your Buddy List |
11/01/15, 09:19 PM | ||
|
Lua Code:
|
|
|
merlight |
View Public Profile |
Send a private message to merlight |
Send email to merlight |
Visit merlight's homepage! |
Find More Posts by merlight |
Add merlight to Your Buddy List |
11/01/15, 08:22 PM | ||
|
UpdateValue would need to use: Lua Code:
Which would also be an easy fix, because the item is already passed to the callback, just change:
Warning: Spoiler
Lua Code:
Then if we want backwards compatability just check if the value passed to getFunc is a string & if so pack it for them: Lua Code:
Last edited by circonian : 11/01/15 at 08:29 PM.
|
|
|
circonian |
View Public Profile |
Send a private message to circonian |
Send email to circonian |
Visit circonian's homepage! |
Find More Posts by circonian |
Add circonian to Your Buddy List |
11/01/15, 07:03 PM | ||||
|
Warning: Spoiler
|
|||
|
merlight |
View Public Profile |
Send a private message to merlight |
Send email to merlight |
Visit merlight's homepage! |
Find More Posts by merlight |
Add merlight to Your Buddy List |
11/01/15, 03:03 PM | |
|
DropDown Request:
I don't know about anyone else, but many times when creating a dropdown box I wish I had the ability to pass choices a table with key/value pair rather than just values. As an example, instead of doing something like this:
Warning: Spoiler
Lua Code:
Have the ability to include other data with the values like this:
Warning: Spoiler
Lua Code:
As long as we included the key/value pair: name = "whatever" the box could easily be populated with minimal changes:
Warning: Spoiler
Lua Code:
Although I'm not sure how that would effect any other LAM code. It would make some things much easier to handle rather than having to always translate the options:
Warning: Spoiler
Lua Code:
It would be nice to not have to do that, but instead just grab whatever associated value/constant that we use for that option from the table: Lua Code:
I do realize addons that use dropdowns would have to update their LAM code. Although it may not be desired, a check could be added for legacy compatability to prevent that. Something like:
Warning: Spoiler
Lua Code:
Just a thought, thanks for all your hard work !! |
|
circonian |
View Public Profile |
Send a private message to circonian |
Send email to circonian |
Visit circonian's homepage! |
Find More Posts by circonian |
Add circonian to Your Buddy List |