/
MiniMapButtons.lua
117 lines (104 loc) · 3.81 KB
/
MiniMapButtons.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
local T, C, L, _ = unpack(select(2, ...))
if C.minimap.enable ~= true then return end
----------------------------------------------------------------------------------------
-- Switch layout mouseover button on minimap
----------------------------------------------------------------------------------------
local switch = CreateFrame("Button", "SwitchLayout", UIParent)
switch:SetTemplate("ClassColor")
if C.actionbar.toggle_mode == true then
switch:SetPoint("BOTTOMRIGHT", Minimap, "BOTTOMLEFT", -3, -2)
else
switch:SetPoint("BOTTOMRIGHT", Minimap, "BOTTOMLEFT", -3, 18)
end
switch:SetSize(19, 19)
switch:SetAlpha(0)
switch.t = switch:CreateTexture(nil, "OVERLAY")
switch.t:SetTexture("Interface\\LFGFrame\\LFGROLE")
switch.t:SetPoint("TOPLEFT", switch, 2, -2)
switch.t:SetPoint("BOTTOMRIGHT", switch, -2, 2)
switch:EnableMouse(true)
switch:RegisterForClicks("AnyUp")
switch:SetScript("OnClick", function(self, button)
if button == "LeftButton" then
SavedOptions.RaidLayout = "HEAL"
ReloadUI()
elseif button == "RightButton" then
SavedOptions.RaidLayout = "DPS"
ReloadUI()
elseif button == "MiddleButton" then
SavedOptions.RaidLayout = "NONE"
ReloadUI()
end
end)
switch:SetScript("OnEnter", function()
if InCombatLockdown() then return end
switch:FadeIn()
GameTooltip:SetOwner(switch, "ANCHOR_LEFT")
GameTooltip:AddLine(RAID_FRAMES_LABEL)
GameTooltip:AddLine(" ")
GameTooltip:AddLine(L_MINIMAP_HEAL_LAYOUT)
GameTooltip:AddLine(L_MINIMAP_DPS_LAYOUT)
GameTooltip:AddLine(L_MINIMAP_BLIZZ_LAYOUT)
GameTooltip:Show()
end)
switch:SetScript("OnLeave", function()
switch:FadeOut()
GameTooltip:Hide()
end)
switch:RegisterEvent("PLAYER_LOGIN")
switch:SetScript("OnEvent", function(self)
if SavedOptions and SavedOptions.RaidLayout == "DPS" then
switch.t:SetTexCoord(0.25, 0.5, 0, 1)
elseif SavedOptions and SavedOptions.RaidLayout == "HEAL" then
switch.t:SetTexCoord(0.75, 1, 0, 1)
elseif SavedOptions and SavedOptions.RaidLayout == "NONE" then
switch.t:SetTexture("Interface\\ChatFrame\\UI-ChatIcon-Blizz")
switch.t:SetTexCoord(0.2, 0.8, -0.1, 1.1)
elseif SavedOptions and SavedOptions.RaidLayout == "UNKNOWN" or SavedOptions == nil then
switch.t:SetTexture("Interface\\InventoryItems\\WoWUnknownItem01")
switch.t:SetTexCoord(0.2, 0.8, 0.2, 0.8)
end
end)
----------------------------------------------------------------------------------------
-- Farm mode for minimap(by Elv22)
----------------------------------------------------------------------------------------
local show = false
SlashCmdList.FARMMODE = function()
if show == false then
MinimapAnchor:SetSize(C.minimap.size * 1.65, C.minimap.size * 1.65)
Minimap:SetSize(MinimapAnchor:GetWidth(), MinimapAnchor:GetWidth())
show = true
else
MinimapAnchor:SetSize(C.minimap.size, C.minimap.size)
Minimap:SetSize(MinimapAnchor:GetWidth(), MinimapAnchor:GetWidth())
show = false
end
end
SLASH_FARMMODE1 = "/farmmode"
SLASH_FARMMODE2 = "/афкььщву"
SLASH_FARMMODE3 = "/fm"
SLASH_FARMMODE4 = "/аь"
----------------------------------------------------------------------------------------
-- Farm mode mouseover button(by m2jest1c)
----------------------------------------------------------------------------------------
local farm = CreateFrame("Button", "FarmMode", UIParent)
farm:SetTemplate("ClassColor")
farm:SetPoint("TOP", switch, "BOTTOM", 0, -1)
farm:SetSize(19, 19)
farm:SetAlpha(0)
farm.t = farm:CreateTexture(nil, "OVERLAY")
farm.t:SetTexture("Interface\\Icons\\inv_misc_map_01")
farm.t:SetTexCoord(0.1, 0.9, 0.1, 0.9)
farm.t:SetPoint("TOPLEFT", farm, 2, -2)
farm.t:SetPoint("BOTTOMRIGHT", farm, -2, 2)
farm:SetScript("OnClick", function()
SlashCmdList.FARMMODE()
end)
farm:SetScript("OnEnter", function()
if InCombatLockdown() then return end
farm:FadeIn()
end)
farm:SetScript("OnLeave", function()
farm:FadeOut()
end)
-- Edit by Oz of shestakdotorg --