-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathMinimapButton.lua
More file actions
43 lines (36 loc) · 1.11 KB
/
MinimapButton.lua
File metadata and controls
43 lines (36 loc) · 1.11 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
39
40
41
42
43
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()
local hideMinimap = false
if AstralKeysSettings.general then
hideMinimap = not AstralKeysSettings.general.show_minimap_button.isEnabled
end
self.db = LibStub("AceDB-3.0"):New("AstralMinimap", {
profile = {
minimap = {
hide = hideMinimap,
},
},
})
addon.icon:Register("AstralKeys", astralkeysLDB, self.db.profile.minimap)
addon.Debug = false
end