https://github.com/jaliborc/dropextend-1.0
Library for hooking into native WoW dropdowns without taint or addon conflict.
https://github.com/jaliborc/dropextend-1.0
dropdown library lua world-of-warcraft
Last synced: 12 months ago
JSON representation
Library for hooking into native WoW dropdowns without taint or addon conflict.
- Host: GitHub
- URL: https://github.com/jaliborc/dropextend-1.0
- Owner: Jaliborc
- Created: 2023-02-07T11:15:25.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-07T11:17:15.000Z (over 3 years ago)
- Last Synced: 2025-06-19T06:53:51.650Z (about 1 year ago)
- Topics: dropdown, library, lua, world-of-warcraft
- Language: Lua
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# DropExtend-1.0
[](https://www.patreon.com/jaliborc) [](https://www.paypal.me/jaliborc) [](https://bit.ly/discord-jaliborc)
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:
```lua
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](https://wowpedia.fandom.com/wiki/API_UIDropDownMenu_Initialize)), 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:
```lua
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)
```
### :warning: Reminder!
If you use this library, please list it as one of your dependencies in the CurseForge admin system. It's a big help! :+1: