-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathMiniMapLDB.lua
More file actions
38 lines (34 loc) · 1.2 KB
/
Copy pathMiniMapLDB.lua
File metadata and controls
38 lines (34 loc) · 1.2 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
36
37
38
local BestInSlot, L = unpack(select(2,...))
local isRegistered = false
local BiSLDB = LibStub("LibDataBroker-1.1"):NewDataObject("BestInSlotRedux", {
type = "launcher",
text = "Best In Slot Redux",
icon = "Interface\\Icons\\Achievement_ChallengeMode_Gold",
OnTooltipShow = function(tooltip)
tooltip:AddLine("Best In Slot Redux")
tooltip:AddLine(("%s%s: %s%s|r"):format(BestInSlot.colorHighlight, L["Click"], BestInSlot.colorNormal, L["Show the GUI"]))
end
})
local minimapIcon = LibStub("LibDBIcon-1.0")
function BiSLDB:OnClick(button, down)
BestInSlot:ToggleFrame()
end
function BestInSlot:RegisterMinimapIcon()
minimapIcon:Register("BestInSlotRedux", BiSLDB, BestInSlot.db.profile.minimap)
isRegistered = true
end
function BestInSlot:MiniMapButtonVisible(bool)
if bool then
if not isRegistered then
self:RegisterMinimapIcon()
end
minimapIcon:Show("BestInSlotRedux")
else
if not isRegistered then return end
minimapIcon:Hide("BestInSlotRedux")
end
end
function BestInSlot:MiniMapButtonHideShow()
BestInSlot.db.char.options.minimapButton = not BestInSlot.db.char.options.minimapButton
BestInSlot:MiniMapButtonVisible(BestInSlot.db.char.options.minimapButton)
end