-
Notifications
You must be signed in to change notification settings - Fork 0
/
GoldMakersFrame.lua
98 lines (88 loc) · 2.58 KB
/
GoldMakersFrame.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
local addon = GetAddOnMetadata(..., "Title")
local version = GetAddOnMetadata(..., "version")
local GoldMakers = LibStub("AceAddon-3.0"):GetAddon("GoldMakers")
local hbdp = LibStub("HereBeDragons-Pins-2.0")
local pinCount = 0
local Minimap = Minimap
local frameLevel = Minimap:GetFrameLevel() + 5
local frameStrata = Minimap:GetFrameStrata()
local iconP = {
[1] = {
["left"] = 0.25,
["right"] = 0.5,
["top"] = 0,
["bottom"] = 0.25,
},
[2] = {
["left"] = 0.5,
["right"] = 0.75,
["top"] = 0,
["bottom"] = 0.25,
},
[3] = {
["left"] = 0.75,
["right"] = 1,
["top"] = 0,
["bottom"] = 0.25,
},
[4] = {
["left"] = 0.25,
["right"] = 0.5,
["top"] = 0.25,
["bottom"] = 0.5,
},
[5] = {
["left"] = 0.5,
["right"] = 0.75,
["top"] = 0.25,
["bottom"] = 0.5,
},
}
function GoldMakers.NewPin()
pinCount = pinCount + 1
local pin = CreateFrame("Button", "GoldMakersPin"..pinCount, Minimap)
pin:SetFrameLevel(5)
pin:EnableMouse(true)
pin:SetWidth(12)
pin:SetHeight(12)
pin:SetPoint("CENTER", Minimap, "CENTER")
local texture = pin:CreateTexture(nil, "OVERLAY")
pin.texture = texture
texture:SetAllPoints(pin)
texture:SetTexelSnappingBias(0)
texture:SetSnapToPixelGrid(false)
pin:Hide()
return pin
end
function GoldMakers.AddPinToMinimap(coordinates, mapId)
hbdp:RemoveAllMinimapIcons("GoldMakersGoldMakers")
local max = 0
for index, value in pairs (coordinates) do
max = max + 1
end
for i = 1, max do
local icon_path = "Interface\\TargetingFrame\\UI-RaidTargetingIcons"
local icon = GoldMakers.NewPin()
icon:SetParent(Minimap)
icon:SetFrameStrata(frameStrata)
icon:SetFrameLevel(frameLevel)
icon:SetHeight(12)
icon:SetWidth(12)
icon:SetAlpha(1)
local t = icon.texture
t:SetTexture(icon_path)
t:SetTexCoord(iconP[i].left, iconP[i].right, iconP[i].top, iconP[i].bottom)
t:SetVertexColor(1, 1, 1, 1)
hbdp:AddMinimapIconMap("GoldMakersGoldMakers", icon, mapId, coordinates[i].x, coordinates[i].y, true)
end
end
function GoldMakers.addTomTomWaypoint(title, mapID, x, y)
if TomTom then
TomTom:AddWaypoint(mapID, x, y, {
title = title,
persistent = nil,
minimap = true,
world = true
})
end
end