Originally Posted by TULOA
If someone can help out with a more direct function running off a table I would appreciate it. I just had one more idea I am going to try and if it works I will post it back here.
Otherwise I will still be looking.
|
Ok I wiggled something up that I can improve off of:
Following Requires: menuList, SubList with texts in menuList as keys.
Code:
local info = UIDropDownMenu_CreateInfo()
if level == 1 then
for a,b in pairs(menuList) do
info.text = b[1]
info.hasArrow = b[2]
UIDropDownMenu_AddButton(info, level)
end
elseif level == 2 then
for a,b in pairs(menuList[UIDROPDOWNMENU_MENU_VALUE][3]) do
info.text = b
info.func = OnClick
UIDropDownMenu_AddButton(info, level)
end
end
Edit: Fixed to run off one table.