Thread Tools Display Modes
06/04/15, 08:20 AM   #1
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
LibAddonMenu-2.0r18 preview

I am proud to announce r18 is (nearly) finished.
It has been in the works for a few weeks and I feel it is ready to be tested by other developers.
I tested it with many addons, but as LAM is the most used library I want to make sure there are really no problems that I might have missed.
This is where I need your feedback. If you are a developer or just use many addons, please try the new build and tell me if everything works as expected.

Preliminary Changelog
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
- 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)
- updated LibStub to r3 (support for '.' in minor version string, e.g. "17.5")

Icon Picker Widget
Here are some infos on how to use the new icon picker widget.

This new widget allows you to specify a list of texture paths which are then shown as icons in a custom dropdown element.
The options table takes a choices array like the dropdown widget. It also features a few optional parameters to control the dimensions.

Lua Code:
  1. iconpickerData = {
  2.     type = "iconpicker",
  3.     name = "My Icon Picker",
  4.     tooltip = "Color Picker's tooltip text.",
  5.     choices = {"texture path 1", "texture path 2", "texture path 3"},
  6.     choicesTooltips = {"icon tooltip 1", "icon tooltip 2", "icon tooltip 3"}, --(optional)
  7.     getFunc = function() return db.var end,
  8.     setFunc = function(var) db.var = var doStuff() end,
  9.     maxColumns = 5, --(optional) number of icons in one row
  10.     visibleRows = 4.5, --(optional) number of visible rows
  11.     iconSize = 28, --(optional) size of the icons
  12.     width = "full", --or "half" (optional)
  13.     beforeShow = function(control, iconPicker) return preventShow end, --(optional)
  14.     disabled = function() return db.someBooleanSetting end, --or boolean (optional)
  15.     warning = "Will need to reload the UI.",    --(optional)
  16.     default = defaults.var, --(optional)
  17.     reference = "MyAddonIconPicker" --(optional) unique global reference to control
  18. }

In order to allow for some features that are used in popular addons, there are also some additional functions that can be used to dynamically update the widget:
Lua Code:
  1. control:SetColor(ZO_ColorDef color) -- Sets the texture color of the displayed icons
  2. control:SetIconSize(number size) -- Changes the size of the icons. This also affects the row height of the addon menu.

To access them it is recommended to use the reference property which creates a global reference like with other UI elements.

Lua Code:
  1. iconpickerData = {
  2. ...
  3. reference ="MyIconPicker",
  4. ...
  5. }
  6.  
  7. local control= MyIconPicker
  8. control:SetColor(ZO_ColorDef:New(r, g, b, a))
  9. control:SetIconSize(size)

In order to change the settings of the dropdown, the beforeShow function can be used.
For example to implement custom mouseover behavior something like this can be done:
Lua Code:
  1. beforeShow = function(control, iconPicker)
  2.     iconPicker:SetMouseHandlers(function(icon)
  3.         control.label:SetText(icon.tooltip)
  4.         iconPicker:OnMouseEnter(icon)
  5.     end, function(icon)
  6.         control.label:SetText("Icon Picker Test")
  7.         iconPicker:OnMouseExit(icon)
  8.     end)
  9. end,

r18 is now released and can be downloaded from here.

Last edited by sirinsidiator : 06/14/15 at 01:30 PM. Reason: updated to r18
  Reply With Quote
06/05/15, 08:49 AM   #2
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
At ADD_ON_LOADED :

With only 1 addon updated to 17.5 (pChat) :

Lua Code:
  1. 2015-06-05T16:38:54.810+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  2. stack traceback:
  3.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  4.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  5.     user:/AddOns/CombatCloud/Menu.lua:1803: in function 'CombatCloud.RegisterOptions'
  6.     user:/AddOns/CombatCloud/CombatCloud.lua:23: in function '(anonymous)'|r
  7. 2015-06-05T16:38:54.817+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  8. stack traceback:
  9.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  10.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  11.     user:/AddOns/AwesomeGuildStore/Settings.lua:40: in function 'CreateSettingsDialog'
  12.     user:/AddOns/AwesomeGuildStore/Settings.lua:193: in function 'LoadSettings'
  13.     user:/AddOns/AwesomeGuildStore/StartUp.lua:36: in function 'callback'
  14.     user:/AddOns/AwesomeGuildStore/StartUp.lua:22: in function '(anonymous)'|r
  15. 2015-06-05T16:38:54.889+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  16. stack traceback:
  17.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  18.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  19.     user:/AddOns/Recount/Misc/SettingsMenu.lua:18: in function 'Recount.SettingsMenu.Initialize'
  20.     user:/AddOns/Recount/Recount.lua:193: in function 'Recount.Initialize'|r
  21. 2015-06-05T16:38:56.153+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  22. stack traceback:
  23.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  24.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  25.     user:/AddOns/MasterMerchant/MasterMerchant.lua:479: in function 'MasterMerchant:LibAddonInit'
  26.     user:/AddOns/MasterMerchant/MasterMerchant.lua:2135: in function 'MasterMerchant:Initialize'
  27.     user:/AddOns/MasterMerchant/MasterMerchant.lua:2620: in function 'OnAddOnLoaded'|r
  28. 2015-06-05T16:38:56.157+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  29. stack traceback:
  30.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  31.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  32.     user:/AddOns/pChat/pChat.lua:4556: in function 'pChat.init'
  33.     user:/AddOns/pChat/pChat.lua:2633: in function 'pChat.onAddonLoaded'|r
  34. 2015-06-05T16:38:56.168+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  35. stack traceback:
  36.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  37.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  38.     user:/AddOns/PotionMaker/PotionMaker.lua:2255: in function 'PotMaker.initSettingsMenu'
  39.     user:/AddOns/PotionMaker/PotionMaker.lua:2474: in function 'PotMaker.init'|r
  40. 2015-06-05T16:38:56.193+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  41. stack traceback:
  42.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  43.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  44.     user:/AddOns/PvPRanks/PvPRanks.lua:312: in function 'PvPRanks:CreateSettingsMenu'
  45.     user:/AddOns/PvPRanks/PvPRanks.lua:275: in function 'OnAddOnLoaded'|r
  46. 2015-06-05T16:38:56.197+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  47. stack traceback:
  48.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  49.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  50.     user:/AddOns/LootDrop/LootDropConfig2.lua:55: in function 'LootDropConfig:Initialize'
  51.     user:/AddOns/LootDrop/LootDropConfig2.lua:37: in function 'LootDropConfig:New'
  52.     user:/AddOns/LootDrop/LootDrop.lua:200: in function 'LootDrop:OnLoaded'
  53.     user:/AddOns/LootDrop/LootDrop.lua:135: in function '(anonymous)'|r
  54. 2015-06-05T16:38:56.197+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  55. stack traceback:
  56.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  57.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  58.     user:/AddOns/NoThankYou/NoThankYou.lua:855: in function 'BuildSettingsMenu'
  59.     user:/AddOns/NoThankYou/NoThankYou.lua:929: in function 'OnAddonLoaded'|r
  60. 2015-06-05T16:38:56.253+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  61. stack traceback:
  62.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  63.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  64.     user:/AddOns/SkyShards/SkyShards.lua:208: in function 'CreateSettingsMenu'
  65.     user:/AddOns/SkyShards/SkyShards.lua:404: in function 'OnLoad'|r
  66. 2015-06-05T16:38:56.253+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  67. stack traceback:
  68.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  69.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  70.     user:/AddOns/FCOCraftFilter/FCOCraftFilter.lua:140: in function 'BuildAddonMenu'
  71.     user:/AddOns/FCOCraftFilter/FCOCraftFilter.lua:788: in function 'FCOCraftFilter_Loaded'|r
  72. 2015-06-05T16:38:56.253+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  73. stack traceback:
  74.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  75.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  76.     user:/AddOns/FlowersSheLikes/FlowersSheLikes.lua:43: in function 'FlowersSheLikes.onAddonLoaded'|r
  77. 2015-06-05T16:38:56.260+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  78. stack traceback:
  79.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  80.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  81.     user:/AddOns/Srendarr/Settings.lua:837: in function 'Srendarr:InitializeSettings'
  82.     user:/AddOns/Srendarr/Srendarr.lua:211: in function 'Srendarr.OnInitialize'|r
  83. 2015-06-05T16:38:56.389+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  84. stack traceback:
  85.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  86.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  87.     user:/AddOns/SousChef/SousChef.lua:203: in function 'SousChefCreateSettings'
  88.     user:/AddOns/SousChef/SousChef.lua:454: in function 'SousChef_Loaded'|r
  89. 2015-06-05T16:38:56.389+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  90. stack traceback:
  91.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  92.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  93.     user:/AddOns/GuildNotificator/GuildNotificator.lua:343: in function 'GuildNotificator.onAddonLoaded'|r
  94. 2015-06-05T16:38:56.438+01:00 |cff0000Lua Error: user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: attempt to index a nil value
  95. stack traceback:
  96.     user:/AddOns/pChat/lib/LibAddonMenu-2.0/controls/panel.lua:79: in function 'LAMCreateControl.panel'
  97.     user:/AddOns/CombatCloud/libs/LibAddonMenu/LibAddonMenu-2.0.lua:203: in function 'lam:RegisterAddonPanel'
  98.     user:/AddOns/Dustman/DustmanMenu.lua:66: in function 'Dustman.CreateSettingsMenu'
  99.     user:/AddOns/Dustman/Dustman.lua:609: in function 'OnLoad'|r

Extension string in menus is here, but the ui is empty.
+ addon Potion Maker is bit buggy but I think that's more a Potion maker code problem.



With only my addon with LAM updated enabled, no problem.



PS : Your modifications are awesome, really good job.

Last edited by Ayantir : 06/05/15 at 09:10 AM.
  Reply With Quote
06/05/15, 09:58 AM   #3
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 578
Originally Posted by Ayantir View Post
Extension string in menus is here, but the ui is empty.
+ addon Potion Maker is bit buggy but I think that's more a Potion maker code problem.
Ah, really!?! Where?

BTW: No issues with my addon collection and with Potion Maker stand-alone, with LAM r18

Edit 1:
But to be correct: I used LAM r18 as stand-alone addon. Ayantir has updated the embedded files. This can be an important difference.
Edit 2:
^^ Yep: Any addon using LAM r17 causes this error, if another addon updates to LAM r18. No issues if using LAM r18 as stand-alone addon.
Has nothing to do with Potion Maker.

Solution: Easy: LibStub does not support dots in MINOR.
r17.5 = r17 !
The main LAM file it taken from addons using r17.
Change it to 18 and everything works!

Last edited by votan : 06/05/15 at 11:48 AM.
  Reply With Quote
06/05/15, 11:40 AM   #4
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
@sirinsidiator:

Should this bug can be fixed?

If no, we'll need to warn devs to do not update and decide of a global push date of your library..

thank you.
  Reply With Quote
06/05/15, 11:59 AM   #5
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 578
Originally Posted by Ayantir View Post
@sirinsidiator:

Should this bug can be fixed?

If no, we'll need to warn devs to do not update and decide of a global push date of your library..

thank you.
@Ayantir: I guess this half step version is just because it is a preview.

And thank you, that you like the new style.
  Reply With Quote
06/05/15, 12:07 PM   #6
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
I should have mentioned this. LibStub will also get an update to r3.
When I copy both folders to any addon it works without a problem.

I'll include it in the changelog and also put it in the announcement once r18 goes live.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » LibAddonMenu-2.0r18 preview


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