sirinsidiator / ESO-LibAddonMenu

http://www.esoui.com/downloads/info7-LibAddonMenu.html
Artistic License 2.0
41 stars 20 forks source link

Dropdown widget v15 - With multiselect #135

Closed Baertram closed 8 months ago

Baertram commented 9 months ago

Added multiselection possibilities to the dropdown widget. -> if multiselection is enabled the getFunc and setFunc are working with a table instead of single values!

Should be fully backwards comaptible with old dropdowns.

Widget's data table additions are:


    multiSelect = false, -- boolean or function returning a boolean. If set to true you can select multiple entries at the list (optional)
    multiSelectTextFormatter = SI_COMBO_BOX_DEFAULT_MULTISELECTION_TEXT_FORMATTER, -- or string id or function returning a string. If specified, this will be used with zo_strformat(multiSelectTextFormatter, numSelectedItems) to set the "selected item text". Only incombination with multiSelect = true (optional)
    multiSelectNoSelectionText = SI_COMBO_BOX_DEFAULT_NO_SELECTION_TEXT, -- or string id or function returning a string. Only incombination with multiSelect = true (optional)
    multiSelectType = "normal", -- String or function returning a string "normal" or "allowed". "normal" = a list with key = number index and value = String / "allowed" = a list with key = any String or number and value = boolean. If value == true then the entry will be added. Default = "normal". Only incombination with multiSelect = true (optional)
    multiSelectMaxSelections = 5, --Number or function returning a number of the maximum of selectable entries. If not specified there is no max selection. Only incombination with multiSelect = true (optional)
Baertram commented 8 months ago

Tested ingame with changed code: choices, choicesValues, choicesTooltips, multi selection, single selection, maxMultiSelecion etc. Seems to work fine