promotional bannermobile promotional banner
premium banner
A converted version of Blizzards UIDropDownMenu into a library accessable by LibStub

Description

Description

This is a converted version of Blizzards UIDropDownMenu from WoW Retail 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.

 

My two goals:

1. Keep sync to Blizzards retail client version.

2. It should be compatible to classic clients.

 

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