LibDropDownMenu

4.9k Downloads

Description

This is a converted version of Blizzards UIDropDownMenu from WoW Retail 9.0.5.37893 into a library accessable by LibStub.

Since Blizzards new xml error handling it is a problem to use xml templates in libraries. I've converted the templates into lua functions.

The XML templates are converted into lua functions

  • UIDropDownMenuButtonTemplate into <lib>.Create_DropDownMenuButton(<name>[,<parent>[,<optsTable>]]>
  • UIDropDownListTemplate into <lib>.Create_DropDownMenuList(<name>[,<parent>[,<optsTable>]]>
  • UIDropDownMenuTemplate into <lib>.Create_DropDownMenu(<name>[,<parent>[,<optsTable>]]>

Currently the optsTable can contain only one usable entry. { id=<number> }

Example

  local lib = LibStub("LibDropDownMenu");
local menuFrame = lib.Create_DropDownMenu("MyAddOn_DropDownMenu",UIParent);
-- instead of template UIDropDownMenuTemplate
local menuList = {
    { text="TestTitle", isTitle=true },
    { text="TestFunction", isNotRadio=true, notCheckable=false }
};
lib.EasyMenu(menuList,menuFrame,"cursor",0,0,"MENU");

Repository

  git clone https://repos.curseforge.com/wow/libdropdownmenu

In .pkgmeta file

externals:
  libs/LibDropDownMenu:
    url: https://repos.curseforge.com/wow/libdropdownmenu
    tag: latest

Hizuro's other projects

 • https://www.curseforge.com/members/hizuro_de/projects