New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dropdown widget v15 - With multiselect #135
Merged
sirinsidiator
merged 16 commits into
sirinsidiator:master
from
Baertram:dropdown_multiselect
Dec 3, 2023
Merged
Dropdown widget v15 - With multiselect #135
sirinsidiator
merged 16 commits into
sirinsidiator:master
from
Baertram:dropdown_multiselect
Dec 3, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
updateMultiSelectSelected See addon FCOChangeStuff 1st dropdown at settings
--TODO 20231114 for debugging LibAddonMenu dropdwn.lua test for multiselection --settings._testMultiSelect = { "abc", "def" } { type = "dropdown", name = 'test multiselect', tooltip = 'test multiselect', choices = { "abc", "bcd", "cde", "def", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q" }, --choicesValues = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, choicesTooltips = { "abc TT", "bcd TT", "cde TT", "def TT", "","","","","","","","","","","", }, scrollable = 10, getFunc = function() return settings._testMultiSelect end, setFunc = function(values) settings._testMultiSelect = values end, default = defaults._testMultiSelect, width="full", multiSelect = true, --multiSelectTextFormatter = SI_COMBO_BOX_DEFAULT_MULTISELECTION_TEXT_FORMATTER, --multiSelectNoSelectionText = SI_COMBO_BOX_DEFAULT_NO_SELECTION_TEXT, --multiSelectType = "normal", --multiSelectMaxSelections = 5, },
sirinsidiator
requested changes
Nov 19, 2023
-Fixes and changes requested by sirinsidiator todo: Change multiSelectType. Remove it and instead of "normal" or "allowed" always use "normal" internally and return the selected items (as table with key = choicesValues[i] or choices[i] / value = boolean -> Like "allowed" did) per function dropdown:IsSelected() return table allowed
--Return table { [choicesValues[i] or choices[i]] = boolean, ... } --Can be used at a setFunc e.g. to convert the SavedVariables (2nd param values) to that other table format local function IsSelected(control, values)
and fix for returning the 1 saved value if no muliselect enabled -> control:IsSelected
sirinsidiator
requested changes
Dec 1, 2023
Tested ingame with changed code: choices, choicesValues, choicesTooltips, multi selection, single selection, maxMultiSelecion etc. Seems to work fine |
sirinsidiator
approved these changes
Dec 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: