-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathBPBIDAccessOptions.lua
More file actions
35 lines (32 loc) · 1.03 KB
/
Copy pathBPBIDAccessOptions.lua
File metadata and controls
35 lines (32 loc) · 1.03 KB
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
29
30
31
32
33
34
35
-- Get folder path and set addon namespace
local addonname, internal = ...
local raw, properName, title, _ = C_AddOns.GetAddOnInfo(addonname)
-- Access Style ... pre/post 12.x
local categoryID = GetBPBIDOptionsID()
-- Create slash commands
SLASH_BATTLEPETBREEDID1 = "/battlepetbreedID"
SLASH_BATTLEPETBREEDID2 = "/BPBID"
SLASH_BATTLEPETBREEDID3 = "/breedID"
SlashCmdList["BATTLEPETBREEDID"] = function(msg)
Settings.OpenToCategory(categoryID)
end
-- This stuff is only supported in a Retail client
if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
local mouseButtonNote = "\n" .. title;
AddonCompartmentFrame:RegisterAddon({
text = properName,
icon = "Interface/Icons/petjournalportrait.blp",
notCheckable = true,
func = function(button, menuInputData, menu)
Settings.OpenToCategory(categoryID)
end,
funcOnEnter = function(button)
MenuUtil.ShowTooltip(button, function(tooltip)
tooltip:SetText(properName .. mouseButtonNote)
end)
end,
funcOnLeave = function(button)
MenuUtil.HideTooltip(button)
end,
})
end