-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddons.lua
More file actions
28 lines (25 loc) · 763 Bytes
/
Addons.lua
File metadata and controls
28 lines (25 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
local _, core = ...
local function onClick(self, arg1)
arg1(nil, { })
end
local dropdown = core:CreateDropdown("Menu")
dropdown.initialize = function(self, level)
table.sort(AddonCompartmentFrame.registeredAddons, function(infoA, infoB) return strcmputf8i(C_StringUtil.StripHyperlinks(infoA.text), C_StringUtil.StripHyperlinks(infoB.text)) < 0 end)
for i, info in ipairs(AddonCompartmentFrame.registeredAddons) do
info = {
text = info.text,
func = onClick,
arg1 = info.func,
notCheckable = true,
}
UIDropDownMenu_AddButton(info, level)
end
end
local module = core:NewModule("Addons", {
type = "data source",
label = "Addons",
icon = [[Interface\Icons\INV_Misc_Gear_08]],
OnClick = function(self)
dropdown:Toggle(nil, self)
end,
})