-
Notifications
You must be signed in to change notification settings - Fork 26
/
MinimapButton.lua
35 lines (31 loc) · 1021 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
35
local _, addon = ...
local L = addon.L
LibStub("AceAddon-3.0"):NewAddon(addon, "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(_, button)
if button == 'LeftButton' then
addon.AstralToggle()
elseif button == 'RightButton' then
AstralOptionsFrame:SetShown( not AstralOptionsFrame:IsShown())
end
end,
OnTooltipShow = function(tooltip)
tooltip:AddLine("Astral Keys")
tooltip:AddLine(L['Left click to toggle main window'])
tooltip:AddLine(L['Right Click to toggle options'])
end,
})
addon.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,
},
},
})
addon.icon:Register("AstralKeys", astralkeysLDB, self.db.profile.minimap)
end