FAQ/Changes regarding to dropdown template's usage after v2.0

As since WoW 8.0.x, a XML template which has been declared before will get an error message like below when this template get declared again:

Deferred XML Node object named L_UIDropDownMenuButtonTemplate already exists

We have to migrate those templates to Lua. And therefore, for addon which is using LibUIDropDownMenu, and if you create your own DropDown menu in either XML or Lua by inhering to L_UIDropDownMenuTemplate, then you will need to revise your code by calling the new functional called "L_Create_UIDropDownMenu".

 

Old XML example:

<Button name="$parentDropDownMenu" inherits="L_UIDropDownMenuTemplate" hidden="true">
....
</Button >

Old Lua example:

local f = CreateFrame("Button", addon.name.."DropDownMenu", parent, "UIDropDownMenuTemplate")
.....

And now you will need to create your DropDown menu in Lua, the codes will look like below:

local f = L_Create_UIDropDownMenu("myOwnDropDownMenu", parent)

The function usage is: L_Create_UIDropDownMenu(name_of_this_dropdown, UI_parent)