Skip to content

Library for hooking into native WoW dropdowns without taint or addon conflict.

Notifications You must be signed in to change notification settings

Jaliborc/DropExtend-1.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

DropExtend-1.0

Patreon Paypal Discord

Allows to extend Blizzard dropdowns without spreading taint (because the native dropdown code should not be trusted). Also ensures multiple addons extending the same dropdown through this API do not interfere with one another.

API

DropExtend provides a single method:

LibStub('DropExtend-1.0'):Hook(dropdown, callback)
  • dropdown: the frame you wish to extend
  • callback: function that will be called each time the dropdown native initFunc is executed (see definition), with the same parameters callback(dropdown, level, menuList). Should return a frame you wish to show with the content being initialized, or nil when you have nothing to add.

Example

This code will add content to the Loot Journal class filter dropdown - one frame MyMainLevelExtension to the dropdown main level, and another frame MyClassListExtension to the class list:

LibStub('DropExtend-1.0'):Hook(LootJournalItemsClassDropDown, function(dropdown, level, menuList)
    if level == 1 then
        return MyMainLevelFrame
    elseif level == 2 and UIDROPDOWNMENU_MENU_VALUE == CLASS_DROPDOWN then
        return MyClassListFrame
    end
end)

⚠️ Reminder!

If you use this library, please list it as one of your dependencies in the CurseForge admin system. It's a big help! 👍

About

Library for hooking into native WoW dropdowns without taint or addon conflict.

Topics

Resources

Stars

Watchers

Forks

Languages