|
Tercio@11
|
1
|
|
Tercio@11
|
2 local DF = _G ["DetailsFramework"]
|
|
Tercio@11
|
3 if (not DF) then
|
|
Tercio@11
|
4 print ("|cFFFFAA00Please restart your client to finish update some AddOns.|c")
|
|
Tercio@11
|
5 return
|
|
Tercio@11
|
6 end
|
|
Tercio@11
|
7
|
|
Tercio@0
|
8 local floor = floor
|
|
Tercio@0
|
9 local min = min
|
|
Tercio@0
|
10 local UnitExists = UnitExists
|
|
Tercio@0
|
11 local GetPlayerMapPosition = GetPlayerMapPosition
|
|
Tercio@0
|
12 local UnitHealth = UnitHealth
|
|
Tercio@4
|
13 local GetNumGroupMembers = GetNumGroupMembers
|
|
Tercio@4
|
14 local abs = abs
|
|
Tercio@6
|
15 local GetPlayerFacing = GetPlayerFacing
|
|
Tercio@11
|
16 local db
|
|
Tercio@11
|
17 local _
|
|
Tercio@0
|
18
|
|
Tercio@11
|
19 --local f = CreateFrame ("frame", "Hansgar_And_Franzok_Assist", UIParent)
|
|
Tercio@13
|
20 local f = DF:Create1PxPanel (_, 155, 166, "Hans & Franz", "Hansgar_And_Franzok_Assist", nil, "top", true)
|
|
Tercio@0
|
21 f:SetFrameStrata ("DIALOG")
|
|
Tercio@13
|
22 f.version = "v0.13"
|
|
Tercio@11
|
23
|
|
Tercio@11
|
24 f.Close:SetScript ("OnClick", function (self)
|
|
Tercio@11
|
25 if (f.StampersPhase) then
|
|
Tercio@11
|
26 return f:StopTracking()
|
|
Tercio@11
|
27 end
|
|
Tercio@11
|
28 f:EndTrackPlayerPosition()
|
|
Tercio@11
|
29 end)
|
|
Tercio@11
|
30
|
|
Tercio@11
|
31 f.Lock:SetScript ("OnClick", function (self)
|
|
Tercio@11
|
32 if (db.FRAME_LOCK) then
|
|
Tercio@11
|
33 f:SetLockState()
|
|
Tercio@11
|
34 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame unlocked.")
|
|
Tercio@11
|
35
|
|
Tercio@11
|
36 f.unlocked_frame = true
|
|
Tercio@11
|
37 f.player_pos_frame:Show()
|
|
Tercio@11
|
38 f.player_bar:Show()
|
|
Tercio@11
|
39 f.stop_casting_frame:Show()
|
|
Tercio@11
|
40 else
|
|
Tercio@11
|
41 f:SetLockState()
|
|
Tercio@11
|
42 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame locked.")
|
|
Tercio@11
|
43 f.unlocked_frame = false
|
|
Tercio@11
|
44 f.stop_casting_frame:Hide()
|
|
Tercio@11
|
45 end
|
|
Tercio@11
|
46 end)
|
|
Tercio@0
|
47
|
|
Tercio@4
|
48 local tframe = CreateFrame ("frame", "Hansgar_And_Franzok_Assist_PTrack", UIParent)
|
|
Tercio@4
|
49
|
|
Tercio@11
|
50 f:SetSize (155, 159)
|
|
Tercio@0
|
51 f:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = -1, right = -1, top = -1, bottom = -1},
|
|
Tercio@0
|
52 edgeFile = "Interface\\AddOns\\Hansgar_And_Franzok_Assist\\border_2", edgeSize = 8})
|
|
Tercio@7
|
53 f:SetPoint ("center", UIParent, "center", 300, 200)
|
|
Tercio@0
|
54 f:SetBackdropColor (0, 0, 0, 0)
|
|
Tercio@0
|
55 f:SetBackdropBorderColor (0, 0, 0, 1)
|
|
Tercio@0
|
56 f:SetMovable (true)
|
|
Tercio@0
|
57 f:EnableMouse (true)
|
|
Tercio@5
|
58 f.all_blocks = {}
|
|
Tercio@0
|
59 f:Hide()
|
|
Tercio@0
|
60
|
|
Tercio@11
|
61 --local title = f:CreateFontString (nil, "overlay", "GameFontNormal")
|
|
Tercio@11
|
62 --title:SetText ("Hansgar & Franzok Assist")
|
|
Tercio@11
|
63 --title:SetPoint ("center", f, "center")
|
|
Tercio@11
|
64 --title:SetPoint ("bottom", f, "top", 0, 2)
|
|
Tercio@0
|
65
|
|
Tercio@0
|
66 --
|
|
Tercio@0
|
67 local frame_event = CreateFrame ("frame", "Hansgar_And_Franzok_AssistEvents", f)
|
|
Tercio@0
|
68 frame_event:RegisterEvent ("ENCOUNTER_START")
|
|
Tercio@0
|
69 frame_event:RegisterEvent ("ENCOUNTER_END")
|
|
Tercio@0
|
70 frame_event:RegisterEvent ("ADDON_LOADED")
|
|
Tercio@0
|
71
|
|
Tercio@0
|
72 --
|
|
Tercio@7
|
73 local player_bar = CreateFrame ("statusbar", "Hansgar_And_Franzok_PlayerAssistBar", UIParent)
|
|
Tercio@7
|
74
|
|
Tercio@7
|
75 --player_bar:SetPoint ("topleft", f, "bottomleft", 0, -3)
|
|
Tercio@7
|
76 --player_bar:SetPoint ("topright", f, "bottomright", 0, -3)
|
|
Tercio@7
|
77
|
|
Tercio@7
|
78 player_bar:SetPoint ("center", UIParent, "center", 0, 300)
|
|
Tercio@9
|
79 player_bar:SetSize (280, 16)
|
|
Tercio@7
|
80
|
|
Tercio@7
|
81 player_bar:SetMovable (true)
|
|
Tercio@7
|
82 player_bar:EnableMouse (true)
|
|
Tercio@7
|
83 player_bar:SetResizable (true)
|
|
Tercio@0
|
84 player_bar:SetStatusBarColor (0, 0, 0, 0)
|
|
Tercio@0
|
85 player_bar:SetMinMaxValues (0, 100)
|
|
Tercio@0
|
86 player_bar:SetValue (0)
|
|
Tercio@7
|
87 player_bar:SetMinResize (50, 15)
|
|
Tercio@7
|
88 player_bar:SetMaxResize (500, 40)
|
|
Tercio@7
|
89 player_bar:Hide()
|
|
Tercio@7
|
90
|
|
Tercio@7
|
91 local player_bar_backgroud = player_bar:CreateTexture (nil, "background")
|
|
Tercio@7
|
92 player_bar_backgroud:SetTexture (0, 0, 0, 0.2)
|
|
Tercio@7
|
93 player_bar_backgroud:SetAllPoints()
|
|
Tercio@7
|
94
|
|
Tercio@7
|
95 local icon = player_bar:CreateTexture (nil, "overlay")
|
|
Tercio@7
|
96 icon:SetTexture ([[Interface\HELPFRAME\ReportLagIcon-Movement]])
|
|
Tercio@7
|
97 icon:SetPoint ("left", player_bar, "left")
|
|
Tercio@7
|
98 icon:SetDesaturated (true)
|
|
Tercio@7
|
99 player_bar.icon = icon
|
|
Tercio@7
|
100
|
|
Tercio@7
|
101 local text = player_bar:CreateFontString (nil, "overlay", "GameFontNormal")
|
|
Tercio@7
|
102 text:SetPoint ("right", player_bar, "right", -2, 0)
|
|
Tercio@7
|
103 player_bar.text = text
|
|
Tercio@7
|
104
|
|
Tercio@7
|
105 player_bar:SetScript ("OnMouseDown", function (self)
|
|
Tercio@7
|
106 if (not self.isMoving) then
|
|
Tercio@7
|
107 self:StartMoving()
|
|
Tercio@7
|
108 self.isMoving = true
|
|
Tercio@7
|
109 end
|
|
Tercio@7
|
110 end)
|
|
Tercio@7
|
111 player_bar:SetScript ("OnMouseUp", function (self)
|
|
Tercio@7
|
112 if (self.isMoving) then
|
|
Tercio@7
|
113 self:StopMovingOrSizing()
|
|
Tercio@7
|
114 self.isMoving = false
|
|
Tercio@7
|
115 end
|
|
Tercio@7
|
116 end)
|
|
Tercio@7
|
117 player_bar:SetScript ("OnSizeChanged", function (self)
|
|
Tercio@7
|
118 self.icon:SetSize (self:GetHeight(), self:GetHeight())
|
|
Tercio@7
|
119
|
|
Tercio@7
|
120 end)
|
|
Tercio@7
|
121 local grip = CreateFrame ("button", "Hansgar_And_Franzok_AssistPlayerBarButton", player_bar)
|
|
Tercio@7
|
122 grip:SetPoint ("bottomright", player_bar, "bottomright")
|
|
Tercio@7
|
123 grip:SetSize (16, 16)
|
|
Tercio@7
|
124 grip:SetScript ("OnMouseDown", function (self, button)
|
|
Tercio@7
|
125 if (not player_bar.isMoving and button == "LeftButton") then
|
|
Tercio@7
|
126 player_bar:StartSizing ("bottomright")
|
|
Tercio@7
|
127 player_bar.isMoving = true
|
|
Tercio@7
|
128 end
|
|
Tercio@7
|
129 end)
|
|
Tercio@7
|
130 grip:SetScript ("OnMouseUp", function (self, button)
|
|
Tercio@7
|
131 if (player_bar.isMoving and button == "LeftButton") then
|
|
Tercio@7
|
132 player_bar:StopMovingOrSizing()
|
|
Tercio@7
|
133 player_bar.isMoving = false
|
|
Tercio@7
|
134 end
|
|
Tercio@7
|
135 end)
|
|
Tercio@7
|
136 grip:SetNormalTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Up]])
|
|
Tercio@7
|
137 grip:SetHighlightTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Highlight]])
|
|
Tercio@7
|
138 grip:SetPushedTexture ([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Down]])
|
|
Tercio@7
|
139
|
|
Tercio@7
|
140 player_bar.grip = grip
|
|
Tercio@0
|
141 f.player_bar = player_bar
|
|
Tercio@0
|
142
|
|
Tercio@7
|
143
|
|
Tercio@0
|
144 player_bar.texture = player_bar:CreateTexture (nil, "overlay")
|
|
Tercio@0
|
145 player_bar.texture:SetTexture ("Interface\\AddOns\\Hansgar_And_Franzok_Assist\\bar_skyline")
|
|
Tercio@0
|
146 player_bar:SetStatusBarTexture (player_bar.texture)
|
|
Tercio@0
|
147
|
|
Tercio@0
|
148 --
|
|
Tercio@0
|
149
|
|
Tercio@7
|
150 local player_pos_frame = CreateFrame ("frame", "Hansgar_And_Franzok_Assist_BarDance", UIParent)
|
|
Tercio@13
|
151 local player_pos_frame2 = CreateFrame ("frame", "Hansgar_And_Franzok_Assist_BarDance2", UIParent)
|
|
Tercio@7
|
152
|
|
Tercio@7
|
153 player_pos_frame:SetPoint ("center", UIParent, "center", 0, -75)
|
|
Tercio@13
|
154 player_pos_frame2:SetPoint ("bottomleft", player_pos_frame, "bottomleft")
|
|
Tercio@7
|
155
|
|
Tercio@13
|
156 player_pos_frame2:SetSize (6, 155)
|
|
Tercio@7
|
157 player_pos_frame:SetSize (155, 6)
|
|
Tercio@13
|
158
|
|
Tercio@13
|
159 local player_pos_frame_backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = -1, right = -1, top = -1, bottom = -1}}
|
|
Tercio@13
|
160 player_pos_frame:SetBackdrop (player_pos_frame_backdrop)
|
|
Tercio@13
|
161 player_pos_frame2:SetBackdrop (player_pos_frame_backdrop)
|
|
Tercio@9
|
162 player_pos_frame:SetBackdropColor (0, 0, 0, 1)
|
|
Tercio@13
|
163 player_pos_frame2:SetBackdropColor (0, 0, 0, 1)
|
|
Tercio@13
|
164 player_pos_frame2:Hide()
|
|
Tercio@7
|
165 player_pos_frame:SetMovable (true)
|
|
Tercio@7
|
166 player_pos_frame:EnableMouse (true)
|
|
Tercio@7
|
167 player_pos_frame:SetScript ("OnMouseDown", function (self)
|
|
Tercio@7
|
168 if (not self.isMoving) then
|
|
Tercio@7
|
169 self:StartMoving()
|
|
Tercio@7
|
170 self.isMoving = true
|
|
Tercio@7
|
171 end
|
|
Tercio@7
|
172 end)
|
|
Tercio@7
|
173 player_pos_frame:SetScript ("OnMouseUp", function (self)
|
|
Tercio@7
|
174 if (self.isMoving) then
|
|
Tercio@7
|
175 self:StopMovingOrSizing()
|
|
Tercio@7
|
176 self.isMoving = false
|
|
Tercio@7
|
177 end
|
|
Tercio@7
|
178 end)
|
|
Tercio@4
|
179 player_pos_frame:Hide()
|
|
Tercio@11
|
180 f.player_pos_frame = player_pos_frame
|
|
Tercio@4
|
181
|
|
Tercio@4
|
182 --red
|
|
Tercio@4
|
183 local t1 = player_pos_frame:CreateTexture (nil, "artwork")
|
|
Tercio@4
|
184 t1:SetPoint ("left", player_pos_frame, "left")
|
|
Tercio@7
|
185 t1:SetSize (player_pos_frame:GetWidth()*0.30, 6)
|
|
Tercio@4
|
186 t1:SetTexture (1, 1, 1)
|
|
Tercio@4
|
187 t1:SetVertexColor (1, 0.2, 0.2, 0.4)
|
|
Tercio@4
|
188 --green
|
|
Tercio@4
|
189 local t2 = player_pos_frame:CreateTexture (nil, "artwork")
|
|
Tercio@4
|
190 t2:SetPoint ("left", t1, "right")
|
|
Tercio@7
|
191 t2:SetSize (player_pos_frame:GetWidth()*0.15, 6)
|
|
Tercio@4
|
192 t2:SetTexture (0.2, 1, 0.2, 0.4)
|
|
Tercio@4
|
193 --red
|
|
Tercio@4
|
194 local middle = player_pos_frame:CreateTexture (nil, "artwork")
|
|
Tercio@4
|
195 middle:SetPoint ("left", t2, "right")
|
|
Tercio@7
|
196 middle:SetSize (player_pos_frame:GetWidth()*0.10, 6)
|
|
Tercio@4
|
197 middle:SetTexture (1, 1, 1)
|
|
Tercio@4
|
198 middle:SetVertexColor (1, 0.2, 0.2, 0.4)
|
|
Tercio@4
|
199 --green
|
|
Tercio@4
|
200 local t3 = player_pos_frame:CreateTexture (nil, "artwork")
|
|
Tercio@4
|
201 t3:SetPoint ("left", middle, "right")
|
|
Tercio@7
|
202 t3:SetSize (player_pos_frame:GetWidth()*0.15, 6)
|
|
Tercio@4
|
203 t3:SetTexture (0.2, 1, 0.2, 0.4)
|
|
Tercio@4
|
204 --red
|
|
Tercio@4
|
205 local t4 = player_pos_frame:CreateTexture (nil, "artwork")
|
|
Tercio@4
|
206 t4:SetPoint ("left", t3, "right")
|
|
Tercio@7
|
207 t4:SetSize (player_pos_frame:GetWidth()*0.30, 6)
|
|
Tercio@4
|
208 t4:SetTexture (1, 1, 1)
|
|
Tercio@4
|
209 t4:SetVertexColor (1, 0.2, 0.2, 0.4)
|
|
Tercio@4
|
210
|
|
Tercio@13
|
211 --red
|
|
Tercio@13
|
212 local t1_2 = player_pos_frame:CreateTexture (nil, "artwork")
|
|
Tercio@13
|
213 t1_2:SetPoint ("bottomleft", player_pos_frame, "bottomleft")
|
|
Tercio@13
|
214 t1_2:SetSize (6, player_pos_frame:GetWidth()*0.30)
|
|
Tercio@13
|
215 t1_2:SetTexture (1, 1, 1)
|
|
Tercio@13
|
216 t1_2:SetVertexColor (1, 0.2, 0.2, 0.4)
|
|
Tercio@13
|
217 --green
|
|
Tercio@13
|
218 local t2_2 = player_pos_frame:CreateTexture (nil, "artwork")
|
|
Tercio@13
|
219 t2_2:SetPoint ("bottom", t1_2, "top")
|
|
Tercio@13
|
220 t2_2:SetSize (6, player_pos_frame:GetWidth()*0.15)
|
|
Tercio@13
|
221 t2_2:SetTexture (0.2, 1, 0.2, 0.4)
|
|
Tercio@13
|
222 --red
|
|
Tercio@13
|
223 local middle_2 = player_pos_frame:CreateTexture (nil, "artwork")
|
|
Tercio@13
|
224 middle_2:SetPoint ("bottom", t2_2, "top")
|
|
Tercio@13
|
225 middle_2:SetSize (6, player_pos_frame:GetWidth()*0.10)
|
|
Tercio@13
|
226 middle_2:SetTexture (1, 1, 1)
|
|
Tercio@13
|
227 middle_2:SetVertexColor (1, 0.2, 0.2, 0.4)
|
|
Tercio@13
|
228 --green
|
|
Tercio@13
|
229 local t3_2 = player_pos_frame:CreateTexture (nil, "artwork")
|
|
Tercio@13
|
230 t3_2:SetPoint ("bottom", middle_2, "top")
|
|
Tercio@13
|
231 t3_2:SetSize (6, player_pos_frame:GetWidth()*0.15)
|
|
Tercio@13
|
232 t3_2:SetTexture (0.2, 1, 0.2, 0.4)
|
|
Tercio@13
|
233 --red
|
|
Tercio@13
|
234 local t4_2 = player_pos_frame:CreateTexture (nil, "artwork")
|
|
Tercio@13
|
235 t4_2:SetPoint ("bottom", t3_2, "top")
|
|
Tercio@13
|
236 t4_2:SetSize (6, player_pos_frame:GetWidth()*0.30)
|
|
Tercio@13
|
237 t4_2:SetTexture (1, 1, 1)
|
|
Tercio@13
|
238 t4_2:SetVertexColor (1, 0.2, 0.2, 0.4)
|
|
Tercio@13
|
239
|
|
Tercio@13
|
240 t1_2:Hide()
|
|
Tercio@13
|
241 t2_2:Hide()
|
|
Tercio@13
|
242 t3_2:Hide()
|
|
Tercio@13
|
243 t4_2:Hide()
|
|
Tercio@13
|
244 middle_2:Hide()
|
|
Tercio@13
|
245
|
|
Tercio@4
|
246 local div = player_pos_frame:CreateTexture (nil, "overlay")
|
|
Tercio@4
|
247 div:SetPoint ("left", player_pos_frame, "left", 0, 0)
|
|
Tercio@4
|
248 div:SetTexture (1, 1, 1, 1)
|
|
Tercio@4
|
249 div:SetSize (1, 16)
|
|
Tercio@4
|
250 div:Hide()
|
|
Tercio@4
|
251 --
|
|
Tercio@4
|
252
|
|
Tercio@4
|
253 local AceTimer = LibStub:GetLibrary ("AceTimer-3.0")
|
|
Tercio@4
|
254 AceTimer:Embed (f)
|
|
Tercio@4
|
255 local AceComm = LibStub:GetLibrary ("AceComm-3.0")
|
|
Tercio@4
|
256 AceComm:Embed (f)
|
|
Tercio@4
|
257
|
|
Tercio@5
|
258 function f:CommReceived (_, data, _, source)
|
|
Tercio@5
|
259 if (data == "US") then
|
|
Tercio@5
|
260 f:SendCommMessage ("HAFR", UnitName ("player") .. " " .. f.version, "RAID")
|
|
Tercio@6
|
261 elseif (f.users) then
|
|
Tercio@5
|
262 f.users [data] = true
|
|
Tercio@5
|
263 end
|
|
Tercio@5
|
264 end
|
|
Tercio@5
|
265 function f:ShowUsers()
|
|
Tercio@5
|
266
|
|
Tercio@5
|
267 local users_frame = Hansgar_And_Franzok_Assist_UsersPanel
|
|
Tercio@5
|
268 if (not users_frame) then
|
|
Tercio@5
|
269 users_frame = CreateFrame ("frame", "Hansgar_And_Franzok_Assist_UsersPanel", UIParent)
|
|
Tercio@5
|
270 users_frame:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = -1, right = -1, top = -1, bottom = -1},
|
|
Tercio@5
|
271 edgeFile = "Interface\\AddOns\\Hansgar_And_Franzok_Assist\\border_2", edgeSize = 8})
|
|
Tercio@5
|
272 users_frame:SetBackdropColor (0, 0, 0, 1)
|
|
Tercio@5
|
273 tinsert (UISpecialFrames, "Hansgar_And_Franzok_Assist_UsersPanel")
|
|
Tercio@5
|
274 users_frame:SetSize (200, 500)
|
|
Tercio@5
|
275 users_frame:SetPoint ("right", f, "left", -15, 0)
|
|
Tercio@5
|
276 users_frame.text = users_frame:CreateFontString (nil, "overlay", "GameFontHighlight")
|
|
Tercio@5
|
277 users_frame.text:SetPoint ("topleft", users_frame, "topleft", 10, -10)
|
|
Tercio@5
|
278 users_frame.text:SetJustifyH ("left")
|
|
Tercio@5
|
279
|
|
Tercio@5
|
280 users_frame.title = users_frame:CreateFontString (nil, "overlay", "GameFontNormal")
|
|
Tercio@5
|
281 users_frame.title:SetText ("Hansgar & Franzok Assist: Users")
|
|
Tercio@5
|
282 users_frame.title:SetPoint ("center", users_frame, "center")
|
|
Tercio@5
|
283 users_frame.title:SetPoint ("bottom", users_frame, "top", 0, 2)
|
|
Tercio@5
|
284
|
|
Tercio@5
|
285 end
|
|
Tercio@5
|
286
|
|
Tercio@5
|
287 local s = ""
|
|
Tercio@5
|
288
|
|
Tercio@5
|
289 for key, value in pairs (f.users) do
|
|
Tercio@5
|
290 s = s .. "|cFF33FF33" .. key .. "\n"
|
|
Tercio@5
|
291 end
|
|
Tercio@5
|
292
|
|
Tercio@5
|
293 s = s .. "|r\n\n\n|cFFFFFFFFOut of Date or Not installed:|r\n\n"
|
|
Tercio@5
|
294
|
|
Tercio@5
|
295 for i = 1, GetNumGroupMembers() do
|
|
Tercio@5
|
296 local name = UnitName ("raid" .. i)
|
|
Tercio@5
|
297 if (not s:find (name)) then
|
|
Tercio@5
|
298 s = s .. "|cFFFF3333" .. name .. "|r\n"
|
|
Tercio@5
|
299 end
|
|
Tercio@5
|
300 end
|
|
Tercio@5
|
301
|
|
Tercio@5
|
302 users_frame.text:SetText (s)
|
|
Tercio@5
|
303
|
|
Tercio@5
|
304 users_frame:Show()
|
|
Tercio@6
|
305
|
|
Tercio@6
|
306 f.users = nil
|
|
Tercio@6
|
307 f.users_schedule = nil
|
|
Tercio@5
|
308
|
|
Tercio@5
|
309 end
|
|
Tercio@5
|
310 f:RegisterComm ("HAFR", "CommReceived")
|
|
Tercio@5
|
311
|
|
Tercio@4
|
312 f.block_tracker = {}
|
|
Tercio@4
|
313
|
|
Tercio@0
|
314 frame_event:SetFrameStrata ("FULLSCREEN")
|
|
Tercio@0
|
315
|
|
Tercio@0
|
316 frame_event:SetScript ("OnEvent", function (self, event, ...)
|
|
Tercio@0
|
317
|
|
Tercio@0
|
318 if (event == "ADDON_LOADED" and select (1, ...) == "Hansgar_And_Franzok_Assist") then
|
|
Tercio@12
|
319 --/dump Hansgar_And_Franzok_DB.STAMPERS_DELAY
|
|
Tercio@0
|
320 db = Hansgar_And_Franzok_DB
|
|
Tercio@0
|
321 if (not db) then
|
|
Tercio@0
|
322 db = {}
|
|
Tercio@0
|
323 Hansgar_And_Franzok_DB = db
|
|
Tercio@0
|
324 end
|
|
Tercio@4
|
325 --
|
|
Tercio@0
|
326 db.STAMPERS_DELAY = db.STAMPERS_DELAY or 5
|
|
Tercio@4
|
327 if (db.CD_NUMBER == nil) then
|
|
Tercio@4
|
328 db.CD_NUMBER = false
|
|
Tercio@4
|
329 end
|
|
Tercio@4
|
330 if (db.SHOW_DANCE == nil) then
|
|
Tercio@4
|
331 db.SHOW_DANCE = true
|
|
Tercio@4
|
332 end
|
|
Tercio@5
|
333 if (db.FRAME_LOCK == nil) then
|
|
Tercio@5
|
334 db.FRAME_LOCK = false
|
|
Tercio@5
|
335 end
|
|
Tercio@6
|
336 if (db.AUTO_FACING == nil) then
|
|
Tercio@6
|
337 db.AUTO_FACING = true
|
|
Tercio@6
|
338 end
|
|
Tercio@6
|
339 if (db.FACING_SIDE == nil) then
|
|
Tercio@6
|
340 db.FACING_SIDE = 1
|
|
Tercio@6
|
341 end
|
|
Tercio@7
|
342 if (db.SHOW_MAIN_FRAME == nil) then
|
|
Tercio@7
|
343 db.SHOW_MAIN_FRAME = true
|
|
Tercio@7
|
344 end
|
|
Tercio@7
|
345 if (db.PLAY_SOUND == nil) then
|
|
Tercio@7
|
346 db.PLAY_SOUND = false
|
|
Tercio@7
|
347 end
|
|
Tercio@9
|
348 if (db.STOP_CAST == nil) then
|
|
Tercio@9
|
349 db.STOP_CAST = true
|
|
Tercio@9
|
350 end
|
|
Tercio@4
|
351 --
|
|
Tercio@7
|
352
|
|
Tercio@7
|
353 f:SetLockState (true)
|
|
Tercio@7
|
354
|
|
Tercio@0
|
355 elseif (event == "ENCOUNTER_START" or event == "ENCOUNTER_END") then
|
|
Tercio@0
|
356
|
|
Tercio@0
|
357 local encounterID, encounterName, difficultyID, raidSize = select (1, ...)
|
|
Tercio@4
|
358
|
|
Tercio@4
|
359 if (encounterID == 1693) then
|
|
Tercio@9
|
360 if (f.unlocked_frame) then
|
|
Tercio@9
|
361 f.unlocked_frame = false
|
|
Tercio@9
|
362 end
|
|
Tercio@9
|
363
|
|
Tercio@4
|
364 if (event == "ENCOUNTER_START") then
|
|
Tercio@4
|
365 f.on_encounter = true
|
|
Tercio@9
|
366 f:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
|
|
Tercio@9
|
367
|
|
Tercio@4
|
368 elseif (event == "ENCOUNTER_END") then
|
|
Tercio@4
|
369 f.on_encounter = false
|
|
Tercio@9
|
370 f:UnregisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
|
|
Tercio@4
|
371 end
|
|
Tercio@4
|
372 end
|
|
Tercio@4
|
373
|
|
Tercio@4
|
374 if (encounterID == 1693 and db.SHOW_DANCE) then
|
|
Tercio@4
|
375 if (event == "ENCOUNTER_START") then
|
|
Tercio@4
|
376 SetMapToCurrentZone()
|
|
Tercio@4
|
377 f:StartTrackPlayerPosition()
|
|
Tercio@4
|
378 elseif (event == "ENCOUNTER_END") then
|
|
Tercio@4
|
379 f:EndTrackPlayerPosition()
|
|
Tercio@4
|
380 end
|
|
Tercio@4
|
381 end
|
|
Tercio@4
|
382
|
|
Tercio@0
|
383 if (encounterID == 1693 and difficultyID == 16) then
|
|
Tercio@0
|
384
|
|
Tercio@0
|
385 if (event == "ENCOUNTER_START") then
|
|
Tercio@0
|
386 print ("|cFFFFAA00Hansgar and Franzok Assist|r: addon enabled, good look!")
|
|
Tercio@0
|
387
|
|
Tercio@0
|
388 if (f.StampersPhase) then
|
|
Tercio@0
|
389 f:StopTracking()
|
|
Tercio@0
|
390 end
|
|
Tercio@0
|
391
|
|
Tercio@0
|
392 elseif (event == "ENCOUNTER_END") then
|
|
Tercio@0
|
393 if (f.StampersPhase) then
|
|
Tercio@0
|
394 f:StopTracking()
|
|
Tercio@0
|
395 end
|
|
Tercio@4
|
396
|
|
Tercio@4
|
397 f:EndTrackPlayerPosition()
|
|
Tercio@0
|
398 end
|
|
Tercio@0
|
399 end
|
|
Tercio@0
|
400 end
|
|
Tercio@0
|
401
|
|
Tercio@0
|
402 end)
|
|
Tercio@0
|
403
|
|
Tercio@6
|
404 SLASH_Hansgar_And_Franzok_Assist1, SLASH_Hansgar_And_Franzok_Assist2 = "/hansgar", "/franzok"
|
|
Tercio@6
|
405 function SlashCmdList.Hansgar_And_Franzok_Assist (msg, editbox)
|
|
Tercio@6
|
406
|
|
Tercio@6
|
407 local command, rest = msg:match ("^(%S*)%s*(.-)$")
|
|
Tercio@6
|
408
|
|
Tercio@6
|
409 if (command == "users") then
|
|
Tercio@6
|
410 if (f.users_schedule) then
|
|
Tercio@6
|
411 print ("|cFFFFAA00Hansgar and Franzok Assist|r please wait 5 seconds...")
|
|
Tercio@6
|
412 elseif (IsInRaid()) then
|
|
Tercio@6
|
413 f.users = {}
|
|
Tercio@6
|
414 f:SendCommMessage ("HAFR", "US", "RAID")
|
|
Tercio@6
|
415 f.users_schedule = f:ScheduleTimer ("ShowUsers", 5)
|
|
Tercio@6
|
416 print ("|cFFFFAA00Hansgar and Franzok Assist|r please wait 5 seconds...")
|
|
Tercio@6
|
417 else
|
|
Tercio@6
|
418 print ("|cFFFFAA00Hansgar and Franzok Assist|r you aren't in a raid group.")
|
|
Tercio@6
|
419 end
|
|
Tercio@6
|
420
|
|
Tercio@10
|
421 elseif (command == "st") then
|
|
Tercio@10
|
422 f.stop_casting_frame:Show()
|
|
Tercio@10
|
423 f.stop_casting_frame.alert.animOut:Stop()
|
|
Tercio@10
|
424 f.stop_casting_frame.alert.animIn:Play()
|
|
Tercio@10
|
425 f:ScheduleTimer ("HideStopSpellAlert", 1.2)
|
|
Tercio@10
|
426
|
|
Tercio@9
|
427 elseif (command == "stopcast") then
|
|
Tercio@9
|
428 db.STOP_CAST = not db.STOP_CAST
|
|
Tercio@9
|
429
|
|
Tercio@9
|
430 if (db.STOP_CAST) then
|
|
Tercio@9
|
431 print ("|cFFFFAA00Hansgar and Franzok Assist|r stop cast alert enabled.")
|
|
Tercio@9
|
432 else
|
|
Tercio@9
|
433 print ("|cFFFFAA00Hansgar and Franzok Assist|r stop cast alert disabled.")
|
|
Tercio@9
|
434 end
|
|
Tercio@9
|
435
|
|
Tercio@9
|
436 elseif (command == "resetpos") then
|
|
Tercio@9
|
437 f:ClearAllPoints()
|
|
Tercio@9
|
438 f:SetPoint ("center", UIParent, "center")
|
|
Tercio@9
|
439
|
|
Tercio@9
|
440 player_bar:ClearAllPoints()
|
|
Tercio@9
|
441 player_bar:SetPoint ("center", UIParent, "center")
|
|
Tercio@9
|
442
|
|
Tercio@9
|
443 player_pos_frame:ClearAllPoints()
|
|
Tercio@9
|
444 player_pos_frame:SetPoint ("center", UIParent, "center")
|
|
Tercio@9
|
445
|
|
Tercio@9
|
446 if (f.StampersPhase) then
|
|
Tercio@9
|
447 f:EndTrackPlayerPosition()
|
|
Tercio@9
|
448 f:StopTracking()
|
|
Tercio@9
|
449 end
|
|
Tercio@9
|
450
|
|
Tercio@9
|
451 db.FRAME_LOCK = true
|
|
Tercio@9
|
452 f:SetLockState()
|
|
Tercio@9
|
453
|
|
Tercio@9
|
454 f.unlocked_frame = true
|
|
Tercio@9
|
455
|
|
Tercio@9
|
456 f:StartTracking()
|
|
Tercio@9
|
457 f:StartTrackPlayerPosition()
|
|
Tercio@9
|
458
|
|
Tercio@9
|
459 print ("|cFFFFAA00Hansgar and Franzok Assist|r: position reseted.")
|
|
Tercio@9
|
460 print ("|cFFFFAA00Hansgar and Franzok Assist|r: move between the tracks to show the other frames.")
|
|
Tercio@9
|
461 print ("|cFFFFAA00Hansgar and Franzok Assist|r: type '/hansgar lock' to lock the frames.")
|
|
Tercio@9
|
462
|
|
Tercio@6
|
463 elseif (command == "delay") then
|
|
Tercio@6
|
464 local t = tonumber (rest)
|
|
Tercio@6
|
465 if (t) then
|
|
Tercio@6
|
466 db.STAMPERS_DELAY = t
|
|
Tercio@6
|
467 print ("|cFFFFAA00Hansgar and Franzok Assist|r delay set to: ", t)
|
|
Tercio@6
|
468 else
|
|
Tercio@6
|
469 print ("|cFFFFAA00Hansgar and Franzok Assist|r invalid time.", t)
|
|
Tercio@6
|
470 end
|
|
Tercio@6
|
471
|
|
Tercio@6
|
472 elseif (command == "test" or command == "show") then
|
|
Tercio@6
|
473 if (f.StampersPhase) then
|
|
Tercio@6
|
474 f:EndTrackPlayerPosition()
|
|
Tercio@6
|
475 return f:StopTracking()
|
|
Tercio@6
|
476 end
|
|
Tercio@6
|
477
|
|
Tercio@6
|
478 f:StartTracking()
|
|
Tercio@6
|
479 f:StartTrackPlayerPosition()
|
|
Tercio@6
|
480
|
|
Tercio@6
|
481 elseif (command == "hide") then
|
|
Tercio@6
|
482 if (f.StampersPhase) then
|
|
Tercio@6
|
483 return f:StopTracking()
|
|
Tercio@6
|
484 end
|
|
Tercio@6
|
485 f:EndTrackPlayerPosition()
|
|
Tercio@6
|
486
|
|
Tercio@7
|
487 elseif (command == "unlock") then
|
|
Tercio@7
|
488 db.FRAME_LOCK = true
|
|
Tercio@7
|
489 f:SetLockState()
|
|
Tercio@7
|
490 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame unlocked.")
|
|
Tercio@9
|
491
|
|
Tercio@9
|
492 f.unlocked_frame = true
|
|
Tercio@9
|
493 player_pos_frame:Show()
|
|
Tercio@9
|
494 player_bar:Show()
|
|
Tercio@10
|
495 f.stop_casting_frame:Show()
|
|
Tercio@7
|
496
|
|
Tercio@6
|
497 elseif (command == "lock") then
|
|
Tercio@6
|
498 f:SetLockState()
|
|
Tercio@6
|
499
|
|
Tercio@6
|
500 if (db.FRAME_LOCK) then
|
|
Tercio@6
|
501 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame locked.")
|
|
Tercio@9
|
502 f.unlocked_frame = false
|
|
Tercio@10
|
503 f.stop_casting_frame:Hide()
|
|
Tercio@6
|
504 else
|
|
Tercio@6
|
505 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame unlocked.")
|
|
Tercio@9
|
506
|
|
Tercio@9
|
507 f.unlocked_frame = true
|
|
Tercio@9
|
508 player_pos_frame:Show()
|
|
Tercio@9
|
509 player_bar:Show()
|
|
Tercio@10
|
510 f.stop_casting_frame:Show()
|
|
Tercio@9
|
511
|
|
Tercio@6
|
512 end
|
|
Tercio@6
|
513
|
|
Tercio@6
|
514 elseif (command == "facing") then
|
|
Tercio@6
|
515 if (rest == "1") then
|
|
Tercio@6
|
516 db.FACING_SIDE = 1
|
|
Tercio@6
|
517 tframe.facing = true
|
|
Tercio@6
|
518 print ("|cFFFFAA00Hansgar and Franzok Assist|r facing set to south.")
|
|
Tercio@6
|
519
|
|
Tercio@6
|
520 elseif (rest == "2") then
|
|
Tercio@6
|
521 db.FACING_SIDE = 2
|
|
Tercio@6
|
522 tframe.facing = false
|
|
Tercio@6
|
523 print ("|cFFFFAA00Hansgar and Franzok Assist|r facing set to north.")
|
|
Tercio@6
|
524
|
|
Tercio@6
|
525 elseif (rest == "auto") then
|
|
Tercio@6
|
526 db.AUTO_FACING = true
|
|
Tercio@6
|
527 print ("|cFFFFAA00Hansgar and Franzok Assist|r auto facing enabled.")
|
|
Tercio@6
|
528
|
|
Tercio@6
|
529 else
|
|
Tercio@6
|
530 print ("|cFFFFFF00/hansgar facing|r: |cFF00FF001|r = south |cFF00FF002|r = north, use to set the dance bar when auto facing is disabled.")
|
|
Tercio@6
|
531 end
|
|
Tercio@6
|
532
|
|
Tercio@6
|
533 elseif (command == "autofacing") then
|
|
Tercio@6
|
534 db.AUTO_FACING = not db.AUTO_FACING
|
|
Tercio@6
|
535 if (db.AUTO_FACING) then
|
|
Tercio@6
|
536 print ("|cFFFFAA00Hansgar and Franzok Assist|r auto facing enabled.")
|
|
Tercio@6
|
537 else
|
|
Tercio@6
|
538 print ("|cFFFFAA00Hansgar and Franzok Assist|r auto facing disabled.")
|
|
Tercio@6
|
539 tframe.facing = db.FACING_SIDE == 1
|
|
Tercio@6
|
540 end
|
|
Tercio@6
|
541
|
|
Tercio@6
|
542 elseif (command == "dance") then
|
|
Tercio@6
|
543 db.SHOW_DANCE = not db.SHOW_DANCE
|
|
Tercio@6
|
544 if (db.SHOW_DANCE) then
|
|
Tercio@6
|
545 if (f.on_encounter) then
|
|
Tercio@6
|
546 f:StartTrackPlayerPosition()
|
|
Tercio@6
|
547 end
|
|
Tercio@6
|
548 print ("|cFFFFAA00Hansgar and Franzok Assist|r dance bars enabled.")
|
|
Tercio@6
|
549 else
|
|
Tercio@6
|
550 f:EndTrackPlayerPosition()
|
|
Tercio@6
|
551 print ("|cFFFFAA00Hansgar and Franzok Assist|r dance bars disabled.")
|
|
Tercio@6
|
552 end
|
|
Tercio@6
|
553
|
|
Tercio@6
|
554 elseif (command == "cooldown") then
|
|
Tercio@6
|
555 db.CD_NUMBER = not db.CD_NUMBER
|
|
Tercio@6
|
556 f:RefreshCooldownSettings()
|
|
Tercio@6
|
557
|
|
Tercio@6
|
558 else
|
|
Tercio@11
|
559
|
|
Tercio@11
|
560 if (f.StampersPhase) then
|
|
Tercio@11
|
561 f:EndTrackPlayerPosition()
|
|
Tercio@11
|
562 return f:StopTracking()
|
|
Tercio@11
|
563 end
|
|
Tercio@11
|
564
|
|
Tercio@11
|
565 f:StartTracking()
|
|
Tercio@11
|
566 f:StartTrackPlayerPosition()
|
|
Tercio@11
|
567
|
|
Tercio@6
|
568 print ("|cFFFFAA00Hansgar and Franzok Assist|r |cFF00FF00" .. f.version .. "|r Commands:")
|
|
Tercio@9
|
569 print ("|cFFFFFF00/hansgar resetpos|r: reset the position of all frames.")
|
|
Tercio@6
|
570 print ("|cFFFFFF00/hansgar lock|r: toggle lock and unlock on the frame.")
|
|
Tercio@6
|
571 print ("|cFFFFFF00/hansgar test show hide|r: active the addon on test mode or hide it.")
|
|
Tercio@6
|
572 print ("|cFFFFFF00/hansgar delay <time>|r: time in seconds until the percentage goes from 0 to 100.")
|
|
Tercio@6
|
573 print ("|cFFFFFF00/hansgar dance|r: toggle dance bar (used to dodge regular stampers and searing plates).")
|
|
Tercio@6
|
574 print ("|cFFFFFF00/hansgar autofacing|r: toggle if the dance bar auto switch left and right when looking to north or south.")
|
|
Tercio@6
|
575 print ("|cFFFFFF00/hansgar facing|r: |cFF00FF001|r = south |cFF00FF002|r = north, use to set the dance bar when auto facing is disabled.")
|
|
Tercio@6
|
576 print ("|cFFFFFF00/hansgar users|r: show who is using the addon in the raid.")
|
|
Tercio@6
|
577 print ("|cFFFFFF00/hansgar cooldown|r: show the countdown text for each stamper go back up to the ceiling.")
|
|
Tercio@9
|
578 print ("|cFFFFFF00/hansgar stopcast|r: show the alert to stop casting for Disrupting Roar.")
|
|
Tercio@6
|
579 end
|
|
Tercio@6
|
580 end
|
|
Tercio@6
|
581
|
|
Tercio@0
|
582 --
|
|
Tercio@0
|
583
|
|
Tercio@11
|
584 local options_panel = {
|
|
Tercio@11
|
585 {
|
|
Tercio@11
|
586 type = "range",
|
|
Tercio@11
|
587 get = function() return db.STAMPERS_DELAY end,
|
|
Tercio@11
|
588 set = function (self, fixedparam, value) db.STAMPERS_DELAY = value end,
|
|
Tercio@11
|
589 min = 4,
|
|
Tercio@11
|
590 max = 8,
|
|
Tercio@11
|
591 step = 1,
|
|
Tercio@11
|
592 desc = "Time in seconds to move out from a heating up stamper.",
|
|
Tercio@11
|
593 name = "Stampers Delay",
|
|
Tercio@11
|
594 },
|
|
Tercio@11
|
595 {
|
|
Tercio@11
|
596 type = "toggle",
|
|
Tercio@11
|
597 get = function() return db.FRAME_LOCK end,
|
|
Tercio@11
|
598 set = function (self, fixedparam, value)
|
|
Tercio@11
|
599 db.FRAME_LOCK = not value;
|
|
Tercio@11
|
600 if (db.FRAME_LOCK) then
|
|
Tercio@11
|
601 f:SetLockState()
|
|
Tercio@11
|
602 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame unlocked.")
|
|
Tercio@11
|
603
|
|
Tercio@11
|
604 f.unlocked_frame = true
|
|
Tercio@11
|
605 f.player_pos_frame:Show()
|
|
Tercio@11
|
606 f.player_bar:Show()
|
|
Tercio@11
|
607 f.stop_casting_frame:Show()
|
|
Tercio@11
|
608 else
|
|
Tercio@11
|
609 f:SetLockState()
|
|
Tercio@11
|
610 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame locked.")
|
|
Tercio@11
|
611 f.unlocked_frame = false
|
|
Tercio@11
|
612 f.stop_casting_frame:Hide()
|
|
Tercio@11
|
613 end
|
|
Tercio@11
|
614 end,
|
|
Tercio@11
|
615 desc = "Lock or unlock the frames.",
|
|
Tercio@11
|
616 name = "Frame Locked"
|
|
Tercio@11
|
617 },
|
|
Tercio@11
|
618 {
|
|
Tercio@11
|
619 type = "toggle",
|
|
Tercio@11
|
620 get = function() return db.SHOW_DANCE end,
|
|
Tercio@11
|
621 set = function (self, fixedparam, value)
|
|
Tercio@11
|
622 db.SHOW_DANCE = not db.SHOW_DANCE
|
|
Tercio@11
|
623 if (db.SHOW_DANCE) then
|
|
Tercio@11
|
624 if (f.on_encounter) then
|
|
Tercio@11
|
625 f:StartTrackPlayerPosition()
|
|
Tercio@11
|
626 end
|
|
Tercio@11
|
627 else
|
|
Tercio@11
|
628 f:EndTrackPlayerPosition()
|
|
Tercio@11
|
629 end
|
|
Tercio@11
|
630 end,
|
|
Tercio@11
|
631 desc = "Enable or disable the dance bar.",
|
|
Tercio@11
|
632 name = "Dance Bar"
|
|
Tercio@11
|
633 },
|
|
Tercio@11
|
634 {
|
|
Tercio@11
|
635 type = "toggle",
|
|
Tercio@11
|
636 get = function() return db.CD_NUMBER end,
|
|
Tercio@11
|
637 set = function (self, fixedparam, value)
|
|
Tercio@11
|
638 db.CD_NUMBER = not db.CD_NUMBER
|
|
Tercio@11
|
639 f:RefreshCooldownSettings()
|
|
Tercio@11
|
640 end,
|
|
Tercio@11
|
641 desc = "When enabled, shows the number countdown on each block.",
|
|
Tercio@11
|
642 name = "Show Cooldown Number"
|
|
Tercio@11
|
643 },
|
|
Tercio@11
|
644 {
|
|
Tercio@11
|
645 type = "toggle",
|
|
Tercio@11
|
646 get = function() return db.STOP_CAST end,
|
|
Tercio@11
|
647 set = function (self, fixedparam, value)
|
|
Tercio@11
|
648 db.STOP_CAST = not db.STOP_CAST
|
|
Tercio@11
|
649 end,
|
|
Tercio@11
|
650 desc = "When enabled, shows an alert for Disrupting Roar.",
|
|
Tercio@11
|
651 name = "Stop Cast Alert"
|
|
Tercio@11
|
652 },
|
|
Tercio@11
|
653 {
|
|
Tercio@11
|
654 type = "execute",
|
|
Tercio@11
|
655 func = function()
|
|
Tercio@11
|
656 if (f.StampersPhase) then
|
|
Tercio@11
|
657 f:EndTrackPlayerPosition()
|
|
Tercio@11
|
658 return f:StopTracking()
|
|
Tercio@11
|
659 end
|
|
Tercio@11
|
660 f:StartTracking()
|
|
Tercio@11
|
661 f:StartTrackPlayerPosition()
|
|
Tercio@11
|
662 end,
|
|
Tercio@11
|
663 desc = "Test the addon, run over the tracks in the room.",
|
|
Tercio@11
|
664 name = "Start Test Mode"
|
|
Tercio@11
|
665 },
|
|
Tercio@11
|
666 {
|
|
Tercio@11
|
667 type = "execute",
|
|
Tercio@11
|
668 func = function()
|
|
Tercio@11
|
669 f:ClearAllPoints()
|
|
Tercio@11
|
670 f:SetPoint ("center", UIParent, "center")
|
|
Tercio@11
|
671
|
|
Tercio@11
|
672 player_bar:ClearAllPoints()
|
|
Tercio@11
|
673 player_bar:SetPoint ("center", UIParent, "center")
|
|
Tercio@11
|
674
|
|
Tercio@11
|
675 player_pos_frame:ClearAllPoints()
|
|
Tercio@11
|
676 player_pos_frame:SetPoint ("center", UIParent, "center")
|
|
Tercio@11
|
677
|
|
Tercio@11
|
678 if (f.StampersPhase) then
|
|
Tercio@11
|
679 f:EndTrackPlayerPosition()
|
|
Tercio@11
|
680 f:StopTracking()
|
|
Tercio@11
|
681 end
|
|
Tercio@11
|
682
|
|
Tercio@11
|
683 db.FRAME_LOCK = true
|
|
Tercio@11
|
684 f:SetLockState()
|
|
Tercio@11
|
685
|
|
Tercio@11
|
686 f.unlocked_frame = true
|
|
Tercio@11
|
687
|
|
Tercio@11
|
688 f:StartTracking()
|
|
Tercio@11
|
689 f:StartTrackPlayerPosition()
|
|
Tercio@11
|
690
|
|
Tercio@11
|
691 print ("|cFFFFAA00Hansgar and Franzok Assist|r: position reseted and frames are unlocked.")
|
|
Tercio@11
|
692 print ("|cFFFFAA00Hansgar and Franzok Assist|r: move between the tracks to show the other frames.")
|
|
Tercio@11
|
693 end,
|
|
Tercio@11
|
694 desc = "Reset the position of all frames and start the test mode.",
|
|
Tercio@11
|
695 name = "Reset Position"
|
|
Tercio@11
|
696 },
|
|
Tercio@11
|
697 {
|
|
Tercio@11
|
698 type = "execute",
|
|
Tercio@11
|
699 func = function()
|
|
Tercio@11
|
700 if (f.users_schedule) then
|
|
Tercio@11
|
701 print ("|cFFFFAA00Hansgar and Franzok Assist|r please wait 5 seconds...")
|
|
Tercio@11
|
702 elseif (IsInRaid()) then
|
|
Tercio@11
|
703 f.users = {}
|
|
Tercio@11
|
704 f:SendCommMessage ("HAFR", "US", "RAID")
|
|
Tercio@11
|
705 f.users_schedule = f:ScheduleTimer ("ShowUsers", 5)
|
|
Tercio@11
|
706 print ("|cFFFFAA00Hansgar and Franzok Assist|r please wait 5 seconds...")
|
|
Tercio@11
|
707 else
|
|
Tercio@11
|
708 print ("|cFFFFAA00Hansgar and Franzok Assist|r you aren't in a raid group.")
|
|
Tercio@11
|
709 end
|
|
Tercio@11
|
710 end,
|
|
Tercio@11
|
711 desc = "Show raid members which are also using this addon.",
|
|
Tercio@11
|
712 name = "Version Check"
|
|
Tercio@11
|
713 },
|
|
Tercio@11
|
714 {
|
|
Tercio@11
|
715 type = "execute",
|
|
Tercio@11
|
716 func = function()
|
|
Tercio@11
|
717 f.feedback_func()
|
|
Tercio@11
|
718 end,
|
|
Tercio@11
|
719 desc = "Send a feedback for us on our Curse page or MMO-Champion forum Thread.",
|
|
Tercio@11
|
720 name = "Send Feedback"
|
|
Tercio@11
|
721 },
|
|
Tercio@11
|
722 }
|
|
Tercio@11
|
723
|
|
Tercio@11
|
724 local build_options_panel = function()
|
|
Tercio@11
|
725 local options_frame = DF:CreateOptionsFrame ("HansgarFranzokAssistOptions", "Hans & Franz Assist", 1)
|
|
Tercio@11
|
726 options_frame:SetHeight (180)
|
|
Tercio@11
|
727 DF:BuildMenu (options_frame, options_panel, 15, -60, 180)
|
|
Tercio@11
|
728 options_frame:SetBackdropColor (0, 0, 0, .9)
|
|
Tercio@11
|
729 end
|
|
Tercio@11
|
730
|
|
Tercio@11
|
731 f.OpenOptionsPanel = function()
|
|
Tercio@11
|
732 if (not HansgarFranzokAssistOptions) then
|
|
Tercio@11
|
733 build_options_panel()
|
|
Tercio@11
|
734 end
|
|
Tercio@11
|
735 HansgarFranzokAssistOptions:Show()
|
|
Tercio@11
|
736 end
|
|
Tercio@11
|
737
|
|
Tercio@11
|
738 -- /run Hansgar_And_Franzok_Assist.OpenOptionsPanel()
|
|
Tercio@11
|
739 local options = DF:CreateOptionsButton (f, f.OpenOptionsPanel, "Hansgar_And_Franzok_Assist_OPButton")
|
|
Tercio@11
|
740 options:SetPoint ("right", f.Lock, "left", 1, 0)
|
|
Tercio@11
|
741 f.Options = options
|
|
Tercio@11
|
742
|
|
Tercio@11
|
743 --
|
|
Tercio@11
|
744 local feedback_func = function()
|
|
Tercio@11
|
745 local feedback1 = {icon = [[Interface\AddOns\Hansgar_And_Franzok_Assist\libs\DF\feedback_sites]], coords = DF.www_icons.mmoc, desc = "Post on our thread on MMO-Champion Forum.", link = [[http://www.mmo-champion.com/threads/1725970-Hans-gar-and-Franzok-Assist-(addon)]]}
|
|
Tercio@11
|
746 local feedback2 = {icon = [[Interface\AddOns\Hansgar_And_Franzok_Assist\libs\DF\feedback_sites]], coords = DF.www_icons.curse, desc = "Leave a comment on our page at Curse.com.", link = [[http://www.curse.com/addons/wow/hansgar_and_franzok_assist]]}
|
|
Tercio@11
|
747
|
|
Tercio@11
|
748 local same1 = {name = "Details! Damage Meter", desc = "A Damage Meter with a lot of tools for raiders and leaders.", link = [[http://www.curse.com/addons/wow/details]], icon = [[Interface\AddOns\Hansgar_And_Franzok_Assist\libs\DF\all_addons]], coords = {0, 128/512, 0, 64/512}}
|
|
Tercio@11
|
749 local same2 = {name = "Gold Token Price", desc = "Adds the slash command '/gold'. This command tells you the current price of WoW Token.", link = [[http://www.curse.com/addons/wow/gold-token-price]], icon = [[Interface\AddOns\Hansgar_And_Franzok_Assist\libs\DF\all_addons]], coords = {128/512, 256/512, 0, 64/512}}
|
|
Tercio@11
|
750 local same3 = {name = "Salvage Yard Seller", desc = "Sells stuff gathered from salvage crates respecting item level limit.", link = [[http://www.curse.com/addons/wow/salvage-yard-seller]], icon = [[Interface\AddOns\Hansgar_And_Franzok_Assist\libs\DF\all_addons]], coords = {384/512, 512/512, 64/512, 128/512}}
|
|
Tercio@11
|
751 local same4 = {name = "AddOns CPU Usage", desc = "Measure the CPU usage by addons. Important to get rid of FPS drops during boss encounters.", link = [[http://www.curse.com/addons/wow/addons-cpu-usage]], icon = [[Interface\AddOns\Hansgar_And_Franzok_Assist\libs\DF\all_addons]], coords = {384/512, 512/512, 0, 64/512}}
|
|
Tercio@11
|
752 local same5 = {name = "Keep World Map Zoom", desc = "Because it's a pain having to re-zoom the world map after close and reopening in a short period of time.", link = [[http://www.curse.com/addons/wow/world-map-zoom]], icon = [[Interface\AddOns\Hansgar_And_Franzok_Assist\libs\DF\all_addons]], coords = {0/512, 128/512, 64/512, 128/512}}
|
|
Tercio@11
|
753 local same6 = {name = "PvPScan", desc = "Show a unit frame with enemy players near you.", link = [[http://www.wowace.com/addons/pvpscan/]], icon = [[Interface\AddOns\Hansgar_And_Franzok_Assist\libs\DF\all_addons]], coords = {128/512, 256/512, 64/512, 128/512}}
|
|
Tercio@11
|
754 local same7 = {name = "HotCorners", desc = "Show a hotcorner when poiting the mouse on the absolute top left of your screen (similar of those on Windows 8).", link = [[http://www.curse.com/addons/wow/hotcorners]], icon = [[Interface\AddOns\Hansgar_And_Franzok_Assist\libs\DF\all_addons]], coords = {256/512, 384/512, 64/512, 128/512}}
|
|
Tercio@11
|
755
|
|
Tercio@11
|
756 DF:ShowFeedbackPanel ("Hans & Franz Assist", f.version, {feedback2, feedback1}, {same1, same2, same3, same4, same5, same6, same7})
|
|
Tercio@11
|
757 end
|
|
Tercio@11
|
758 f.feedback_func = feedback_func
|
|
Tercio@11
|
759 local feedback_button = DF:CreateFeedbackButton (f, feedback_func, "Hansgar_And_Franzok_AssistFBButton")
|
|
Tercio@11
|
760 feedback_button:SetPoint ("right", f.Options, "left", 0, -1)
|
|
Tercio@11
|
761 --
|
|
Tercio@11
|
762
|
|
Tercio@10
|
763 local stop_casting_frame = CreateFrame ("frame", "Hansgar_And_Franzok_AssistStopCasting", UIParent)
|
|
Tercio@9
|
764 stop_casting_frame:SetSize (200, 30)
|
|
Tercio@9
|
765 stop_casting_frame:SetPoint ("center", UIParent, "center", 0, 75)
|
|
Tercio@9
|
766 stop_casting_frame:SetFrameStrata ("FULLSCREEN")
|
|
Tercio@10
|
767 f.stop_casting_frame = stop_casting_frame
|
|
Tercio@9
|
768 stop_casting_frame:Hide()
|
|
Tercio@10
|
769
|
|
Tercio@10
|
770 stop_casting_frame:SetMovable (false)
|
|
Tercio@10
|
771 stop_casting_frame:EnableMouse (false)
|
|
Tercio@10
|
772
|
|
Tercio@10
|
773 stop_casting_frame:SetScript ("OnMouseDown", function (self)
|
|
Tercio@10
|
774 if (not self.isMoving) then
|
|
Tercio@10
|
775 self:StartMoving()
|
|
Tercio@10
|
776 self.isMoving = true
|
|
Tercio@10
|
777 end
|
|
Tercio@9
|
778 end)
|
|
Tercio@10
|
779 stop_casting_frame:SetScript ("OnMouseUp", function (self)
|
|
Tercio@10
|
780 if (self.isMoving) then
|
|
Tercio@10
|
781 self:StopMovingOrSizing()
|
|
Tercio@10
|
782 self.isMoving = false
|
|
Tercio@10
|
783 end
|
|
Tercio@9
|
784 end)
|
|
Tercio@9
|
785
|
|
Tercio@10
|
786 local alert = CreateFrame ("frame", "Hansgar_And_Franzok_AssistStopCastingAlert", stop_casting_frame, "ActionBarButtonSpellActivationAlert")
|
|
Tercio@10
|
787 alert:SetPoint ("topleft", stop_casting_frame, "topleft", -10, 2)
|
|
Tercio@10
|
788 alert:SetPoint ("bottomright", stop_casting_frame, "bottomright", 10, -2)
|
|
Tercio@10
|
789 stop_casting_frame.alert = alert
|
|
Tercio@10
|
790
|
|
Tercio@9
|
791 local text = stop_casting_frame:CreateFontString (nil, "overlay", "GameFontNormal")
|
|
Tercio@9
|
792 text:SetText ("STOP CASTING!")
|
|
Tercio@9
|
793 text:SetPoint ("center", stop_casting_frame, "center")
|
|
Tercio@9
|
794
|
|
Tercio@9
|
795 stop_casting_frame:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16})
|
|
Tercio@10
|
796 stop_casting_frame:SetBackdropColor (0, 0, 0, 0.3)
|
|
Tercio@9
|
797
|
|
Tercio@10
|
798 function f:HideStopSpellAlert2()
|
|
Tercio@10
|
799 stop_casting_frame.alert.animOut:Stop()
|
|
Tercio@10
|
800 stop_casting_frame:Hide()
|
|
Tercio@10
|
801 end
|
|
Tercio@9
|
802 function f:HideStopSpellAlert()
|
|
Tercio@10
|
803 stop_casting_frame.alert.animIn:Stop()
|
|
Tercio@10
|
804 stop_casting_frame.alert.animOut:Play()
|
|
Tercio@10
|
805 f:ScheduleTimer ("HideStopSpellAlert2", 0.3)
|
|
Tercio@9
|
806 end
|
|
Tercio@9
|
807
|
|
Tercio@9
|
808 --3/22 13:44:48.995 SPELL_INTERRUPT,Vehicle-0-3132-1205-24243-76974-00000EF077,"Franzok",0x10a48,0x0,Player-00-063,"Grubdruid",0x514,0x0,160838,"Disrupting Roar",0x1,5185,"Healing Touch",8
|
|
Tercio@9
|
809
|
|
Tercio@9
|
810 f:SetScript ("OnEvent", function (self, event, time, token, _, who_serial, who_name, who_flags, _, target_serial, target_name, target_flags, _, spellid, spellname, spellschool, buff_type, buff_name)
|
|
Tercio@0
|
811
|
|
Tercio@2
|
812 if (token == "SPELL_AURA_APPLIED" and spellid == 162124 and not f.StampersPhase) then
|
|
Tercio@0
|
813 f:StartTracking()
|
|
Tercio@5
|
814 f:EndTrackPlayerPosition()
|
|
Tercio@0
|
815
|
|
Tercio@2
|
816 elseif (token == "SPELL_AURA_REMOVED" and spellid == 162124 and f.StampersPhase) then
|
|
Tercio@0
|
817 f:StopTracking()
|
|
Tercio@5
|
818 if (db.SHOW_DANCE) then
|
|
Tercio@5
|
819 f:StartTrackPlayerPosition()
|
|
Tercio@5
|
820 end
|
|
Tercio@0
|
821
|
|
Tercio@9
|
822 elseif (token == "SPELL_CAST_START" and spellid == 160838 and db.STOP_CAST) then --Disrupting Roar
|
|
Tercio@10
|
823 f.stop_casting_frame:Show()
|
|
Tercio@10
|
824 f.stop_casting_frame.alert.animOut:Stop()
|
|
Tercio@10
|
825 f.stop_casting_frame.alert.animIn:Play()
|
|
Tercio@10
|
826 f:ScheduleTimer ("HideStopSpellAlert", 1.2)
|
|
Tercio@10
|
827
|
|
Tercio@0
|
828 end
|
|
Tercio@9
|
829
|
|
Tercio@9
|
830 if (token == "SPELL_INTERRUPT" and spellid == 160838 and db.STOP_CAST) then
|
|
Tercio@9
|
831 local link = GetSpellLink (buff_type)
|
|
Tercio@9
|
832 print ("Stop Cast Fail:", target_name, link)
|
|
Tercio@9
|
833 end
|
|
Tercio@9
|
834
|
|
Tercio@9
|
835 --if (spellid == 160838) then
|
|
Tercio@9
|
836 -- print ("event:", token, 160838, db.STOP_CAST)
|
|
Tercio@9
|
837 --end
|
|
Tercio@0
|
838
|
|
Tercio@0
|
839 end)
|
|
Tercio@10
|
840 -- /run Hansgar_And_Franzok_AssistStopCastingAlert.animIn:Play()
|
|
Tercio@0
|
841
|
|
Tercio@9
|
842 --Hansgar_And_Franzok_AssistStopCasting:Show(); Hansgar_And_Franzok_Assist:ScheduleTimer ("HideStopSpellAlert", 1)
|
|
Tercio@9
|
843 --Hansgar_And_Franzok_Assist:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
|
|
Tercio@9
|
844
|
|
Tercio@0
|
845 local frame_tracker = CreateFrame ("frame", "Hansgar_And_Franzok_AssistTracker", UIParent)
|
|
Tercio@0
|
846 local on_update_tracker = function (self, elapsed)
|
|
Tercio@0
|
847
|
|
Tercio@4
|
848 local raid_size = GetNumGroupMembers()
|
|
Tercio@4
|
849
|
|
Tercio@4
|
850 for i = 1, raid_size do
|
|
Tercio@0
|
851 local x, y = GetPlayerMapPosition ("raid"..i)
|
|
Tercio@0
|
852 if (UnitExists ("raid"..i) and UnitHealth ("raid"..i) > 1 and x and y) then
|
|
Tercio@0
|
853 local block = f:WhichBlock (x, y)
|
|
Tercio@0
|
854 if (block) then
|
|
Tercio@0
|
855 if (not f.block_tracker [block]) then --> was a clear block
|
|
Tercio@0
|
856 f.block_tracker [block] = GetTime()
|
|
Tercio@0
|
857 f:Paint (f.all_blocks [block])
|
|
Tercio@0
|
858 end
|
|
Tercio@0
|
859 end
|
|
Tercio@0
|
860 end
|
|
Tercio@0
|
861 end
|
|
Tercio@0
|
862
|
|
Tercio@0
|
863 local px, py = GetPlayerMapPosition ("player")
|
|
Tercio@0
|
864 local player_block = f:WhichBlock (px, py)
|
|
Tercio@6
|
865 if (player_block and f.block_tracker [player_block] and raid_size > 0) then
|
|
Tercio@0
|
866
|
|
Tercio@0
|
867 local time_limit_at = f.block_tracker [player_block] + db.STAMPERS_DELAY
|
|
Tercio@0
|
868 local time_now = GetTime()
|
|
Tercio@0
|
869
|
|
Tercio@7
|
870 local timeleft = time_limit_at - time_now
|
|
Tercio@7
|
871 f.player_bar:SetValue ((timeleft) / db.STAMPERS_DELAY * 100)
|
|
Tercio@7
|
872 if (timeleft > 0) then
|
|
Tercio@7
|
873 f.player_bar.text:SetText (format ("%.1f", timeleft))
|
|
Tercio@7
|
874 else
|
|
Tercio@7
|
875 f.player_bar.text:SetText ("Move!")
|
|
Tercio@7
|
876 end
|
|
Tercio@0
|
877 f.player_bar:Show()
|
|
Tercio@7
|
878
|
|
Tercio@0
|
879 local block_frame = f.all_blocks [player_block]
|
|
Tercio@0
|
880 f.player_loc_box:SetPoint ("center", block_frame, "center")
|
|
Tercio@0
|
881 f.player_loc_box:Show()
|
|
Tercio@7
|
882
|
|
Tercio@0
|
883 else
|
|
Tercio@9
|
884 if (f.unlocked_frame) then
|
|
Tercio@9
|
885 f.player_loc_box:Show()
|
|
Tercio@9
|
886 f.player_bar:Show()
|
|
Tercio@9
|
887 f.player_bar:SetValue (100)
|
|
Tercio@9
|
888 else
|
|
Tercio@9
|
889 f.player_loc_box:Hide()
|
|
Tercio@9
|
890 f.player_bar:Hide()
|
|
Tercio@9
|
891 end
|
|
Tercio@0
|
892 end
|
|
Tercio@0
|
893 end
|
|
Tercio@0
|
894
|
|
Tercio@0
|
895 function f:StartTracking()
|
|
Tercio@0
|
896
|
|
Tercio@0
|
897 print ("|cFFFFAA00Hansgar and Franzok Assist|r: Smart Stampers phase started.")
|
|
Tercio@0
|
898
|
|
Tercio@0
|
899 f.StampersPhase = true
|
|
Tercio@0
|
900
|
|
Tercio@0
|
901 if (not f.frames_built) then
|
|
Tercio@0
|
902 f:CreateWindow()
|
|
Tercio@0
|
903 end
|
|
Tercio@7
|
904
|
|
Tercio@0
|
905 f:ResetBlocks()
|
|
Tercio@0
|
906 f.player_loc_box:Hide()
|
|
Tercio@0
|
907
|
|
Tercio@0
|
908 f.block_tracker = f.block_tracker or {}
|
|
Tercio@0
|
909 table.wipe (f.block_tracker)
|
|
Tercio@7
|
910
|
|
Tercio@0
|
911 SetMapToCurrentZone()
|
|
Tercio@7
|
912
|
|
Tercio@0
|
913 frame_tracker:SetScript ("OnUpdate", on_update_tracker)
|
|
Tercio@0
|
914 f:Show()
|
|
Tercio@7
|
915 f.player_bar:Show()
|
|
Tercio@7
|
916
|
|
Tercio@0
|
917 end
|
|
Tercio@0
|
918
|
|
Tercio@0
|
919 function f:StopTracking()
|
|
Tercio@0
|
920 print ("|cFFFFAA00Hansgar and Franzok Assist|r: Smart Stampers phase ended.")
|
|
Tercio@0
|
921
|
|
Tercio@0
|
922 f.StampersPhase = false
|
|
Tercio@0
|
923 frame_tracker:SetScript ("OnUpdate", nil)
|
|
Tercio@0
|
924 table.wipe (f.block_tracker)
|
|
Tercio@0
|
925 f.player_loc_box:Hide()
|
|
Tercio@0
|
926 f:Hide()
|
|
Tercio@7
|
927 f.player_bar:SetValue (0)
|
|
Tercio@7
|
928 f.player_bar:Hide()
|
|
Tercio@0
|
929 end
|
|
Tercio@0
|
930
|
|
Tercio@0
|
931 local on_mouse_down = function (self)
|
|
Tercio@5
|
932 if (not self.isMoving and not db.FRAME_LOCK) then
|
|
Tercio@0
|
933 self.isMoving = true
|
|
Tercio@0
|
934 f:StartMoving()
|
|
Tercio@0
|
935 end
|
|
Tercio@0
|
936 end
|
|
Tercio@0
|
937 local on_mouse_up = function (self)
|
|
Tercio@0
|
938 if (self.isMoving) then
|
|
Tercio@0
|
939 self.isMoving = nil
|
|
Tercio@0
|
940 f:StopMovingOrSizing()
|
|
Tercio@0
|
941 end
|
|
Tercio@0
|
942 end
|
|
Tercio@0
|
943
|
|
Tercio@0
|
944 local painting = function (self, elapsed)
|
|
Tercio@0
|
945 self.step = self.step + elapsed
|
|
Tercio@0
|
946 self.total_time = self.total_time + elapsed
|
|
Tercio@0
|
947
|
|
Tercio@0
|
948 if (self.step > 0.2) then
|
|
Tercio@0
|
949 self.step = 0
|
|
Tercio@0
|
950 local percent = self.total_time / db.STAMPERS_DELAY * 100
|
|
Tercio@0
|
951
|
|
Tercio@0
|
952 percent = min (percent, 100)
|
|
Tercio@0
|
953
|
|
Tercio@0
|
954 local r, g, b = f:percent_color (percent, true)
|
|
Tercio@0
|
955 self:SetBackdropColor (r, g, b, 0.5)
|
|
Tercio@0
|
956
|
|
Tercio@0
|
957 self.number:SetText (floor (percent) .. "%")
|
|
Tercio@0
|
958 self.number:SetTextColor (1, 1, 1, 1)
|
|
Tercio@0
|
959
|
|
Tercio@0
|
960 if (percent == 100) then
|
|
Tercio@0
|
961 self:SetScript ("OnUpdate", nil)
|
|
Tercio@0
|
962 self.stamper_icon:Show()
|
|
Tercio@0
|
963 self.number:Hide()
|
|
Tercio@5
|
964 self.cooldown:Show()
|
|
Tercio@4
|
965 self.cooldown:SetCooldown (GetTime(), 37 - db.STAMPERS_DELAY, 0, 0)
|
|
Tercio@0
|
966 end
|
|
Tercio@0
|
967 end
|
|
Tercio@0
|
968 end
|
|
Tercio@4
|
969
|
|
Tercio@4
|
970 function f:UnPaint (block)
|
|
Tercio@4
|
971 f:ResetBlock (block)
|
|
Tercio@4
|
972 end
|
|
Tercio@0
|
973 function f:Paint (block)
|
|
Tercio@0
|
974 block.step = 0
|
|
Tercio@0
|
975 block.total_time = 0
|
|
Tercio@0
|
976 block:SetScript ("OnUpdate", painting)
|
|
Tercio@4
|
977 local unpaint = f:ScheduleTimer ("UnPaint", 37, block)
|
|
Tercio@4
|
978 block.unpaint_process = unpaint
|
|
Tercio@4
|
979 end
|
|
Tercio@4
|
980
|
|
Tercio@4
|
981 function f:ResetBlock (block)
|
|
Tercio@4
|
982 block:SetScript ("OnUpdate", nil)
|
|
Tercio@4
|
983 block:SetBackdropColor (.8, .8, .8, 0.5)
|
|
Tercio@4
|
984 block.number:SetText (block.id)
|
|
Tercio@4
|
985 block.number:SetTextColor (1, 1, 1, 0.5)
|
|
Tercio@4
|
986 block.number:Show()
|
|
Tercio@4
|
987 block.stamper_icon:Hide()
|
|
Tercio@4
|
988 block.cooldown:SetCooldown (0, 0, 0, 0)
|
|
Tercio@5
|
989 block.cooldown:Hide()
|
|
Tercio@4
|
990
|
|
Tercio@4
|
991 f.block_tracker [block.id] = nil
|
|
Tercio@4
|
992 if (block.unpaint_process) then
|
|
Tercio@4
|
993 f:CancelTimer (block.unpaint_process)
|
|
Tercio@4
|
994 block.unpaint_process = nil
|
|
Tercio@4
|
995 end
|
|
Tercio@0
|
996 end
|
|
Tercio@0
|
997
|
|
Tercio@0
|
998 function f:ResetBlocks()
|
|
Tercio@0
|
999 for _, block in ipairs (f.all_blocks) do
|
|
Tercio@4
|
1000 f:ResetBlock (block)
|
|
Tercio@4
|
1001 end
|
|
Tercio@4
|
1002 end
|
|
Tercio@4
|
1003
|
|
Tercio@4
|
1004 function f:RefreshCooldownSettings()
|
|
Tercio@4
|
1005 for _, block in ipairs (f.all_blocks) do
|
|
Tercio@4
|
1006 if (not db.CD_NUMBER) then
|
|
Tercio@4
|
1007 block.cooldown:SetHideCountdownNumbers (true)
|
|
Tercio@4
|
1008 block.cooldown:SetDrawEdge (false)
|
|
Tercio@4
|
1009 else
|
|
Tercio@4
|
1010 block.cooldown:SetHideCountdownNumbers (false)
|
|
Tercio@4
|
1011 block.cooldown:SetDrawEdge (true)
|
|
Tercio@4
|
1012 end
|
|
Tercio@0
|
1013 end
|
|
Tercio@0
|
1014 end
|
|
Tercio@0
|
1015
|
|
Tercio@7
|
1016 function f:SetLockState (just_refresh)
|
|
Tercio@7
|
1017
|
|
Tercio@7
|
1018 if (not just_refresh) then
|
|
Tercio@7
|
1019 db.FRAME_LOCK = not db.FRAME_LOCK
|
|
Tercio@7
|
1020 end
|
|
Tercio@7
|
1021
|
|
Tercio@5
|
1022 if (db.FRAME_LOCK) then
|
|
Tercio@5
|
1023 --locked
|
|
Tercio@5
|
1024 f:EnableMouse (false)
|
|
Tercio@7
|
1025 player_bar:EnableMouse (false)
|
|
Tercio@7
|
1026 player_pos_frame:EnableMouse (false)
|
|
Tercio@10
|
1027 stop_casting_frame:SetMovable (false)
|
|
Tercio@10
|
1028 stop_casting_frame:EnableMouse (false)
|
|
Tercio@7
|
1029
|
|
Tercio@5
|
1030 for _, block in ipairs (f.all_blocks) do
|
|
Tercio@5
|
1031 block:EnableMouse (false)
|
|
Tercio@5
|
1032 end
|
|
Tercio@7
|
1033
|
|
Tercio@7
|
1034 if (f.StampersPhase and not just_refresh) then
|
|
Tercio@7
|
1035 f:EndTrackPlayerPosition()
|
|
Tercio@7
|
1036 f:StopTracking()
|
|
Tercio@7
|
1037 end
|
|
Tercio@10
|
1038
|
|
Tercio@5
|
1039 else
|
|
Tercio@5
|
1040 --unlocked
|
|
Tercio@5
|
1041 f:EnableMouse (true)
|
|
Tercio@7
|
1042 player_bar:EnableMouse (true)
|
|
Tercio@7
|
1043 player_pos_frame:EnableMouse (true)
|
|
Tercio@10
|
1044 stop_casting_frame:SetMovable (true)
|
|
Tercio@10
|
1045 stop_casting_frame:EnableMouse (true)
|
|
Tercio@7
|
1046
|
|
Tercio@5
|
1047 for _, block in ipairs (f.all_blocks) do
|
|
Tercio@5
|
1048 block:EnableMouse (true)
|
|
Tercio@5
|
1049 end
|
|
Tercio@7
|
1050
|
|
Tercio@7
|
1051 if (not f.StampersPhase and not just_refresh) then
|
|
Tercio@7
|
1052 f:StartTracking()
|
|
Tercio@7
|
1053 f:StartTrackPlayerPosition()
|
|
Tercio@7
|
1054 end
|
|
Tercio@10
|
1055
|
|
Tercio@7
|
1056 end
|
|
Tercio@7
|
1057
|
|
Tercio@7
|
1058 if (not db.FRAME_LOCK) then
|
|
Tercio@7
|
1059 player_bar.grip:Show()
|
|
Tercio@7
|
1060 else
|
|
Tercio@7
|
1061 player_bar.grip:Hide()
|
|
Tercio@5
|
1062 end
|
|
Tercio@5
|
1063 end
|
|
Tercio@5
|
1064
|
|
Tercio@0
|
1065 function f:CreateWindow()
|
|
Tercio@0
|
1066 local x = 0
|
|
Tercio@0
|
1067 local y = 0
|
|
Tercio@0
|
1068
|
|
Tercio@0
|
1069 f.player_loc_box = frame_event:CreateTexture (nil, "overlay")
|
|
Tercio@0
|
1070 f.player_loc_box:SetSize (32, 40)
|
|
Tercio@0
|
1071 f.player_loc_box:SetTexture ([[Interface\ContainerFrame\UI-Icon-QuestBorder]])
|
|
Tercio@0
|
1072 f.player_loc_box:Hide()
|
|
Tercio@0
|
1073
|
|
Tercio@0
|
1074 f.all_blocks = {}
|
|
Tercio@0
|
1075
|
|
Tercio@0
|
1076 for i = 1, 20 do
|
|
Tercio@0
|
1077
|
|
Tercio@0
|
1078 local block = CreateFrame ("frame", "Hansgar_And_Franzok_Assist_Block" .. i, f)
|
|
Tercio@0
|
1079 block:SetSize (30, 38)
|
|
Tercio@0
|
1080 block:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0},
|
|
Tercio@0
|
1081 })
|
|
Tercio@0
|
1082 block:SetBackdropBorderColor (0, 0, 0, 1)
|
|
Tercio@0
|
1083 block:SetBackdropColor (.8, .8, .8, 0.5)
|
|
Tercio@0
|
1084 block:SetPoint ("TopLeft", f, "TopLeft", x, y)
|
|
Tercio@0
|
1085
|
|
Tercio@0
|
1086 block:SetScript ("OnMouseDown", on_mouse_down)
|
|
Tercio@0
|
1087 block:SetScript ("OnMouseUp", on_mouse_up)
|
|
Tercio@0
|
1088
|
|
Tercio@4
|
1089 local cooldown = CreateFrame ("cooldown", "Hansgar_And_Franzok_Assist_BlockCooldown" .. i, block, "CooldownFrameTemplate")
|
|
Tercio@4
|
1090 cooldown:SetAllPoints()
|
|
Tercio@4
|
1091 cooldown:SetFrameLevel (block:GetFrameLevel()+2)
|
|
Tercio@4
|
1092
|
|
Tercio@4
|
1093 if (not db.CD_NUMBER) then
|
|
Tercio@4
|
1094 cooldown:SetHideCountdownNumbers (true)
|
|
Tercio@4
|
1095 cooldown:SetDrawEdge (false)
|
|
Tercio@4
|
1096 end
|
|
Tercio@4
|
1097
|
|
Tercio@4
|
1098 block.cooldown = cooldown
|
|
Tercio@4
|
1099
|
|
Tercio@0
|
1100 block.id = i
|
|
Tercio@0
|
1101
|
|
Tercio@0
|
1102 local number = block:CreateFontString (nil, "artwork", "GameFontHighlight")
|
|
Tercio@0
|
1103 number:SetPoint ("center", block, "center")
|
|
Tercio@0
|
1104 number:SetText (i)
|
|
Tercio@0
|
1105 number:SetTextColor (1, 1, 1, 0.5)
|
|
Tercio@0
|
1106 block.number = number
|
|
Tercio@0
|
1107
|
|
Tercio@0
|
1108 local stamper_icon = block:CreateTexture (nil, "overlay")
|
|
Tercio@0
|
1109 stamper_icon:SetTexture ([[Interface\ICONS\Warrior_talent_icon_LambsToTheSlaughter]])
|
|
Tercio@0
|
1110 stamper_icon:SetTexCoord (4/64, 60/64, 4/64, 60/64)
|
|
Tercio@0
|
1111 stamper_icon:SetSize (24, 24)
|
|
Tercio@0
|
1112 stamper_icon:SetPoint ("center", block, "center")
|
|
Tercio@0
|
1113 stamper_icon:Hide()
|
|
Tercio@0
|
1114 block.stamper_icon = stamper_icon
|
|
Tercio@0
|
1115
|
|
Tercio@0
|
1116 x = x + 31
|
|
Tercio@0
|
1117 if (x >= 155) then
|
|
Tercio@0
|
1118 x = 0
|
|
Tercio@0
|
1119 y = y - 40
|
|
Tercio@0
|
1120 end
|
|
Tercio@0
|
1121
|
|
Tercio@0
|
1122 tinsert (f.all_blocks, block)
|
|
Tercio@0
|
1123
|
|
Tercio@0
|
1124 end
|
|
Tercio@0
|
1125
|
|
Tercio@7
|
1126 f:SetLockState (true)
|
|
Tercio@5
|
1127
|
|
Tercio@0
|
1128 f.frames_built = true
|
|
Tercio@0
|
1129
|
|
Tercio@0
|
1130 end
|
|
Tercio@0
|
1131
|
|
Tercio@4
|
1132 local safe_track = {
|
|
Tercio@4
|
1133 --space 1
|
|
Tercio@4
|
1134 {
|
|
Tercio@4
|
1135 block = {x1 = 0.50154542922974, x2 = 0.49563668874741},
|
|
Tercio@8
|
1136 left = {x1 = 0.49963343143463, x2 = 0.49963343143463 - 0.000624573974608},
|
|
Tercio@8
|
1137 right = {x1 = 0.49710285663605, x2 = 0.49710285663605 + 0.000992229919432},
|
|
Tercio@4
|
1138 -- {x1 = 0.49963343143463, y1 = 0.73492467403412} -- {x1 = 0.49710285663605, y1 = 0.74445152282715}
|
|
Tercio@4
|
1139 },
|
|
Tercio@4
|
1140 --space 2
|
|
Tercio@4
|
1141 {
|
|
Tercio@4
|
1142 block = {x1 = 0.4858917593956, x2 = 0.48044270277023},
|
|
Tercio@4
|
1143 left = {x1 = 0.48433673381805, x2 = 0.48433673381805 - 0.00091059207916},
|
|
Tercio@4
|
1144 right = {x1 = 0.48206025362015, x2 = 0.48206025362015 + 0.00075059207916},
|
|
Tercio@4
|
1145 -- {x1 = 0.48433673381805, y1 = 0.74292266368866} -- {x1 = 0.48206025362015, y1 = 0.78930181264877}
|
|
Tercio@4
|
1146 },
|
|
Tercio@4
|
1147 --space 3
|
|
Tercio@4
|
1148 {
|
|
Tercio@4
|
1149 block = {x1 = 0.47047740221024, x2 = 0.4648859500885},
|
|
Tercio@8
|
1150 left = {x1 = 0.46893924474716, x2 = 0.46893924474716 - 0.000902948493956},
|
|
Tercio@8
|
1151 right = {x1 = 0.46635687351227, x2 = 0.46635687351227 + 0.000970948493956},
|
|
Tercio@4
|
1152 --{x1 = 0.46893924474716, y1 = 0.7981019616127} -- {x1 = 0.46635687351227, y1 = 0.73558133840561}
|
|
Tercio@4
|
1153 },
|
|
Tercio@4
|
1154 --space 4
|
|
Tercio@4
|
1155 {
|
|
Tercio@4
|
1156 block = {x1 = 0.45503282546997, x2 = 0.44976264238358},
|
|
Tercio@8
|
1157 left = {x1 = 0.4533554315567, x2 = 0.4533554315567 - 0.000714573974608},
|
|
Tercio@4
|
1158 right = {x1 = 0.45124399662018, x2 = 0.45124399662018 + 0.000770009999999},
|
|
Tercio@4
|
1159 --{x1 = 0.4533554315567, y1 = 0.74078941345215} -- {x1 = 0.45124399662018, y1 = 0.74088287353516}
|
|
Tercio@4
|
1160 }
|
|
Tercio@4
|
1161 }
|
|
Tercio@4
|
1162 Hansgar_safe_track = safe_track
|
|
Tercio@4
|
1163
|
|
Tercio@4
|
1164 -- /hansgar test
|
|
Tercio@8
|
1165 -- /run Hansgar_safe_track [4].left.x2 = 0.4533554315567 - 0.000714573974608
|
|
Tercio@4
|
1166
|
|
Tercio@7
|
1167 local red_alpha_disabled = 0.2
|
|
Tercio@4
|
1168 local red_alpha_enabled = 0.5
|
|
Tercio@4
|
1169
|
|
Tercio@4
|
1170 local green_alpha_disabled = 0.05
|
|
Tercio@4
|
1171 local green_alpha_enabled = 0.9
|
|
Tercio@4
|
1172
|
|
Tercio@13
|
1173 function f:ChangeDanceBar (facing)
|
|
Tercio@13
|
1174
|
|
Tercio@13
|
1175 if (facing == 1 or facing == 2) then --> north or south
|
|
Tercio@13
|
1176 t1_2:Hide()
|
|
Tercio@13
|
1177 t2_2:Hide()
|
|
Tercio@13
|
1178 t3_2:Hide()
|
|
Tercio@13
|
1179 t4_2:Hide()
|
|
Tercio@13
|
1180 middle_2:Hide()
|
|
Tercio@13
|
1181 t1:Show()
|
|
Tercio@13
|
1182 t2:Show()
|
|
Tercio@13
|
1183 t3:Show()
|
|
Tercio@13
|
1184 t4:Show()
|
|
Tercio@13
|
1185 middle:Show()
|
|
Tercio@13
|
1186
|
|
Tercio@13
|
1187 player_pos_frame2:Hide()
|
|
Tercio@13
|
1188 player_pos_frame:SetBackdropColor (0, 0, 0, 1)
|
|
Tercio@13
|
1189
|
|
Tercio@13
|
1190 elseif (facing == 3 or facing == 4) then --> west or east
|
|
Tercio@13
|
1191 t1_2:Show()
|
|
Tercio@13
|
1192 t2_2:Show()
|
|
Tercio@13
|
1193 t3_2:Show()
|
|
Tercio@13
|
1194 t4_2:Show()
|
|
Tercio@13
|
1195 middle_2:Show()
|
|
Tercio@13
|
1196 t1:Hide()
|
|
Tercio@13
|
1197 t2:Hide()
|
|
Tercio@13
|
1198 t3:Hide()
|
|
Tercio@13
|
1199 t4:Hide()
|
|
Tercio@13
|
1200 middle:Hide()
|
|
Tercio@13
|
1201
|
|
Tercio@13
|
1202 player_pos_frame:SetBackdropColor (0, 0, 0, 0)
|
|
Tercio@13
|
1203 player_pos_frame2:Show()
|
|
Tercio@13
|
1204
|
|
Tercio@13
|
1205 end
|
|
Tercio@13
|
1206
|
|
Tercio@13
|
1207 end
|
|
Tercio@13
|
1208
|
|
Tercio@4
|
1209 local track_function = function (self, elapsed)
|
|
Tercio@6
|
1210
|
|
Tercio@4
|
1211 local x, _ = GetPlayerMapPosition ("player")
|
|
Tercio@4
|
1212 local block
|
|
Tercio@4
|
1213
|
|
Tercio@6
|
1214 if (db.AUTO_FACING and x) then
|
|
Tercio@6
|
1215 local facing = GetPlayerFacing()
|
|
Tercio@6
|
1216
|
|
Tercio@13
|
1217 -- get 4 directions in radians
|
|
Tercio@13
|
1218 local current = self.facing
|
|
Tercio@13
|
1219 if (facing < 0.7 or facing > 5.6) then --north
|
|
Tercio@13
|
1220 --print ("north")
|
|
Tercio@13
|
1221 self.facing = 1
|
|
Tercio@13
|
1222 elseif (facing >= 0.7 and facing < 2.45) then --west
|
|
Tercio@13
|
1223 --print ("west")
|
|
Tercio@13
|
1224 self.facing = 3
|
|
Tercio@13
|
1225 elseif (facing > 2.45 and facing < 3.85) then --south
|
|
Tercio@13
|
1226 --print ("south")
|
|
Tercio@13
|
1227 self.facing = 2
|
|
Tercio@13
|
1228 elseif (facing >= 3.85 and facing <= 5.6) then --east
|
|
Tercio@13
|
1229 --print ("east")
|
|
Tercio@13
|
1230 self.facing = 4
|
|
Tercio@6
|
1231 end
|
|
Tercio@13
|
1232
|
|
Tercio@13
|
1233 if (current ~= self.facing) then
|
|
Tercio@13
|
1234 f:ChangeDanceBar (self.facing)
|
|
Tercio@13
|
1235 end
|
|
Tercio@13
|
1236
|
|
Tercio@6
|
1237 end
|
|
Tercio@6
|
1238
|
|
Tercio@6
|
1239 if (x) then
|
|
Tercio@6
|
1240 for i = 1, #safe_track do
|
|
Tercio@6
|
1241 local loc = safe_track [i]
|
|
Tercio@6
|
1242 if (x >= loc.block.x2 and x <= loc.block.x1) then
|
|
Tercio@6
|
1243 block = i
|
|
Tercio@6
|
1244 break
|
|
Tercio@6
|
1245 end
|
|
Tercio@4
|
1246 end
|
|
Tercio@4
|
1247 end
|
|
Tercio@4
|
1248
|
|
Tercio@6
|
1249 if (block and safe_track [block]) then
|
|
Tercio@4
|
1250
|
|
Tercio@4
|
1251 player_pos_frame:Show()
|
|
Tercio@4
|
1252 block = safe_track [block]
|
|
Tercio@4
|
1253
|
|
Tercio@13
|
1254 if (self.facing == 3 or self.facing == 4) then --> west
|
|
Tercio@13
|
1255 player_pos_frame2:Show()
|
|
Tercio@13
|
1256 end
|
|
Tercio@13
|
1257
|
|
Tercio@4
|
1258 if (x >= block.left.x2 and x <= block.left.x1) then
|
|
Tercio@13
|
1259 if (self.facing == 2) then --> south
|
|
Tercio@6
|
1260 t2:SetTexture (0.1, 1, 0.1, green_alpha_enabled)
|
|
Tercio@6
|
1261 t3:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1262 elseif (self.facing == 1) then --> north
|
|
Tercio@6
|
1263 t3:SetTexture (0.2, 232/255, 1, green_alpha_enabled)
|
|
Tercio@6
|
1264 t2:SetTexture (0.2, 232/255, 1, green_alpha_disabled)
|
|
Tercio@13
|
1265 elseif (self.facing == 3) then --> west
|
|
Tercio@13
|
1266 t2_2:SetTexture (0.1, 1, 0.1, green_alpha_enabled)
|
|
Tercio@13
|
1267 t3_2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1268 elseif (self.facing == 4) then --> east
|
|
Tercio@13
|
1269 t3_2:SetTexture (0.2, 232/255, 1, green_alpha_enabled)
|
|
Tercio@13
|
1270 t2_2:SetTexture (0.2, 232/255, 1, green_alpha_disabled)
|
|
Tercio@6
|
1271 end
|
|
Tercio@4
|
1272
|
|
Tercio@4
|
1273 t1:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1274 t4:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1275 middle:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1276 t1_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1277 t4_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1278 middle_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1279
|
|
Tercio@4
|
1280 elseif (x <= block.right.x2 and x >= block.right.x1) then
|
|
Tercio@13
|
1281 if (self.facing == 2) then --> south
|
|
Tercio@6
|
1282 t3:SetTexture (0.1, 1, 0.1, green_alpha_enabled)
|
|
Tercio@6
|
1283 t2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1284 elseif (self.facing == 1) then --> north
|
|
Tercio@6
|
1285 t2:SetTexture (0.2, 232/255, 1, green_alpha_enabled)
|
|
Tercio@6
|
1286 t3:SetTexture (0.2, 232/255, 1, green_alpha_disabled)
|
|
Tercio@13
|
1287 elseif (self.facing == 3) then --> west
|
|
Tercio@13
|
1288 t3_2:SetTexture (0.1, 1, 0.1, green_alpha_enabled)
|
|
Tercio@13
|
1289 t2_2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1290 elseif (self.facing == 4) then --> east
|
|
Tercio@13
|
1291 t2_2:SetTexture (0.2, 232/255, 1, green_alpha_enabled)
|
|
Tercio@13
|
1292 t3_2:SetTexture (0.2, 232/255, 1, green_alpha_disabled)
|
|
Tercio@6
|
1293 end
|
|
Tercio@4
|
1294
|
|
Tercio@4
|
1295 t1:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1296 t4:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1297 middle:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1298 t1_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1299 t4_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1300 middle_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1301
|
|
Tercio@4
|
1302 else
|
|
Tercio@4
|
1303 t1:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@4
|
1304 t4:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@4
|
1305 middle:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@13
|
1306 t1_2:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@13
|
1307 t4_2:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@13
|
1308 middle_2:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@4
|
1309
|
|
Tercio@4
|
1310 t2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@4
|
1311 t3:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1312 t2_2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1313 t3_2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@4
|
1314
|
|
Tercio@4
|
1315 end
|
|
Tercio@4
|
1316
|
|
Tercio@4
|
1317 --x = x - block.block.x2
|
|
Tercio@4
|
1318 --local at = abs ((x / (block.block.x1 - block.block.x2) * 100) - 100)
|
|
Tercio@4
|
1319 --div:SetPoint ("left", player_pos_frame, "left", self.width_pixel * at, 0)
|
|
Tercio@4
|
1320
|
|
Tercio@4
|
1321 else
|
|
Tercio@9
|
1322 if (f.unlocked_frame) then
|
|
Tercio@9
|
1323 player_pos_frame:Show()
|
|
Tercio@9
|
1324 else
|
|
Tercio@9
|
1325 player_pos_frame:Hide()
|
|
Tercio@13
|
1326 player_pos_frame2:Hide()
|
|
Tercio@9
|
1327 end
|
|
Tercio@4
|
1328 end
|
|
Tercio@4
|
1329 end
|
|
Tercio@4
|
1330
|
|
Tercio@4
|
1331 function f:StartTrackPlayerPosition()
|
|
Tercio@4
|
1332 player_pos_frame:Show()
|
|
Tercio@4
|
1333 tframe.width = player_pos_frame:GetWidth()
|
|
Tercio@4
|
1334 tframe.width_pixel = tframe.width / 100
|
|
Tercio@6
|
1335 tframe.facing = db.FACING_SIDE == 1
|
|
Tercio@4
|
1336 tframe:SetScript ("OnUpdate", track_function)
|
|
Tercio@4
|
1337 end
|
|
Tercio@4
|
1338 function f:EndTrackPlayerPosition()
|
|
Tercio@4
|
1339 player_pos_frame:Hide()
|
|
Tercio@13
|
1340 player_pos_frame2:Hide()
|
|
Tercio@4
|
1341 tframe:SetScript ("OnUpdate", nil)
|
|
Tercio@4
|
1342 end
|
|
Tercio@4
|
1343
|
|
Tercio@0
|
1344 local locs = {
|
|
Tercio@0
|
1345 --block 1:
|
|
Tercio@1
|
1346 {x1 = 0.51103663444519, y1 = 0.79726493358612, x2 = 0.50061076879501, y2 = 0.8241291642189},
|
|
Tercio@0
|
1347 --block 2:
|
|
Tercio@1
|
1348 {x1 = 0.49670505523682, y1 = 0.79692482948303, x2 = 0.48469054698944, y2 = 0.82489335536957},
|
|
Tercio@0
|
1349 --block 3:
|
|
Tercio@1
|
1350 {x1 = 0.48130965232849, y1 = 0.79742962121964, x2 = 0.46962946653366, y2 = 0.82453238964081},
|
|
Tercio@0
|
1351 --block 4:
|
|
Tercio@1
|
1352 {x1 = 0.46575212478638, y1 = 0.79766929149628, x2 = 0.45400339365005, y2 = 0.82176661491394},
|
|
Tercio@0
|
1353 --block 5:
|
|
Tercio@1
|
1354 {x1 = 0.45073217153549, y1 = 0.79751670360565, x2 = 0.43945103883743, y2 = 0.82504689693451},
|
|
Tercio@0
|
1355
|
|
Tercio@0
|
1356 --block 6
|
|
Tercio@1
|
1357 {x1 = 0.51104211807251, y1 = 0.76532691717148, x2 = 0.50021582841873, y2 = 0.79546189308167},
|
|
Tercio@1
|
1358 --block 7
|
|
Tercio@1
|
1359 {x1 = 0.4964514374733, y1 = 0.76603573560715, x2 = 0.48449218273163, y2 = 0.79527854919434},
|
|
Tercio@1
|
1360 --block 8
|
|
Tercio@1
|
1361 {x1 = 0.48101079463959, y1 = 0.76503103971481, x2 = 0.46944016218185, y2 = 0.79543298482895},
|
|
Tercio@1
|
1362 --block 9
|
|
Tercio@1
|
1363 {x1 = 0.46541726589203, y1 = 0.7654857635498, x2 = 0.45369201898575, y2 = 0.79529416561127},
|
|
Tercio@1
|
1364 --block 10
|
|
Tercio@1
|
1365 {x1 = 0.45051556825638, y1 = 0.76583826541901, x2 = 0.43931984901428, y2 = 0.79570162296295},
|
|
Tercio@1
|
1366
|
|
Tercio@1
|
1367
|
|
Tercio@1
|
1368 --block 11
|
|
Tercio@0
|
1369 {x1 = 0.51104187965393, y1 = 0.73422884941101, x2 = 0.49990028142929, y2 = 0.76343530416489},
|
|
Tercio@1
|
1370 --block 12
|
|
Tercio@0
|
1371 {x1 = 0.49673527479172, y1 = 0.73338270187378, x2 = 0.48483556509018, y2 = 0.76356953382492},
|
|
Tercio@1
|
1372 --block 13
|
|
Tercio@0
|
1373 {x1 = 0.48133307695389, y1 = 0.73373115062714, x2 = 0.46920585632324, y2 = 0.76366758346558},
|
|
Tercio@1
|
1374 --block 14
|
|
Tercio@0
|
1375 {x1 = 0.46568286418915, y1 = 0.73440700769424, x2 = 0.45381307601929, y2 = 0.76358675956726},
|
|
Tercio@1
|
1376 --block 15
|
|
Tercio@0
|
1377 {x1 = 0.45046973228455, y1 = 0.73361301422119, x2 = 0.43929302692413, y2 = 0.76388084888458},
|
|
Tercio@0
|
1378
|
|
Tercio@0
|
1379 --block 16
|
|
Tercio@1
|
1380 {x1 = 0.51104891300201, y1 = 0.70877063274384, x2 = 0.50024521350861, y2 = 0.73220580816269},
|
|
Tercio@0
|
1381 --block 17
|
|
Tercio@1
|
1382 {x1 = 0.49676024913788, y1 = 0.70914703607559, x2 = 0.48485481739044, y2 = 0.73210543394089},
|
|
Tercio@0
|
1383 --block 18
|
|
Tercio@1
|
1384 {x1 = 0.48142266273499, y1 = 0.70876735448837, x2 = 0.46925610303879, y2 = 0.73205661773682},
|
|
Tercio@0
|
1385 --block 19
|
|
Tercio@1
|
1386 {x1 = 0.46603119373322, y1 = 0.70929777622223, x2 = 0.45397216081619, y2 = 0.73167610168457},
|
|
Tercio@0
|
1387 --block 20
|
|
Tercio@1
|
1388 {x1 = 0.45079308748245, y1 = 0.70926278829575, x2 = 0.43927478790283, y2 = 0.73225915431976},
|
|
Tercio@0
|
1389 }
|
|
Tercio@0
|
1390
|
|
Tercio@0
|
1391 function f:WhichBlock (x, y)
|
|
Tercio@0
|
1392 for i = 1, #locs do
|
|
Tercio@0
|
1393 local loc = locs [i]
|
|
Tercio@0
|
1394 if (x >= loc.x2 and x <= loc.x1 and y >= loc.y1 and y <= loc.y2) then
|
|
Tercio@0
|
1395 return i
|
|
Tercio@0
|
1396 end
|
|
Tercio@0
|
1397 end
|
|
Tercio@0
|
1398 end
|
|
Tercio@0
|
1399
|
|
Tercio@0
|
1400 function f:percent_color (value, inverted)
|
|
Tercio@0
|
1401 local r, g
|
|
Tercio@0
|
1402 if (value < 50) then
|
|
Tercio@0
|
1403 r = 255
|
|
Tercio@0
|
1404 else
|
|
Tercio@0
|
1405 r = floor ( 255 - (value * 2 - 100) * 255 / 100)
|
|
Tercio@0
|
1406 end
|
|
Tercio@0
|
1407
|
|
Tercio@0
|
1408 if (value > 50) then
|
|
Tercio@0
|
1409 g = 255
|
|
Tercio@0
|
1410 else
|
|
Tercio@0
|
1411 g = floor ( (value * 2) * 255 / 100)
|
|
Tercio@0
|
1412 end
|
|
Tercio@0
|
1413
|
|
Tercio@0
|
1414 if (inverted) then
|
|
Tercio@0
|
1415 return g/255, r/255, 0
|
|
Tercio@0
|
1416 else
|
|
Tercio@0
|
1417 return r/255, g/255, 0
|
|
Tercio@0
|
1418 end
|
|
Tercio@0
|
1419 end
|