-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
launcher.lua
73 lines (63 loc) · 2.56 KB
/
launcher.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
local addonName, helpers = ...
local L = Aptechka.L
local LDBIcon = LibStub("LibDBIcon-1.0")
function Aptechka:ToggleMinimapIcon()
self.db.global.LDBData.hide = not self.db.global.LDBData.hide
if self.db.global.LDBData.hide then
LDBIcon:Hide(addonName)
else
if not LDBIcon:IsRegistered(addonName) then
self:CreteMinimapIcon()
end
LDBIcon:Show(addonName)
end
end
function Aptechka:CreteMinimapIcon()
local db = self.db.global.LDBData
local LDB_Object = LibStub('LibDataBroker-1.1'):NewDataObject(addonName, {
type = 'launcher',
icon = 135966, -- spell_holy_sealofsacrifice
iconCoords = { 0.125, 0.825, 0.11, 0.81 },
OnClick = function(_, button)
if button == "MiddleButton" then
db.hide = true
LDBIcon:Hide(addonName)
return
end
if button == "LeftButton" and IsControlKeyDown() then
return Aptechka:ToggleUnlock()
end
C_AddOns.LoadAddOn('AptechkaOptions')
Aptechka:OpenGUI()
--[[
InterfaceOptionsFrame_OpenToCategory("Aptechka")
if button == 'LeftButton' then
if IsShiftKeyDown() then
InterfaceOptionsFrame_OpenToCategory(AptechkaOptions.widgets)
else
InterfaceOptionsFrame_OpenToCategory(AptechkaOptions.profile)
end
elseif button == 'RightButton' then
if IsShiftKeyDown() then
InterfaceOptionsFrame_OpenToCategory(AptechkaOptions.statusList)
else
InterfaceOptionsFrame_OpenToCategory(AptechkaOptions.spellList)
end
end
]]
end,
OnTooltipShow = function(tooltip)
if not tooltip or not tooltip.AddLine then return end
GameTooltip_SetTitle(tooltip, string.format("%s %s",addonName, C_AddOns.GetAddOnMetadata(addonName, "version")))
GameTooltip_AddInstructionLine(tooltip, string.format("LeftClick - %s", L"Profile Settings"))
GameTooltip_AddInstructionLine(tooltip, string.format("|cffc9e06cCtrl-LeftClick - %s|r", L"Unlock"))
--[[
GameTooltip_AddInstructionLine(tooltip, string.format("Shift-LeftClick - %s", L"Widgets"))
GameTooltip_AddInstructionLine(tooltip, string.format("RightClick - %s", L"Spell List"))
GameTooltip_AddInstructionLine(tooltip, string.format("Shift-RightClick - %s", L"Status List"))
]]
GameTooltip_AddInstructionLine(tooltip, string.format("|cffe0896cMiddleClick - %s|r", L"Hide Icon"))
end
})
LDBIcon:Register(addonName, LDB_Object, db)
end