-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminimap.lua
More file actions
80 lines (78 loc) · 3.23 KB
/
minimap.lua
File metadata and controls
80 lines (78 loc) · 3.23 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
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
74
75
76
77
78
79
80
local minimapButtonCreated = false
function Angleur_InitMinimapButton()
local colorBlu = CreateColor(0.61, 0.85, 0.92)
local colorWhite = CreateColor(1, 1, 1)
local colorYello = CreateColor(1.0, 0.82, 0.0)
local mapData = LibStub("LibDataBroker-1.1"):NewDataObject("AngleurMap", {
type = "launcher",
text = "Angleur!",
icon = "Interface\\AddOns\\AngleurClassic\\images\\angminimap.png",
OnClick = function(self, b)
if b == "RightButton" then
if InCombatLockdown() then
print("Can't change sleep state in combat.")
return
end
if AngleurCharacter.sleeping == true then
AngleurCharacter.sleeping = false
Angleur_SetSleep()
Angleur_EquipAngleurSet(true)
print(colorBlu:WrapTextInColorCode("Angleur: ") .. "Awake.")
elseif AngleurCharacter.sleeping == false then
AngleurCharacter.sleeping = true
Angleur_SetSleep()
Angleur_UnequipAngleurSet(true)
print(colorBlu:WrapTextInColorCode("Angleur: ") .. "Sleeping.")
end
elseif b == "LeftButton" then
Angleur.configPanel:Show()
elseif b == "MiddleButton" then
self:Hide()
AngleurMinimapButton.hide = true
print(colorBlu:WrapTextInColorCode("Angleur: ") .. "Minimap Icon hidden, " .. colorYello:WrapTextInColorCode("/angmini ") .. "to show.")
end
end,
OnEnter = function(self)
GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT", 45)
GameTooltip:AddLine(colorBlu:WrapTextInColorCode("Angleur"))
GameTooltip:AddLine("Left Click: " .. colorYello:WrapTextInColorCode("Config Panel"), 1, 1, 1)
GameTooltip:AddLine("Right Click: " .. colorYello:WrapTextInColorCode("Sleep/Wake"), 1, 1, 1)
GameTooltip:AddLine("Middle Button: " .. colorYello:WrapTextInColorCode("Hide Minimap Icon"), 1, 1, 1)
GameTooltip:Show()
end,
OnLeave = function(self)
GameTooltip:Hide()
end,
--Interface\\Icons\\INV_Chest_Cloth_17
})
local icon = LibStub("LibDBIcon-1.0")
icon:Register("AngleurMap", mapData , AngleurMinimapButton)
minimapButtonCreated = true
LibDBIcon10_AngleurMap:Show()
AngleurMinimapButton.hide = false
Angleur_CreateWeaponSwapFrames()
Angleur_SetMinimapSleep()
end
SLASH_ANGLEURMINIMAP1 = "/angmini"
SlashCmdList["ANGLEURMINIMAP"] = function()
if minimapButtonCreated == false then
Angleur_InitMinimapButton()
return
end
if LibDBIcon10_AngleurMap:IsShown() then
LibDBIcon10_AngleurMap:Hide()
AngleurMinimapButton.hide = true
else
LibDBIcon10_AngleurMap:Show()
AngleurMinimapButton.hide = false
Angleur_CreateWeaponSwapFrames()
end
end
function Angleur_SetMinimapSleep()
if minimapButtonCreated == false then return end
if AngleurCharacter.sleeping == true then
LibDBIcon10_AngleurMap:DesaturateHierarchy(1)
else
LibDBIcon10_AngleurMap:DesaturateHierarchy(0)
end
end