Details on LAM2 data tables
Below you will find each control type provided by LibAddonMenu-2.0 and the detailed docs for each field in their data tables. This is an expansion of what may be found at the top of each control's Lua file.



PANEL
  • type = "panel" - the widget type of this control
  • name = "string" - the name of your addon; displayed in the right-hand menu - do not add color-codes to your string, or your addon will not be alphabetized
  • displayName = "string" - (optional) if you wish the title at the top of your panel to be different from what is listed in the menu - useful for long addon names or to add color codes or textures to the string
  • author = "string" - (optional) if you wish to display the author name at the bottom-right of your panel
  • version = "string" - (optional) if you wish to display the version number at the bottom-right of your panel
  • slashCommand = "string" - (optional) will register a keybind to open to this panel (don't forget to include the slash!)
  • registerForRefresh = boolean - (optional) will refresh all options controls when a setting is changed or the panel is shown
  • registerForDefaults = boolean - (optional) enables the "Reset To Defaults" button to set all options controls back to default values
  • resetFunc = function - (optional) if registerForDefaults is true, this custom function will run after settings are reset to defaults


BUTTON
  • type = "button" - the widget type of this control
  • name = "string" - the text to display on your button
  • tooltip = "string" - the text to display in the tooltip
  • func = function - the function to call when the button is pressed (passes through all arguments from the button's "OnClicked" handler)
  • width = "string" - (optional) "full" or "half" width in the panel
  • disabled = function or boolean - (optional) this control will be disabled if this field evaluates to true (your panel must have registerForRefresh set to true)
  • icon = "string" - (optional) the file path to an icon for your button (if your button uses an icon, its size will be set to 26x26, otherwise it will use the ZO_DefaultButton template)
  • warning = "string" - (optional) will enable a warning icon for this control with this text as its tooltip
  • reference = "string" - (optional) unique global reference to this control


CHECKBOX
  • type = "checkbox" - the widget type of this control
  • name = "string" - the text to display for this setting
  • tooltip = "string" - the text to display in the tooltip
  • getFunc = function - the function to call that provides the value this control should display
  • setFunc = function - the function that will be called when this setting is changed - passes through one return value (boolean)
  • width = "string" - (optional) "full" or "half" width in the panel
  • disabled = function or boolean - (optional) this control will be disabled if this field evaluates to true (your panel must have registerForRefresh set to true)
  • warning = "string" - (optional) will enable a warning icon for this control with this text as its tooltip
  • default = boolean - (optional) the default value for this setting (your panel must have registerForRefresh set to true to have access to the "Reset To Defaults" button in your panel)
  • reference = "string" - (optional) unique global reference to this control


COLORPICKER
  • type = "colorpicker" - the widget type of this control
  • name = "string" - the text to display for this setting
  • tooltip = "string" - the text to display in the tooltip
  • getFunc = function - the function to call that provides the r, g, b[, a] numerical values this control should display (alpha is optional)
  • setFunc = function - the function that will be called when this setting is changed - passes through four returns r, g, b, a (numbers)
  • width = "string" - (optional) "full" or "half" width in the panel
  • disabled = function or boolean - (optional) this control will be disabled if this field evaluates to true (your panel must have registerForRefresh set to true)
  • warning = "string" - (optional) will enable a warning icon for this control with this text as its tooltip
  • default = table - (optional) the default values for this setting, stored in a table with r, g, b[, a] as its keys (your panel must have registerForRefresh set to true to have access to the "Reset To Defaults" button in your panel)
  • reference = "string" - (optional) unique global reference to this control


CUSTOM
This control serves as a container for your custom created content. It has dimension constraints set on it which allow it to have a max height of 100.
  • type = "custom" - the widget type of this control
  • reference = "string" - (optional) unique global reference to this control
  • refreshFunc = function - (optional) function to call when panel/controls refresh
  • width = "string" - (optional) "full" or "half" width in the panel


DESCRIPTION
  • type = "description" - the widget type of this control
  • title = "string" - (optional) any title to give your description
  • text = "string" - the description text
  • width = "string" - (optional) "full" or "half" width in the panel
  • reference = "string" - (optional) unique global reference to this control


DROPDOWN
  • type = "dropdown" - the widget type of this control
  • name = "string" - the text to display for this setting
  • tooltip = "string" - the text to display in the tooltip
  • choices = table - a table containing all choices to display in the dropdown menu
  • sort = "string" - (optional) if the contents of the dropdown should be sorted, and how - accepts "name-up", "name-down", "numeric-up", or "numeric-down" - if not provided, list will not be sorted
  • getFunc = function - the function to call that provides the selected choice ("string") in the dropdown menu
  • setFunc = function - the function that will be called when this setting is changed - passes through one returns selected ("string")
  • width = "string" - (optional) "full" or "half" width in the panel
  • disabled = function or boolean - (optional) this control will be disabled if this field evaluates to true (your panel must have registerForRefresh set to true)
  • warning = "string" - (optional) will enable a warning icon for this control with this text as its tooltip
  • default = "string" - (optional) the default value for this setting (your panel must have registerForRefresh set to true to have access to the "Reset To Defaults" button in your panel)
  • reference = "string" - (optional) unique global reference to this control


EDITBOX
  • type = "editbox" - the widget type of this control
  • name = "string" - the text to display for this setting
  • tooltip = "string" - the text to display in the tooltip
  • getFunc = function - the function to call that provides the selected choice ("string") in the dropdown menu
  • setFunc = function - the function that will be called when this setting is changed - passes through one returns text ("string")
  • isMultiline = boolean - if this should be a multi-line editbox
  • width = "string" - (optional) "full" or "half" width in the panel
  • disabled = function or boolean - (optional) this control will be disabled if this field evaluates to true (your panel must have registerForRefresh set to true)
  • warning = "string" - (optional) will enable a warning icon for this control with this text as its tooltip
  • default = "string" - (optional) the default text for this setting (your panel must have registerForRefresh set to true to have access to the "Reset To Defaults" button in your panel)
  • reference = "string" - (optional) unique global reference to this control


HEADER
Displays a header with a divider above the text.
  • type = "header" - the widget type of this control
  • name = "string" - the text to display for this setting
  • width = "string" - (optional) "full" or "half" width in the panel
  • reference = "string" - (optional) unique global reference to this control


SLIDER
  • type = "slider" - the widget type of this control
  • name = "string" - the text to display for this setting
  • tooltip = "string" - the text to display in the tooltip
  • min = number - the minimum value for the slider
  • max = number - the maximum value for the slider
  • step = number - (optional) the amount the slider moves by when dragged
  • getFunc = function - the function to call that provides the value (number) of this setting
  • setFunc = function - the function that will be called when the value is changed - passes through one returns value (number)
  • width = "string" - (optional) "full" or "half" width in the panel
  • disabled = function or boolean - (optional) this control will be disabled if this field evaluates to true (your panel must have registerForRefresh set to true)
  • warning = "string" - (optional) will enable a warning icon for this control with this text as its tooltip
  • default = number - (optional) the default value for this setting (your panel must have registerForRefresh set to true to have access to the "Reset To Defaults" button in your panel)
  • reference = "string" - (optional) unique global reference to this control


SUBMENU
Creates a collapsible submenu to hold other controls. These controls should have their data tables stored in the submenu's "controls" field, rather in the main group with the controls in the main display. Indexing of the controls table can begin at 1. This is the only control that cannot have its width changed.
  • type = "submenu" - the widget type of this control
  • name = "string" - the text to display for the submenu
  • tooltip = "string" - the tooltip to display for the submenu
  • controls = table - (optional) if registering your options with LAM (having it do the creation and anchoring), this table will contain all controls you wish to display in the submenu
  • reference = "string" - (optional) unique global reference to this control


TEXTURE
  • type = "texture" - the widget type of this control
  • image = "string" - the file path to the texture
  • imageWidth = number - the width of your texture (max of 250 for half width, 510 for full)
  • imageHeight = number - the height of your texture (max of 100)
  • tooltip = "string" - (optional) the tooltip to display for the texture
  • width = "string" - (optional) "full" or "half" width in the panel
  • reference = "string" - (optional) unique global reference to this control