forked from astralguild/AstralKeys
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MinimapButton.lua
34 lines (30 loc) · 1009 Bytes
/
MinimapButton.lua
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
local e, L = unpack(select(2, ...))
local addon = LibStub("AceAddon-3.0"):NewAddon("AstralKeys", "AceConsole-3.0")
local astralkeysLDB = LibStub("LibDataBroker-1.1"):NewDataObject("AstralKeys", {
type = "data source",
text = "AstralKeys",
icon = "Interface\\AddOns\\AstralKeys\\Media\\Texture\\Logo@2x",
OnClick = function(self, button)
if button == 'LeftButton' then
e.AstralToggle()
elseif button == 'RightButton' then
AstralOptionsFrame:SetShown( not AstralOptionsFrame:IsShown())
end
end,
OnTooltipShow = function(tooltip)
tooltip:AddLine("Astral Keys")
tooltip:AddLine('Left click to toggle main window')
tooltip:AddLine('Right Click to toggle options')
end,
})
e.icon = LibStub("LibDBIcon-1.0")
function addon:OnInitialize()
self.db = LibStub("AceDB-3.0"):New("AstralMinimap", {
profile = {
minimap = {
hide = not AstralKeysSettings.general.show_minimap_button.isEnabled,
},
},
})
e.icon:Register("AstralKeys", astralkeysLDB, self.db.profile.minimap)
end