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:
iconpickerData = {
type = "iconpicker",
name = "My Icon Picker",
tooltip = "Color Picker's tooltip text.",
choices = {"texture path 1", "texture path 2", "texture path 3"},
choicesTooltips = {"icon tooltip 1", "icon tooltip 2", "icon tooltip 3"}, --(optional)
getFunc = function() return db.var end,
setFunc = function(var) db.var = var doStuff() end,
maxColumns = 5, --(optional) number of icons in one row
visibleRows = 4.5, --(optional) number of visible rows
iconSize = 28, --(optional) size of the icons
width = "full", --or "half" (optional)
beforeShow = function(control, iconPicker) return preventShow end, --(optional)
disabled = function() return db.someBooleanSetting end, --or boolean (optional)
warning = "Will need to reload the UI.", --(optional)
default = defaults.var, --(optional)
reference = "MyAddonIconPicker" --(optional) unique global reference to control
}
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:
control:SetColor(ZO_ColorDef color) -- Sets the texture color of the displayed icons
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:
iconpickerData = {
...
reference ="MyIconPicker",
...
}
local control= MyIconPicker
control:SetColor(ZO_ColorDef:New(r, g, b, a))
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:
beforeShow = function(control, iconPicker)
iconPicker:SetMouseHandlers(function(icon)
control.label:SetText(icon.tooltip)
iconPicker:OnMouseEnter(icon)
end, function(icon)
control.label:SetText("Icon Picker Test")
iconPicker:OnMouseExit(icon)
end)
end,
r18 is now released and can be downloaded from
here.