Hey fellow developers !
When I declare a dropdown (with libstub) and specially the setFunc, I wonder if thre is a way in this function to know the key that bear the dropDown.
I create my dropdown in a loop and I want to do a different treatement for them and for that I need the key to know which dropdown I'm actually working on.
I've been searching in the LibStub files to check if there is something I can do to make this work, and I may have found something.
Code:
function lam:AddDropdown(panelID, controlName, text, tooltip, validChoices, getFunc, setFunc, warning, warningText)
........
ZO_PreHookHandler(dropmenu.m_selectedItemText, "OnTextChanged", function(self)
if dropmenu.m_selectedItemData then
selectedName = dropmenu.m_selectedItemData.name
setText(self, selectedName)
setFunc(selectedName)
end
end)
........
I am pretty confident that if I remplace the setFunc line by that :
Code:
setFunc(selectedName,controlName)
It will pass to my function the key of the dropdown.
Do you guys have any others non intrusives solutions ? I don't wanna touch the work of Seerah
Thanks