GithubHelp home page GithubHelp logo

libdropdownmenu's Introduction

LibDropDownMenu (WoW AddOn Library)

Build Tag Downloads Downloads         Patreon Paypal Sponsors

Description

This is a converted version of Blizzards UIDropDownMenu from WoW Retail into a library accessable by LibStub. I update it from time to time to current retail version.

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

Little extra with version r24

Since version r24 this library has a little extra i've missed in original. I like to use easymenu but the original has no option to add a separator by menuList table.

local menuList = {
	{ text="Some text", isTitle = true },
	{ separator = true }, -- new in r24
	{ text="More text", func=function() end}
}

@Blizzard feel free to add it to the original 🤓

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= }

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");

In .pkgmeta file

externals:
  libs/LibDropDownMenu:
    url: https://github.com/HizurosWoWAddOns/LibDropDownMenu
    tag: latest

My other projects

Disclaimer

World of Warcraft© and Blizzard Entertainment© are all trademarks or registered trademarks of Blizzard Entertainment in the United States and/or other countries. These terms and all related materials, logos, and images are copyright © Blizzard Entertainment.

libdropdownmenu's People

Contributors

hizuro avatar pazza avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

pazza

libdropdownmenu's Issues

[BUG]: Error since latest release (r37)

WoW client

WoW Retail

What happened?

I have several addons that import the LibDropDownMenu library, and one of them a few days ago updated to r37. The others are at r36. Since doing so, when I attempt to right click on the LDB icon for WIM (which imports LibDropDownMenu), I get the following error.

NOTE: I installed LibDropDownMenu by it's self to ensure that it was the AddOn.

If I roll back to r36 (which involves replacing it within the AddOn that updated to r37 (DBM-Core for me)), everything is fine. Looking at the diffs between r36 and r37, it's mostly around this NewFeature functionality which it's claiming in this case is nil. I've read through the code and honestly not sure how it's nil (I even tried to force it to initialize it in the function that this is failing in), but here we are. I'm going to keep rolling back to r36 for now, but wanted you to be aware (and this is going to become more difficult as more AddOns I have update their libraries).

Lua Error Message?

1x LibDropDownMenu-37/LibDropDownMenu.lua:794: attempt to index field 'NewFeature' (a nil value)
[string "@LibDropDownMenu-37/LibDropDownMenu.lua"]:794: in function <LibDropDownMenu/LibDropDownMenu.lua:497>
[string "@WIM/Sources/ContextMenu.lua"]:119: in function `initFunction'
[string "@LibDropDownMenu-37/LibDropDownMenu.lua"]:138: in function <LibDropDownMenu/LibDropDownMenu.lua:130>
[string "@WIM/Sources/ContextMenu.lua"]:142: in function `PopContextMenu'
[string "@WIM/Modules/ldb.lua"]:41: in function `OnClick'
[string "@ChocolateBar/Chocolate.lua"]:298: in function <ChocolateBar/Chocolate.lua:295>

Other addons?

No response

[BUG]: Interaction between addon

WoW client

WoW Retail

What happened?

A bug happened!
I use tipttac+ Outfitter addons. Tiptac settings effect Outfitter size of windows.Since Outfitter is using mutiple windows -next window in line is getting smaller and smaller thus becomeing unreadable. Since both addons are fan updated especially Outfitter its hard to get answers but author of fan update of Tiptac gave me this answer
frozn/TipTac#147

It seems that line 112 in LibDropDownMenu is causing this.

Is there way of codeing this line differently so it wouldnt cause casceding windows to become smaller and smaller?

Lua Error Message?

No error messaage

Other addons?

There are few other addons that are also using this lib so commenting out that line would also cause issues with them so if possiable i would like to avoid going into that route as solution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.