Submenu - sirinsidiator/ESO-LibAddonMenu GitHub Wiki
The submenu control offers a way to structure your settings by hiding parts of them in a folding sub panel. Initially it will only show the name and when clicked it will open and reveal all the controls that have been attached. Starting with LAMr22 you can also use nested submenus.
property | type | required | description |
---|---|---|---|
type | string | yes | The widget type of this control ("submenu") |
name | number, string, function | yes | The text to display for the submenu |
controls | table | yes | This table contains all controls that are located in the submenu |
icon | string, function | no | "path/to/my/icon.dds", or function returning a string |
iconTextureCoords | table, function | no | {left, right, top, bottom}, or function returning a table |
tooltip | string, function | no | The tooltip to display for the submenu |
disabled | function , boolean | no | function() return db.someBooleanSetting end, or boolean |
disabledLabel | function , boolean | no | function() return db.someBooleanSetting end, or boolean |
helpUrl | string, function | no | A string URL "https://www.esoui.com", or a function that returns one |
reference | string | no | A unique global reference to the control |
This method updates the name and tooltip of the submenu with changes to the data table.
LAM:RegisterOptionControls(panelName, {
{
type = "submenu",
name = "My Submenu",
tooltip = "My Submenu Tooltip",
controls = {sliderData, buttonData},
reference = "MyAddonSubmenu"
}
})
local controls, submenuControls = {}, {}
controls[#controls + 1] = {
type = "submenu",
name = "My Other Submenu",
controls = submenuControls
}
submenuControls[#submenuControls + 1] = sliderData
submenuControls[#submenuControls + 1] = buttonData
LAM:RegisterOptionControls(panelName, controls)