Thread: Variables LAM
View Single Post
02/24/23, 03:53 AM   #9
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,006
The setFunc of your LAM2 dropdown control is there to update your SavedVariables e.g. with the chosen set name from the choices table.
Hint: Also provide a choicesValues table with numbers instead of set names Strings! That way you can use the unique setId numbers instead of having to be carefull with translated setnames!

choices = {"setname1", "setname2"},
choicesValues = {1, 2},
getFunc = function() return yourSavedVariables.chosenSetId end,
setFunc = function(value)
-- Store value in your SavedVariables
yourSavedVariables.chosenSetId = value
--Update any visual information based on the chosen value (set's ID)
updateVisualSetData(value)
end,

As you choose an entry from the dropdown, e.g. setname2, the value 2 will be passed to the parameter "value" of the setFunc.
  Reply With Quote