|
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@15
|
22 f.version = "v0.14"
|
|
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@14
|
351 if (db.NO_VERTICAL == nil) then
|
|
Tercio@14
|
352 db.NO_VERTICAL = false
|
|
Tercio@14
|
353 end
|
|
Tercio@4
|
354 --
|
|
Tercio@7
|
355
|
|
Tercio@7
|
356 f:SetLockState (true)
|
|
Tercio@7
|
357
|
|
Tercio@0
|
358 elseif (event == "ENCOUNTER_START" or event == "ENCOUNTER_END") then
|
|
Tercio@0
|
359
|
|
Tercio@0
|
360 local encounterID, encounterName, difficultyID, raidSize = select (1, ...)
|
|
Tercio@4
|
361
|
|
Tercio@4
|
362 if (encounterID == 1693) then
|
|
Tercio@9
|
363 if (f.unlocked_frame) then
|
|
Tercio@9
|
364 f.unlocked_frame = false
|
|
Tercio@9
|
365 end
|
|
Tercio@9
|
366
|
|
Tercio@4
|
367 if (event == "ENCOUNTER_START") then
|
|
Tercio@4
|
368 f.on_encounter = true
|
|
Tercio@9
|
369 f:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
|
|
Tercio@9
|
370
|
|
Tercio@4
|
371 elseif (event == "ENCOUNTER_END") then
|
|
Tercio@4
|
372 f.on_encounter = false
|
|
Tercio@9
|
373 f:UnregisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
|
|
Tercio@4
|
374 end
|
|
Tercio@4
|
375 end
|
|
Tercio@4
|
376
|
|
Tercio@4
|
377 if (encounterID == 1693 and db.SHOW_DANCE) then
|
|
Tercio@4
|
378 if (event == "ENCOUNTER_START") then
|
|
Tercio@4
|
379 SetMapToCurrentZone()
|
|
Tercio@4
|
380 f:StartTrackPlayerPosition()
|
|
Tercio@4
|
381 elseif (event == "ENCOUNTER_END") then
|
|
Tercio@4
|
382 f:EndTrackPlayerPosition()
|
|
Tercio@4
|
383 end
|
|
Tercio@4
|
384 end
|
|
Tercio@4
|
385
|
|
Tercio@0
|
386 if (encounterID == 1693 and difficultyID == 16) then
|
|
Tercio@0
|
387
|
|
Tercio@0
|
388 if (event == "ENCOUNTER_START") then
|
|
Tercio@0
|
389 print ("|cFFFFAA00Hansgar and Franzok Assist|r: addon enabled, good look!")
|
|
Tercio@0
|
390
|
|
Tercio@0
|
391 if (f.StampersPhase) then
|
|
Tercio@0
|
392 f:StopTracking()
|
|
Tercio@0
|
393 end
|
|
Tercio@0
|
394
|
|
Tercio@0
|
395 elseif (event == "ENCOUNTER_END") then
|
|
Tercio@0
|
396 if (f.StampersPhase) then
|
|
Tercio@0
|
397 f:StopTracking()
|
|
Tercio@0
|
398 end
|
|
Tercio@4
|
399
|
|
Tercio@4
|
400 f:EndTrackPlayerPosition()
|
|
Tercio@0
|
401 end
|
|
Tercio@0
|
402 end
|
|
Tercio@0
|
403 end
|
|
Tercio@0
|
404
|
|
Tercio@0
|
405 end)
|
|
Tercio@0
|
406
|
|
Tercio@6
|
407 SLASH_Hansgar_And_Franzok_Assist1, SLASH_Hansgar_And_Franzok_Assist2 = "/hansgar", "/franzok"
|
|
Tercio@6
|
408 function SlashCmdList.Hansgar_And_Franzok_Assist (msg, editbox)
|
|
Tercio@6
|
409
|
|
Tercio@6
|
410 local command, rest = msg:match ("^(%S*)%s*(.-)$")
|
|
Tercio@6
|
411
|
|
Tercio@6
|
412 if (command == "users") then
|
|
Tercio@6
|
413 if (f.users_schedule) then
|
|
Tercio@6
|
414 print ("|cFFFFAA00Hansgar and Franzok Assist|r please wait 5 seconds...")
|
|
Tercio@6
|
415 elseif (IsInRaid()) then
|
|
Tercio@6
|
416 f.users = {}
|
|
Tercio@6
|
417 f:SendCommMessage ("HAFR", "US", "RAID")
|
|
Tercio@6
|
418 f.users_schedule = f:ScheduleTimer ("ShowUsers", 5)
|
|
Tercio@6
|
419 print ("|cFFFFAA00Hansgar and Franzok Assist|r please wait 5 seconds...")
|
|
Tercio@6
|
420 else
|
|
Tercio@6
|
421 print ("|cFFFFAA00Hansgar and Franzok Assist|r you aren't in a raid group.")
|
|
Tercio@6
|
422 end
|
|
Tercio@6
|
423
|
|
Tercio@10
|
424 elseif (command == "st") then
|
|
Tercio@10
|
425 f.stop_casting_frame:Show()
|
|
Tercio@10
|
426 f.stop_casting_frame.alert.animOut:Stop()
|
|
Tercio@10
|
427 f.stop_casting_frame.alert.animIn:Play()
|
|
Tercio@10
|
428 f:ScheduleTimer ("HideStopSpellAlert", 1.2)
|
|
Tercio@10
|
429
|
|
Tercio@9
|
430 elseif (command == "stopcast") then
|
|
Tercio@9
|
431 db.STOP_CAST = not db.STOP_CAST
|
|
Tercio@9
|
432
|
|
Tercio@9
|
433 if (db.STOP_CAST) then
|
|
Tercio@9
|
434 print ("|cFFFFAA00Hansgar and Franzok Assist|r stop cast alert enabled.")
|
|
Tercio@9
|
435 else
|
|
Tercio@9
|
436 print ("|cFFFFAA00Hansgar and Franzok Assist|r stop cast alert disabled.")
|
|
Tercio@9
|
437 end
|
|
Tercio@9
|
438
|
|
Tercio@9
|
439 elseif (command == "resetpos") then
|
|
Tercio@9
|
440 f:ClearAllPoints()
|
|
Tercio@9
|
441 f:SetPoint ("center", UIParent, "center")
|
|
Tercio@9
|
442
|
|
Tercio@9
|
443 player_bar:ClearAllPoints()
|
|
Tercio@9
|
444 player_bar:SetPoint ("center", UIParent, "center")
|
|
Tercio@9
|
445
|
|
Tercio@9
|
446 player_pos_frame:ClearAllPoints()
|
|
Tercio@9
|
447 player_pos_frame:SetPoint ("center", UIParent, "center")
|
|
Tercio@9
|
448
|
|
Tercio@9
|
449 if (f.StampersPhase) then
|
|
Tercio@9
|
450 f:EndTrackPlayerPosition()
|
|
Tercio@9
|
451 f:StopTracking()
|
|
Tercio@9
|
452 end
|
|
Tercio@9
|
453
|
|
Tercio@9
|
454 db.FRAME_LOCK = true
|
|
Tercio@9
|
455 f:SetLockState()
|
|
Tercio@9
|
456
|
|
Tercio@9
|
457 f.unlocked_frame = true
|
|
Tercio@9
|
458
|
|
Tercio@9
|
459 f:StartTracking()
|
|
Tercio@9
|
460 f:StartTrackPlayerPosition()
|
|
Tercio@9
|
461
|
|
Tercio@9
|
462 print ("|cFFFFAA00Hansgar and Franzok Assist|r: position reseted.")
|
|
Tercio@9
|
463 print ("|cFFFFAA00Hansgar and Franzok Assist|r: move between the tracks to show the other frames.")
|
|
Tercio@9
|
464 print ("|cFFFFAA00Hansgar and Franzok Assist|r: type '/hansgar lock' to lock the frames.")
|
|
Tercio@9
|
465
|
|
Tercio@6
|
466 elseif (command == "delay") then
|
|
Tercio@6
|
467 local t = tonumber (rest)
|
|
Tercio@6
|
468 if (t) then
|
|
Tercio@6
|
469 db.STAMPERS_DELAY = t
|
|
Tercio@6
|
470 print ("|cFFFFAA00Hansgar and Franzok Assist|r delay set to: ", t)
|
|
Tercio@6
|
471 else
|
|
Tercio@6
|
472 print ("|cFFFFAA00Hansgar and Franzok Assist|r invalid time.", t)
|
|
Tercio@6
|
473 end
|
|
Tercio@6
|
474
|
|
Tercio@6
|
475 elseif (command == "test" or command == "show") then
|
|
Tercio@6
|
476 if (f.StampersPhase) then
|
|
Tercio@6
|
477 f:EndTrackPlayerPosition()
|
|
Tercio@6
|
478 return f:StopTracking()
|
|
Tercio@6
|
479 end
|
|
Tercio@6
|
480
|
|
Tercio@6
|
481 f:StartTracking()
|
|
Tercio@6
|
482 f:StartTrackPlayerPosition()
|
|
Tercio@6
|
483
|
|
Tercio@6
|
484 elseif (command == "hide") then
|
|
Tercio@6
|
485 if (f.StampersPhase) then
|
|
Tercio@6
|
486 return f:StopTracking()
|
|
Tercio@6
|
487 end
|
|
Tercio@6
|
488 f:EndTrackPlayerPosition()
|
|
Tercio@6
|
489
|
|
Tercio@7
|
490 elseif (command == "unlock") then
|
|
Tercio@7
|
491 db.FRAME_LOCK = true
|
|
Tercio@7
|
492 f:SetLockState()
|
|
Tercio@7
|
493 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame unlocked.")
|
|
Tercio@9
|
494
|
|
Tercio@9
|
495 f.unlocked_frame = true
|
|
Tercio@9
|
496 player_pos_frame:Show()
|
|
Tercio@9
|
497 player_bar:Show()
|
|
Tercio@10
|
498 f.stop_casting_frame:Show()
|
|
Tercio@7
|
499
|
|
Tercio@6
|
500 elseif (command == "lock") then
|
|
Tercio@6
|
501 f:SetLockState()
|
|
Tercio@6
|
502
|
|
Tercio@6
|
503 if (db.FRAME_LOCK) then
|
|
Tercio@6
|
504 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame locked.")
|
|
Tercio@9
|
505 f.unlocked_frame = false
|
|
Tercio@10
|
506 f.stop_casting_frame:Hide()
|
|
Tercio@6
|
507 else
|
|
Tercio@6
|
508 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame unlocked.")
|
|
Tercio@9
|
509
|
|
Tercio@9
|
510 f.unlocked_frame = true
|
|
Tercio@9
|
511 player_pos_frame:Show()
|
|
Tercio@9
|
512 player_bar:Show()
|
|
Tercio@10
|
513 f.stop_casting_frame:Show()
|
|
Tercio@9
|
514
|
|
Tercio@6
|
515 end
|
|
Tercio@6
|
516
|
|
Tercio@6
|
517 elseif (command == "facing") then
|
|
Tercio@6
|
518 if (rest == "1") then
|
|
Tercio@6
|
519 db.FACING_SIDE = 1
|
|
Tercio@6
|
520 tframe.facing = true
|
|
Tercio@6
|
521 print ("|cFFFFAA00Hansgar and Franzok Assist|r facing set to south.")
|
|
Tercio@6
|
522
|
|
Tercio@6
|
523 elseif (rest == "2") then
|
|
Tercio@6
|
524 db.FACING_SIDE = 2
|
|
Tercio@6
|
525 tframe.facing = false
|
|
Tercio@6
|
526 print ("|cFFFFAA00Hansgar and Franzok Assist|r facing set to north.")
|
|
Tercio@6
|
527
|
|
Tercio@6
|
528 elseif (rest == "auto") then
|
|
Tercio@6
|
529 db.AUTO_FACING = true
|
|
Tercio@6
|
530 print ("|cFFFFAA00Hansgar and Franzok Assist|r auto facing enabled.")
|
|
Tercio@6
|
531
|
|
Tercio@6
|
532 else
|
|
Tercio@6
|
533 print ("|cFFFFFF00/hansgar facing|r: |cFF00FF001|r = south |cFF00FF002|r = north, use to set the dance bar when auto facing is disabled.")
|
|
Tercio@6
|
534 end
|
|
Tercio@6
|
535
|
|
Tercio@6
|
536 elseif (command == "autofacing") then
|
|
Tercio@6
|
537 db.AUTO_FACING = not db.AUTO_FACING
|
|
Tercio@6
|
538 if (db.AUTO_FACING) then
|
|
Tercio@6
|
539 print ("|cFFFFAA00Hansgar and Franzok Assist|r auto facing enabled.")
|
|
Tercio@6
|
540 else
|
|
Tercio@6
|
541 print ("|cFFFFAA00Hansgar and Franzok Assist|r auto facing disabled.")
|
|
Tercio@6
|
542 tframe.facing = db.FACING_SIDE == 1
|
|
Tercio@6
|
543 end
|
|
Tercio@6
|
544
|
|
Tercio@6
|
545 elseif (command == "dance") then
|
|
Tercio@6
|
546 db.SHOW_DANCE = not db.SHOW_DANCE
|
|
Tercio@6
|
547 if (db.SHOW_DANCE) then
|
|
Tercio@6
|
548 if (f.on_encounter) then
|
|
Tercio@6
|
549 f:StartTrackPlayerPosition()
|
|
Tercio@6
|
550 end
|
|
Tercio@6
|
551 print ("|cFFFFAA00Hansgar and Franzok Assist|r dance bars enabled.")
|
|
Tercio@6
|
552 else
|
|
Tercio@6
|
553 f:EndTrackPlayerPosition()
|
|
Tercio@6
|
554 print ("|cFFFFAA00Hansgar and Franzok Assist|r dance bars disabled.")
|
|
Tercio@6
|
555 end
|
|
Tercio@6
|
556
|
|
Tercio@6
|
557 elseif (command == "cooldown") then
|
|
Tercio@6
|
558 db.CD_NUMBER = not db.CD_NUMBER
|
|
Tercio@6
|
559 f:RefreshCooldownSettings()
|
|
Tercio@6
|
560
|
|
Tercio@6
|
561 else
|
|
Tercio@11
|
562
|
|
Tercio@11
|
563 if (f.StampersPhase) then
|
|
Tercio@11
|
564 f:EndTrackPlayerPosition()
|
|
Tercio@11
|
565 return f:StopTracking()
|
|
Tercio@11
|
566 end
|
|
Tercio@11
|
567
|
|
Tercio@11
|
568 f:StartTracking()
|
|
Tercio@11
|
569 f:StartTrackPlayerPosition()
|
|
Tercio@11
|
570
|
|
Tercio@6
|
571 print ("|cFFFFAA00Hansgar and Franzok Assist|r |cFF00FF00" .. f.version .. "|r Commands:")
|
|
Tercio@9
|
572 print ("|cFFFFFF00/hansgar resetpos|r: reset the position of all frames.")
|
|
Tercio@6
|
573 print ("|cFFFFFF00/hansgar lock|r: toggle lock and unlock on the frame.")
|
|
Tercio@6
|
574 print ("|cFFFFFF00/hansgar test show hide|r: active the addon on test mode or hide it.")
|
|
Tercio@6
|
575 print ("|cFFFFFF00/hansgar delay <time>|r: time in seconds until the percentage goes from 0 to 100.")
|
|
Tercio@6
|
576 print ("|cFFFFFF00/hansgar dance|r: toggle dance bar (used to dodge regular stampers and searing plates).")
|
|
Tercio@6
|
577 print ("|cFFFFFF00/hansgar users|r: show who is using the addon in the raid.")
|
|
Tercio@6
|
578 print ("|cFFFFFF00/hansgar cooldown|r: show the countdown text for each stamper go back up to the ceiling.")
|
|
Tercio@9
|
579 print ("|cFFFFFF00/hansgar stopcast|r: show the alert to stop casting for Disrupting Roar.")
|
|
Tercio@6
|
580 end
|
|
Tercio@6
|
581 end
|
|
Tercio@6
|
582
|
|
Tercio@0
|
583 --
|
|
Tercio@0
|
584
|
|
Tercio@11
|
585 local options_panel = {
|
|
Tercio@11
|
586 {
|
|
Tercio@11
|
587 type = "range",
|
|
Tercio@11
|
588 get = function() return db.STAMPERS_DELAY end,
|
|
Tercio@11
|
589 set = function (self, fixedparam, value) db.STAMPERS_DELAY = value end,
|
|
Tercio@11
|
590 min = 4,
|
|
Tercio@11
|
591 max = 8,
|
|
Tercio@11
|
592 step = 1,
|
|
Tercio@11
|
593 desc = "Time in seconds to move out from a heating up stamper.",
|
|
Tercio@11
|
594 name = "Stampers Delay",
|
|
Tercio@11
|
595 },
|
|
Tercio@11
|
596 {
|
|
Tercio@11
|
597 type = "toggle",
|
|
Tercio@11
|
598 get = function() return db.FRAME_LOCK end,
|
|
Tercio@11
|
599 set = function (self, fixedparam, value)
|
|
Tercio@11
|
600 db.FRAME_LOCK = not value;
|
|
Tercio@11
|
601 if (db.FRAME_LOCK) then
|
|
Tercio@11
|
602 f:SetLockState()
|
|
Tercio@11
|
603 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame unlocked.")
|
|
Tercio@11
|
604
|
|
Tercio@11
|
605 f.unlocked_frame = true
|
|
Tercio@11
|
606 f.player_pos_frame:Show()
|
|
Tercio@11
|
607 f.player_bar:Show()
|
|
Tercio@11
|
608 f.stop_casting_frame:Show()
|
|
Tercio@11
|
609 else
|
|
Tercio@11
|
610 f:SetLockState()
|
|
Tercio@11
|
611 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame locked.")
|
|
Tercio@11
|
612 f.unlocked_frame = false
|
|
Tercio@11
|
613 f.stop_casting_frame:Hide()
|
|
Tercio@11
|
614 end
|
|
Tercio@11
|
615 end,
|
|
Tercio@11
|
616 desc = "Lock or unlock the frames.",
|
|
Tercio@11
|
617 name = "Frame Locked"
|
|
Tercio@11
|
618 },
|
|
Tercio@11
|
619 {
|
|
Tercio@11
|
620 type = "toggle",
|
|
Tercio@11
|
621 get = function() return db.SHOW_DANCE end,
|
|
Tercio@11
|
622 set = function (self, fixedparam, value)
|
|
Tercio@11
|
623 db.SHOW_DANCE = not db.SHOW_DANCE
|
|
Tercio@11
|
624 if (db.SHOW_DANCE) then
|
|
Tercio@11
|
625 if (f.on_encounter) then
|
|
Tercio@11
|
626 f:StartTrackPlayerPosition()
|
|
Tercio@11
|
627 end
|
|
Tercio@11
|
628 else
|
|
Tercio@11
|
629 f:EndTrackPlayerPosition()
|
|
Tercio@11
|
630 end
|
|
Tercio@11
|
631 end,
|
|
Tercio@11
|
632 desc = "Enable or disable the dance bar.",
|
|
Tercio@11
|
633 name = "Dance Bar"
|
|
Tercio@11
|
634 },
|
|
Tercio@11
|
635 {
|
|
Tercio@11
|
636 type = "toggle",
|
|
Tercio@14
|
637 get = function() return db.NO_VERTICAL end,
|
|
Tercio@14
|
638 set = function (self, fixedparam, value)
|
|
Tercio@14
|
639 db.NO_VERTICAL = not db.NO_VERTICAL
|
|
Tercio@14
|
640 end,
|
|
Tercio@14
|
641 desc = "When enabled, dance bar won't switch to vertical position when facing west and east.",
|
|
Tercio@14
|
642 name = "No Vertical Dance bar"
|
|
Tercio@14
|
643 },
|
|
Tercio@14
|
644 {
|
|
Tercio@14
|
645 type = "toggle",
|
|
Tercio@11
|
646 get = function() return db.CD_NUMBER end,
|
|
Tercio@11
|
647 set = function (self, fixedparam, value)
|
|
Tercio@11
|
648 db.CD_NUMBER = not db.CD_NUMBER
|
|
Tercio@11
|
649 f:RefreshCooldownSettings()
|
|
Tercio@11
|
650 end,
|
|
Tercio@11
|
651 desc = "When enabled, shows the number countdown on each block.",
|
|
Tercio@11
|
652 name = "Show Cooldown Number"
|
|
Tercio@11
|
653 },
|
|
Tercio@11
|
654 {
|
|
Tercio@11
|
655 type = "toggle",
|
|
Tercio@11
|
656 get = function() return db.STOP_CAST end,
|
|
Tercio@11
|
657 set = function (self, fixedparam, value)
|
|
Tercio@11
|
658 db.STOP_CAST = not db.STOP_CAST
|
|
Tercio@11
|
659 end,
|
|
Tercio@11
|
660 desc = "When enabled, shows an alert for Disrupting Roar.",
|
|
Tercio@11
|
661 name = "Stop Cast Alert"
|
|
Tercio@11
|
662 },
|
|
Tercio@11
|
663 {
|
|
Tercio@11
|
664 type = "execute",
|
|
Tercio@11
|
665 func = function()
|
|
Tercio@11
|
666 if (f.StampersPhase) then
|
|
Tercio@11
|
667 f:EndTrackPlayerPosition()
|
|
Tercio@11
|
668 return f:StopTracking()
|
|
Tercio@11
|
669 end
|
|
Tercio@11
|
670 f:StartTracking()
|
|
Tercio@11
|
671 f:StartTrackPlayerPosition()
|
|
Tercio@11
|
672 end,
|
|
Tercio@11
|
673 desc = "Test the addon, run over the tracks in the room.",
|
|
Tercio@11
|
674 name = "Start Test Mode"
|
|
Tercio@11
|
675 },
|
|
Tercio@11
|
676 {
|
|
Tercio@11
|
677 type = "execute",
|
|
Tercio@11
|
678 func = function()
|
|
Tercio@11
|
679 f:ClearAllPoints()
|
|
Tercio@11
|
680 f:SetPoint ("center", UIParent, "center")
|
|
Tercio@11
|
681
|
|
Tercio@11
|
682 player_bar:ClearAllPoints()
|
|
Tercio@11
|
683 player_bar:SetPoint ("center", UIParent, "center")
|
|
Tercio@11
|
684
|
|
Tercio@11
|
685 player_pos_frame:ClearAllPoints()
|
|
Tercio@11
|
686 player_pos_frame:SetPoint ("center", UIParent, "center")
|
|
Tercio@11
|
687
|
|
Tercio@11
|
688 if (f.StampersPhase) then
|
|
Tercio@11
|
689 f:EndTrackPlayerPosition()
|
|
Tercio@11
|
690 f:StopTracking()
|
|
Tercio@11
|
691 end
|
|
Tercio@11
|
692
|
|
Tercio@11
|
693 db.FRAME_LOCK = true
|
|
Tercio@11
|
694 f:SetLockState()
|
|
Tercio@11
|
695
|
|
Tercio@11
|
696 f.unlocked_frame = true
|
|
Tercio@11
|
697
|
|
Tercio@11
|
698 f:StartTracking()
|
|
Tercio@11
|
699 f:StartTrackPlayerPosition()
|
|
Tercio@11
|
700
|
|
Tercio@11
|
701 print ("|cFFFFAA00Hansgar and Franzok Assist|r: position reseted and frames are unlocked.")
|
|
Tercio@11
|
702 print ("|cFFFFAA00Hansgar and Franzok Assist|r: move between the tracks to show the other frames.")
|
|
Tercio@11
|
703 end,
|
|
Tercio@11
|
704 desc = "Reset the position of all frames and start the test mode.",
|
|
Tercio@11
|
705 name = "Reset Position"
|
|
Tercio@11
|
706 },
|
|
Tercio@11
|
707 {
|
|
Tercio@11
|
708 type = "execute",
|
|
Tercio@11
|
709 func = function()
|
|
Tercio@11
|
710 if (f.users_schedule) then
|
|
Tercio@11
|
711 print ("|cFFFFAA00Hansgar and Franzok Assist|r please wait 5 seconds...")
|
|
Tercio@11
|
712 elseif (IsInRaid()) then
|
|
Tercio@11
|
713 f.users = {}
|
|
Tercio@11
|
714 f:SendCommMessage ("HAFR", "US", "RAID")
|
|
Tercio@11
|
715 f.users_schedule = f:ScheduleTimer ("ShowUsers", 5)
|
|
Tercio@11
|
716 print ("|cFFFFAA00Hansgar and Franzok Assist|r please wait 5 seconds...")
|
|
Tercio@11
|
717 else
|
|
Tercio@11
|
718 print ("|cFFFFAA00Hansgar and Franzok Assist|r you aren't in a raid group.")
|
|
Tercio@11
|
719 end
|
|
Tercio@11
|
720 end,
|
|
Tercio@11
|
721 desc = "Show raid members which are also using this addon.",
|
|
Tercio@11
|
722 name = "Version Check"
|
|
Tercio@11
|
723 },
|
|
Tercio@11
|
724 {
|
|
Tercio@11
|
725 type = "execute",
|
|
Tercio@11
|
726 func = function()
|
|
Tercio@11
|
727 f.feedback_func()
|
|
Tercio@11
|
728 end,
|
|
Tercio@11
|
729 desc = "Send a feedback for us on our Curse page or MMO-Champion forum Thread.",
|
|
Tercio@11
|
730 name = "Send Feedback"
|
|
Tercio@11
|
731 },
|
|
Tercio@11
|
732 }
|
|
Tercio@11
|
733
|
|
Tercio@11
|
734 local build_options_panel = function()
|
|
Tercio@11
|
735 local options_frame = DF:CreateOptionsFrame ("HansgarFranzokAssistOptions", "Hans & Franz Assist", 1)
|
|
Tercio@14
|
736 options_frame:SetHeight (200)
|
|
Tercio@14
|
737 DF:BuildMenu (options_frame, options_panel, 15, -60, 200)
|
|
Tercio@11
|
738 options_frame:SetBackdropColor (0, 0, 0, .9)
|
|
Tercio@11
|
739 end
|
|
Tercio@11
|
740
|
|
Tercio@11
|
741 f.OpenOptionsPanel = function()
|
|
Tercio@11
|
742 if (not HansgarFranzokAssistOptions) then
|
|
Tercio@11
|
743 build_options_panel()
|
|
Tercio@11
|
744 end
|
|
Tercio@11
|
745 HansgarFranzokAssistOptions:Show()
|
|
Tercio@11
|
746 end
|
|
Tercio@11
|
747
|
|
Tercio@11
|
748 -- /run Hansgar_And_Franzok_Assist.OpenOptionsPanel()
|
|
Tercio@11
|
749 local options = DF:CreateOptionsButton (f, f.OpenOptionsPanel, "Hansgar_And_Franzok_Assist_OPButton")
|
|
Tercio@11
|
750 options:SetPoint ("right", f.Lock, "left", 1, 0)
|
|
Tercio@11
|
751 f.Options = options
|
|
Tercio@11
|
752
|
|
Tercio@11
|
753 --
|
|
Tercio@11
|
754 local feedback_func = function()
|
|
Tercio@11
|
755 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
|
756 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
|
757
|
|
Tercio@11
|
758 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
|
759 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
|
760 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
|
761 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
|
762 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
|
763 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
|
764 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
|
765
|
|
Tercio@11
|
766 DF:ShowFeedbackPanel ("Hans & Franz Assist", f.version, {feedback2, feedback1}, {same1, same2, same3, same4, same5, same6, same7})
|
|
Tercio@11
|
767 end
|
|
Tercio@11
|
768 f.feedback_func = feedback_func
|
|
Tercio@11
|
769 local feedback_button = DF:CreateFeedbackButton (f, feedback_func, "Hansgar_And_Franzok_AssistFBButton")
|
|
Tercio@11
|
770 feedback_button:SetPoint ("right", f.Options, "left", 0, -1)
|
|
Tercio@11
|
771 --
|
|
Tercio@11
|
772
|
|
Tercio@10
|
773 local stop_casting_frame = CreateFrame ("frame", "Hansgar_And_Franzok_AssistStopCasting", UIParent)
|
|
Tercio@9
|
774 stop_casting_frame:SetSize (200, 30)
|
|
Tercio@9
|
775 stop_casting_frame:SetPoint ("center", UIParent, "center", 0, 75)
|
|
Tercio@9
|
776 stop_casting_frame:SetFrameStrata ("FULLSCREEN")
|
|
Tercio@10
|
777 f.stop_casting_frame = stop_casting_frame
|
|
Tercio@9
|
778 stop_casting_frame:Hide()
|
|
Tercio@10
|
779
|
|
Tercio@10
|
780 stop_casting_frame:SetMovable (false)
|
|
Tercio@10
|
781 stop_casting_frame:EnableMouse (false)
|
|
Tercio@10
|
782
|
|
Tercio@10
|
783 stop_casting_frame:SetScript ("OnMouseDown", function (self)
|
|
Tercio@10
|
784 if (not self.isMoving) then
|
|
Tercio@10
|
785 self:StartMoving()
|
|
Tercio@10
|
786 self.isMoving = true
|
|
Tercio@10
|
787 end
|
|
Tercio@9
|
788 end)
|
|
Tercio@10
|
789 stop_casting_frame:SetScript ("OnMouseUp", function (self)
|
|
Tercio@10
|
790 if (self.isMoving) then
|
|
Tercio@10
|
791 self:StopMovingOrSizing()
|
|
Tercio@10
|
792 self.isMoving = false
|
|
Tercio@10
|
793 end
|
|
Tercio@9
|
794 end)
|
|
Tercio@9
|
795
|
|
Tercio@10
|
796 local alert = CreateFrame ("frame", "Hansgar_And_Franzok_AssistStopCastingAlert", stop_casting_frame, "ActionBarButtonSpellActivationAlert")
|
|
Tercio@10
|
797 alert:SetPoint ("topleft", stop_casting_frame, "topleft", -10, 2)
|
|
Tercio@10
|
798 alert:SetPoint ("bottomright", stop_casting_frame, "bottomright", 10, -2)
|
|
Tercio@10
|
799 stop_casting_frame.alert = alert
|
|
Tercio@10
|
800
|
|
Tercio@9
|
801 local text = stop_casting_frame:CreateFontString (nil, "overlay", "GameFontNormal")
|
|
Tercio@9
|
802 text:SetText ("STOP CASTING!")
|
|
Tercio@9
|
803 text:SetPoint ("center", stop_casting_frame, "center")
|
|
Tercio@9
|
804
|
|
Tercio@9
|
805 stop_casting_frame:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16})
|
|
Tercio@10
|
806 stop_casting_frame:SetBackdropColor (0, 0, 0, 0.3)
|
|
Tercio@9
|
807
|
|
Tercio@10
|
808 function f:HideStopSpellAlert2()
|
|
Tercio@10
|
809 stop_casting_frame.alert.animOut:Stop()
|
|
Tercio@10
|
810 stop_casting_frame:Hide()
|
|
Tercio@10
|
811 end
|
|
Tercio@9
|
812 function f:HideStopSpellAlert()
|
|
Tercio@10
|
813 stop_casting_frame.alert.animIn:Stop()
|
|
Tercio@10
|
814 stop_casting_frame.alert.animOut:Play()
|
|
Tercio@10
|
815 f:ScheduleTimer ("HideStopSpellAlert2", 0.3)
|
|
Tercio@9
|
816 end
|
|
Tercio@9
|
817
|
|
Tercio@9
|
818 --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
|
819
|
|
Tercio@9
|
820 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
|
821
|
|
Tercio@2
|
822 if (token == "SPELL_AURA_APPLIED" and spellid == 162124 and not f.StampersPhase) then
|
|
Tercio@0
|
823 f:StartTracking()
|
|
Tercio@5
|
824 f:EndTrackPlayerPosition()
|
|
Tercio@0
|
825
|
|
Tercio@2
|
826 elseif (token == "SPELL_AURA_REMOVED" and spellid == 162124 and f.StampersPhase) then
|
|
Tercio@0
|
827 f:StopTracking()
|
|
Tercio@5
|
828 if (db.SHOW_DANCE) then
|
|
Tercio@5
|
829 f:StartTrackPlayerPosition()
|
|
Tercio@5
|
830 end
|
|
Tercio@0
|
831
|
|
Tercio@9
|
832 elseif (token == "SPELL_CAST_START" and spellid == 160838 and db.STOP_CAST) then --Disrupting Roar
|
|
Tercio@10
|
833 f.stop_casting_frame:Show()
|
|
Tercio@10
|
834 f.stop_casting_frame.alert.animOut:Stop()
|
|
Tercio@10
|
835 f.stop_casting_frame.alert.animIn:Play()
|
|
Tercio@10
|
836 f:ScheduleTimer ("HideStopSpellAlert", 1.2)
|
|
Tercio@10
|
837
|
|
Tercio@0
|
838 end
|
|
Tercio@9
|
839
|
|
Tercio@9
|
840 if (token == "SPELL_INTERRUPT" and spellid == 160838 and db.STOP_CAST) then
|
|
Tercio@9
|
841 local link = GetSpellLink (buff_type)
|
|
Tercio@9
|
842 print ("Stop Cast Fail:", target_name, link)
|
|
Tercio@9
|
843 end
|
|
Tercio@9
|
844
|
|
Tercio@9
|
845 --if (spellid == 160838) then
|
|
Tercio@9
|
846 -- print ("event:", token, 160838, db.STOP_CAST)
|
|
Tercio@9
|
847 --end
|
|
Tercio@0
|
848
|
|
Tercio@0
|
849 end)
|
|
Tercio@10
|
850 -- /run Hansgar_And_Franzok_AssistStopCastingAlert.animIn:Play()
|
|
Tercio@0
|
851
|
|
Tercio@9
|
852 --Hansgar_And_Franzok_AssistStopCasting:Show(); Hansgar_And_Franzok_Assist:ScheduleTimer ("HideStopSpellAlert", 1)
|
|
Tercio@9
|
853 --Hansgar_And_Franzok_Assist:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
|
|
Tercio@9
|
854
|
|
Tercio@0
|
855 local frame_tracker = CreateFrame ("frame", "Hansgar_And_Franzok_AssistTracker", UIParent)
|
|
Tercio@0
|
856 local on_update_tracker = function (self, elapsed)
|
|
Tercio@0
|
857
|
|
Tercio@4
|
858 local raid_size = GetNumGroupMembers()
|
|
Tercio@4
|
859
|
|
Tercio@4
|
860 for i = 1, raid_size do
|
|
Tercio@0
|
861 local x, y = GetPlayerMapPosition ("raid"..i)
|
|
Tercio@0
|
862 if (UnitExists ("raid"..i) and UnitHealth ("raid"..i) > 1 and x and y) then
|
|
Tercio@0
|
863 local block = f:WhichBlock (x, y)
|
|
Tercio@0
|
864 if (block) then
|
|
Tercio@0
|
865 if (not f.block_tracker [block]) then --> was a clear block
|
|
Tercio@0
|
866 f.block_tracker [block] = GetTime()
|
|
Tercio@0
|
867 f:Paint (f.all_blocks [block])
|
|
Tercio@0
|
868 end
|
|
Tercio@0
|
869 end
|
|
Tercio@0
|
870 end
|
|
Tercio@0
|
871 end
|
|
Tercio@0
|
872
|
|
Tercio@0
|
873 local px, py = GetPlayerMapPosition ("player")
|
|
Tercio@0
|
874 local player_block = f:WhichBlock (px, py)
|
|
Tercio@6
|
875 if (player_block and f.block_tracker [player_block] and raid_size > 0) then
|
|
Tercio@0
|
876
|
|
Tercio@0
|
877 local time_limit_at = f.block_tracker [player_block] + db.STAMPERS_DELAY
|
|
Tercio@0
|
878 local time_now = GetTime()
|
|
Tercio@0
|
879
|
|
Tercio@7
|
880 local timeleft = time_limit_at - time_now
|
|
Tercio@7
|
881 f.player_bar:SetValue ((timeleft) / db.STAMPERS_DELAY * 100)
|
|
Tercio@7
|
882 if (timeleft > 0) then
|
|
Tercio@7
|
883 f.player_bar.text:SetText (format ("%.1f", timeleft))
|
|
Tercio@7
|
884 else
|
|
Tercio@7
|
885 f.player_bar.text:SetText ("Move!")
|
|
Tercio@7
|
886 end
|
|
Tercio@0
|
887 f.player_bar:Show()
|
|
Tercio@7
|
888
|
|
Tercio@0
|
889 local block_frame = f.all_blocks [player_block]
|
|
Tercio@0
|
890 f.player_loc_box:SetPoint ("center", block_frame, "center")
|
|
Tercio@0
|
891 f.player_loc_box:Show()
|
|
Tercio@7
|
892
|
|
Tercio@0
|
893 else
|
|
Tercio@9
|
894 if (f.unlocked_frame) then
|
|
Tercio@9
|
895 f.player_loc_box:Show()
|
|
Tercio@9
|
896 f.player_bar:Show()
|
|
Tercio@9
|
897 f.player_bar:SetValue (100)
|
|
Tercio@9
|
898 else
|
|
Tercio@9
|
899 f.player_loc_box:Hide()
|
|
Tercio@9
|
900 f.player_bar:Hide()
|
|
Tercio@9
|
901 end
|
|
Tercio@0
|
902 end
|
|
Tercio@0
|
903 end
|
|
Tercio@0
|
904
|
|
Tercio@0
|
905 function f:StartTracking()
|
|
Tercio@0
|
906
|
|
Tercio@0
|
907 print ("|cFFFFAA00Hansgar and Franzok Assist|r: Smart Stampers phase started.")
|
|
Tercio@0
|
908
|
|
Tercio@0
|
909 f.StampersPhase = true
|
|
Tercio@0
|
910
|
|
Tercio@0
|
911 if (not f.frames_built) then
|
|
Tercio@0
|
912 f:CreateWindow()
|
|
Tercio@0
|
913 end
|
|
Tercio@7
|
914
|
|
Tercio@0
|
915 f:ResetBlocks()
|
|
Tercio@0
|
916 f.player_loc_box:Hide()
|
|
Tercio@0
|
917
|
|
Tercio@0
|
918 f.block_tracker = f.block_tracker or {}
|
|
Tercio@0
|
919 table.wipe (f.block_tracker)
|
|
Tercio@7
|
920
|
|
Tercio@0
|
921 SetMapToCurrentZone()
|
|
Tercio@7
|
922
|
|
Tercio@0
|
923 frame_tracker:SetScript ("OnUpdate", on_update_tracker)
|
|
Tercio@0
|
924 f:Show()
|
|
Tercio@7
|
925 f.player_bar:Show()
|
|
Tercio@7
|
926
|
|
Tercio@0
|
927 end
|
|
Tercio@0
|
928
|
|
Tercio@0
|
929 function f:StopTracking()
|
|
Tercio@0
|
930 print ("|cFFFFAA00Hansgar and Franzok Assist|r: Smart Stampers phase ended.")
|
|
Tercio@0
|
931
|
|
Tercio@0
|
932 f.StampersPhase = false
|
|
Tercio@0
|
933 frame_tracker:SetScript ("OnUpdate", nil)
|
|
Tercio@0
|
934 table.wipe (f.block_tracker)
|
|
Tercio@0
|
935 f.player_loc_box:Hide()
|
|
Tercio@0
|
936 f:Hide()
|
|
Tercio@7
|
937 f.player_bar:SetValue (0)
|
|
Tercio@7
|
938 f.player_bar:Hide()
|
|
Tercio@0
|
939 end
|
|
Tercio@0
|
940
|
|
Tercio@0
|
941 local on_mouse_down = function (self)
|
|
Tercio@5
|
942 if (not self.isMoving and not db.FRAME_LOCK) then
|
|
Tercio@0
|
943 self.isMoving = true
|
|
Tercio@0
|
944 f:StartMoving()
|
|
Tercio@0
|
945 end
|
|
Tercio@0
|
946 end
|
|
Tercio@0
|
947 local on_mouse_up = function (self)
|
|
Tercio@0
|
948 if (self.isMoving) then
|
|
Tercio@0
|
949 self.isMoving = nil
|
|
Tercio@0
|
950 f:StopMovingOrSizing()
|
|
Tercio@0
|
951 end
|
|
Tercio@0
|
952 end
|
|
Tercio@0
|
953
|
|
Tercio@0
|
954 local painting = function (self, elapsed)
|
|
Tercio@0
|
955 self.step = self.step + elapsed
|
|
Tercio@0
|
956 self.total_time = self.total_time + elapsed
|
|
Tercio@0
|
957
|
|
Tercio@0
|
958 if (self.step > 0.2) then
|
|
Tercio@0
|
959 self.step = 0
|
|
Tercio@0
|
960 local percent = self.total_time / db.STAMPERS_DELAY * 100
|
|
Tercio@0
|
961
|
|
Tercio@0
|
962 percent = min (percent, 100)
|
|
Tercio@0
|
963
|
|
Tercio@0
|
964 local r, g, b = f:percent_color (percent, true)
|
|
Tercio@0
|
965 self:SetBackdropColor (r, g, b, 0.5)
|
|
Tercio@0
|
966
|
|
Tercio@0
|
967 self.number:SetText (floor (percent) .. "%")
|
|
Tercio@0
|
968 self.number:SetTextColor (1, 1, 1, 1)
|
|
Tercio@0
|
969
|
|
Tercio@0
|
970 if (percent == 100) then
|
|
Tercio@0
|
971 self:SetScript ("OnUpdate", nil)
|
|
Tercio@0
|
972 self.stamper_icon:Show()
|
|
Tercio@0
|
973 self.number:Hide()
|
|
Tercio@5
|
974 self.cooldown:Show()
|
|
Tercio@4
|
975 self.cooldown:SetCooldown (GetTime(), 37 - db.STAMPERS_DELAY, 0, 0)
|
|
Tercio@0
|
976 end
|
|
Tercio@0
|
977 end
|
|
Tercio@0
|
978 end
|
|
Tercio@4
|
979
|
|
Tercio@4
|
980 function f:UnPaint (block)
|
|
Tercio@4
|
981 f:ResetBlock (block)
|
|
Tercio@4
|
982 end
|
|
Tercio@0
|
983 function f:Paint (block)
|
|
Tercio@0
|
984 block.step = 0
|
|
Tercio@0
|
985 block.total_time = 0
|
|
Tercio@0
|
986 block:SetScript ("OnUpdate", painting)
|
|
Tercio@4
|
987 local unpaint = f:ScheduleTimer ("UnPaint", 37, block)
|
|
Tercio@4
|
988 block.unpaint_process = unpaint
|
|
Tercio@4
|
989 end
|
|
Tercio@4
|
990
|
|
Tercio@4
|
991 function f:ResetBlock (block)
|
|
Tercio@4
|
992 block:SetScript ("OnUpdate", nil)
|
|
Tercio@4
|
993 block:SetBackdropColor (.8, .8, .8, 0.5)
|
|
Tercio@4
|
994 block.number:SetText (block.id)
|
|
Tercio@4
|
995 block.number:SetTextColor (1, 1, 1, 0.5)
|
|
Tercio@4
|
996 block.number:Show()
|
|
Tercio@4
|
997 block.stamper_icon:Hide()
|
|
Tercio@4
|
998 block.cooldown:SetCooldown (0, 0, 0, 0)
|
|
Tercio@5
|
999 block.cooldown:Hide()
|
|
Tercio@4
|
1000
|
|
Tercio@4
|
1001 f.block_tracker [block.id] = nil
|
|
Tercio@4
|
1002 if (block.unpaint_process) then
|
|
Tercio@4
|
1003 f:CancelTimer (block.unpaint_process)
|
|
Tercio@4
|
1004 block.unpaint_process = nil
|
|
Tercio@4
|
1005 end
|
|
Tercio@0
|
1006 end
|
|
Tercio@0
|
1007
|
|
Tercio@0
|
1008 function f:ResetBlocks()
|
|
Tercio@0
|
1009 for _, block in ipairs (f.all_blocks) do
|
|
Tercio@4
|
1010 f:ResetBlock (block)
|
|
Tercio@4
|
1011 end
|
|
Tercio@4
|
1012 end
|
|
Tercio@4
|
1013
|
|
Tercio@4
|
1014 function f:RefreshCooldownSettings()
|
|
Tercio@4
|
1015 for _, block in ipairs (f.all_blocks) do
|
|
Tercio@4
|
1016 if (not db.CD_NUMBER) then
|
|
Tercio@4
|
1017 block.cooldown:SetHideCountdownNumbers (true)
|
|
Tercio@4
|
1018 block.cooldown:SetDrawEdge (false)
|
|
Tercio@4
|
1019 else
|
|
Tercio@4
|
1020 block.cooldown:SetHideCountdownNumbers (false)
|
|
Tercio@4
|
1021 block.cooldown:SetDrawEdge (true)
|
|
Tercio@4
|
1022 end
|
|
Tercio@0
|
1023 end
|
|
Tercio@0
|
1024 end
|
|
Tercio@0
|
1025
|
|
Tercio@7
|
1026 function f:SetLockState (just_refresh)
|
|
Tercio@7
|
1027
|
|
Tercio@7
|
1028 if (not just_refresh) then
|
|
Tercio@7
|
1029 db.FRAME_LOCK = not db.FRAME_LOCK
|
|
Tercio@7
|
1030 end
|
|
Tercio@7
|
1031
|
|
Tercio@5
|
1032 if (db.FRAME_LOCK) then
|
|
Tercio@5
|
1033 --locked
|
|
Tercio@5
|
1034 f:EnableMouse (false)
|
|
Tercio@7
|
1035 player_bar:EnableMouse (false)
|
|
Tercio@7
|
1036 player_pos_frame:EnableMouse (false)
|
|
Tercio@10
|
1037 stop_casting_frame:SetMovable (false)
|
|
Tercio@10
|
1038 stop_casting_frame:EnableMouse (false)
|
|
Tercio@7
|
1039
|
|
Tercio@5
|
1040 for _, block in ipairs (f.all_blocks) do
|
|
Tercio@5
|
1041 block:EnableMouse (false)
|
|
Tercio@5
|
1042 end
|
|
Tercio@7
|
1043
|
|
Tercio@7
|
1044 if (f.StampersPhase and not just_refresh) then
|
|
Tercio@7
|
1045 f:EndTrackPlayerPosition()
|
|
Tercio@7
|
1046 f:StopTracking()
|
|
Tercio@7
|
1047 end
|
|
Tercio@10
|
1048
|
|
Tercio@5
|
1049 else
|
|
Tercio@5
|
1050 --unlocked
|
|
Tercio@5
|
1051 f:EnableMouse (true)
|
|
Tercio@7
|
1052 player_bar:EnableMouse (true)
|
|
Tercio@7
|
1053 player_pos_frame:EnableMouse (true)
|
|
Tercio@10
|
1054 stop_casting_frame:SetMovable (true)
|
|
Tercio@10
|
1055 stop_casting_frame:EnableMouse (true)
|
|
Tercio@7
|
1056
|
|
Tercio@5
|
1057 for _, block in ipairs (f.all_blocks) do
|
|
Tercio@5
|
1058 block:EnableMouse (true)
|
|
Tercio@5
|
1059 end
|
|
Tercio@7
|
1060
|
|
Tercio@7
|
1061 if (not f.StampersPhase and not just_refresh) then
|
|
Tercio@7
|
1062 f:StartTracking()
|
|
Tercio@7
|
1063 f:StartTrackPlayerPosition()
|
|
Tercio@7
|
1064 end
|
|
Tercio@10
|
1065
|
|
Tercio@7
|
1066 end
|
|
Tercio@7
|
1067
|
|
Tercio@7
|
1068 if (not db.FRAME_LOCK) then
|
|
Tercio@7
|
1069 player_bar.grip:Show()
|
|
Tercio@7
|
1070 else
|
|
Tercio@7
|
1071 player_bar.grip:Hide()
|
|
Tercio@5
|
1072 end
|
|
Tercio@5
|
1073 end
|
|
Tercio@5
|
1074
|
|
Tercio@0
|
1075 function f:CreateWindow()
|
|
Tercio@0
|
1076 local x = 0
|
|
Tercio@0
|
1077 local y = 0
|
|
Tercio@0
|
1078
|
|
Tercio@0
|
1079 f.player_loc_box = frame_event:CreateTexture (nil, "overlay")
|
|
Tercio@0
|
1080 f.player_loc_box:SetSize (32, 40)
|
|
Tercio@0
|
1081 f.player_loc_box:SetTexture ([[Interface\ContainerFrame\UI-Icon-QuestBorder]])
|
|
Tercio@0
|
1082 f.player_loc_box:Hide()
|
|
Tercio@0
|
1083
|
|
Tercio@0
|
1084 f.all_blocks = {}
|
|
Tercio@0
|
1085
|
|
Tercio@0
|
1086 for i = 1, 20 do
|
|
Tercio@0
|
1087
|
|
Tercio@0
|
1088 local block = CreateFrame ("frame", "Hansgar_And_Franzok_Assist_Block" .. i, f)
|
|
Tercio@0
|
1089 block:SetSize (30, 38)
|
|
Tercio@0
|
1090 block:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0},
|
|
Tercio@0
|
1091 })
|
|
Tercio@0
|
1092 block:SetBackdropBorderColor (0, 0, 0, 1)
|
|
Tercio@0
|
1093 block:SetBackdropColor (.8, .8, .8, 0.5)
|
|
Tercio@0
|
1094 block:SetPoint ("TopLeft", f, "TopLeft", x, y)
|
|
Tercio@0
|
1095
|
|
Tercio@0
|
1096 block:SetScript ("OnMouseDown", on_mouse_down)
|
|
Tercio@0
|
1097 block:SetScript ("OnMouseUp", on_mouse_up)
|
|
Tercio@0
|
1098
|
|
Tercio@4
|
1099 local cooldown = CreateFrame ("cooldown", "Hansgar_And_Franzok_Assist_BlockCooldown" .. i, block, "CooldownFrameTemplate")
|
|
Tercio@4
|
1100 cooldown:SetAllPoints()
|
|
Tercio@4
|
1101 cooldown:SetFrameLevel (block:GetFrameLevel()+2)
|
|
Tercio@4
|
1102
|
|
Tercio@4
|
1103 if (not db.CD_NUMBER) then
|
|
Tercio@4
|
1104 cooldown:SetHideCountdownNumbers (true)
|
|
Tercio@4
|
1105 cooldown:SetDrawEdge (false)
|
|
Tercio@4
|
1106 end
|
|
Tercio@4
|
1107
|
|
Tercio@4
|
1108 block.cooldown = cooldown
|
|
Tercio@4
|
1109
|
|
Tercio@0
|
1110 block.id = i
|
|
Tercio@0
|
1111
|
|
Tercio@0
|
1112 local number = block:CreateFontString (nil, "artwork", "GameFontHighlight")
|
|
Tercio@0
|
1113 number:SetPoint ("center", block, "center")
|
|
Tercio@0
|
1114 number:SetText (i)
|
|
Tercio@0
|
1115 number:SetTextColor (1, 1, 1, 0.5)
|
|
Tercio@0
|
1116 block.number = number
|
|
Tercio@0
|
1117
|
|
Tercio@0
|
1118 local stamper_icon = block:CreateTexture (nil, "overlay")
|
|
Tercio@0
|
1119 stamper_icon:SetTexture ([[Interface\ICONS\Warrior_talent_icon_LambsToTheSlaughter]])
|
|
Tercio@0
|
1120 stamper_icon:SetTexCoord (4/64, 60/64, 4/64, 60/64)
|
|
Tercio@0
|
1121 stamper_icon:SetSize (24, 24)
|
|
Tercio@0
|
1122 stamper_icon:SetPoint ("center", block, "center")
|
|
Tercio@0
|
1123 stamper_icon:Hide()
|
|
Tercio@0
|
1124 block.stamper_icon = stamper_icon
|
|
Tercio@0
|
1125
|
|
Tercio@0
|
1126 x = x + 31
|
|
Tercio@0
|
1127 if (x >= 155) then
|
|
Tercio@0
|
1128 x = 0
|
|
Tercio@0
|
1129 y = y - 40
|
|
Tercio@0
|
1130 end
|
|
Tercio@0
|
1131
|
|
Tercio@0
|
1132 tinsert (f.all_blocks, block)
|
|
Tercio@0
|
1133
|
|
Tercio@0
|
1134 end
|
|
Tercio@0
|
1135
|
|
Tercio@7
|
1136 f:SetLockState (true)
|
|
Tercio@5
|
1137
|
|
Tercio@0
|
1138 f.frames_built = true
|
|
Tercio@0
|
1139
|
|
Tercio@0
|
1140 end
|
|
Tercio@0
|
1141
|
|
Tercio@4
|
1142 local safe_track = {
|
|
Tercio@4
|
1143 --space 1
|
|
Tercio@4
|
1144 {
|
|
Tercio@4
|
1145 block = {x1 = 0.50154542922974, x2 = 0.49563668874741},
|
|
Tercio@8
|
1146 left = {x1 = 0.49963343143463, x2 = 0.49963343143463 - 0.000624573974608},
|
|
Tercio@8
|
1147 right = {x1 = 0.49710285663605, x2 = 0.49710285663605 + 0.000992229919432},
|
|
Tercio@4
|
1148 -- {x1 = 0.49963343143463, y1 = 0.73492467403412} -- {x1 = 0.49710285663605, y1 = 0.74445152282715}
|
|
Tercio@4
|
1149 },
|
|
Tercio@4
|
1150 --space 2
|
|
Tercio@4
|
1151 {
|
|
Tercio@4
|
1152 block = {x1 = 0.4858917593956, x2 = 0.48044270277023},
|
|
Tercio@4
|
1153 left = {x1 = 0.48433673381805, x2 = 0.48433673381805 - 0.00091059207916},
|
|
Tercio@4
|
1154 right = {x1 = 0.48206025362015, x2 = 0.48206025362015 + 0.00075059207916},
|
|
Tercio@4
|
1155 -- {x1 = 0.48433673381805, y1 = 0.74292266368866} -- {x1 = 0.48206025362015, y1 = 0.78930181264877}
|
|
Tercio@4
|
1156 },
|
|
Tercio@4
|
1157 --space 3
|
|
Tercio@4
|
1158 {
|
|
Tercio@4
|
1159 block = {x1 = 0.47047740221024, x2 = 0.4648859500885},
|
|
Tercio@8
|
1160 left = {x1 = 0.46893924474716, x2 = 0.46893924474716 - 0.000902948493956},
|
|
Tercio@8
|
1161 right = {x1 = 0.46635687351227, x2 = 0.46635687351227 + 0.000970948493956},
|
|
Tercio@4
|
1162 --{x1 = 0.46893924474716, y1 = 0.7981019616127} -- {x1 = 0.46635687351227, y1 = 0.73558133840561}
|
|
Tercio@4
|
1163 },
|
|
Tercio@4
|
1164 --space 4
|
|
Tercio@4
|
1165 {
|
|
Tercio@4
|
1166 block = {x1 = 0.45503282546997, x2 = 0.44976264238358},
|
|
Tercio@8
|
1167 left = {x1 = 0.4533554315567, x2 = 0.4533554315567 - 0.000714573974608},
|
|
Tercio@4
|
1168 right = {x1 = 0.45124399662018, x2 = 0.45124399662018 + 0.000770009999999},
|
|
Tercio@4
|
1169 --{x1 = 0.4533554315567, y1 = 0.74078941345215} -- {x1 = 0.45124399662018, y1 = 0.74088287353516}
|
|
Tercio@4
|
1170 }
|
|
Tercio@4
|
1171 }
|
|
Tercio@4
|
1172 Hansgar_safe_track = safe_track
|
|
Tercio@4
|
1173
|
|
Tercio@4
|
1174 -- /hansgar test
|
|
Tercio@8
|
1175 -- /run Hansgar_safe_track [4].left.x2 = 0.4533554315567 - 0.000714573974608
|
|
Tercio@4
|
1176
|
|
Tercio@7
|
1177 local red_alpha_disabled = 0.2
|
|
Tercio@4
|
1178 local red_alpha_enabled = 0.5
|
|
Tercio@4
|
1179
|
|
Tercio@4
|
1180 local green_alpha_disabled = 0.05
|
|
Tercio@4
|
1181 local green_alpha_enabled = 0.9
|
|
Tercio@4
|
1182
|
|
Tercio@13
|
1183 function f:ChangeDanceBar (facing)
|
|
Tercio@13
|
1184
|
|
Tercio@13
|
1185 if (facing == 1 or facing == 2) then --> north or south
|
|
Tercio@13
|
1186 t1_2:Hide()
|
|
Tercio@13
|
1187 t2_2:Hide()
|
|
Tercio@13
|
1188 t3_2:Hide()
|
|
Tercio@13
|
1189 t4_2:Hide()
|
|
Tercio@13
|
1190 middle_2:Hide()
|
|
Tercio@13
|
1191 t1:Show()
|
|
Tercio@13
|
1192 t2:Show()
|
|
Tercio@13
|
1193 t3:Show()
|
|
Tercio@13
|
1194 t4:Show()
|
|
Tercio@13
|
1195 middle:Show()
|
|
Tercio@13
|
1196
|
|
Tercio@13
|
1197 player_pos_frame2:Hide()
|
|
Tercio@13
|
1198 player_pos_frame:SetBackdropColor (0, 0, 0, 1)
|
|
Tercio@13
|
1199
|
|
Tercio@13
|
1200 elseif (facing == 3 or facing == 4) then --> west or east
|
|
Tercio@13
|
1201 t1_2:Show()
|
|
Tercio@13
|
1202 t2_2:Show()
|
|
Tercio@13
|
1203 t3_2:Show()
|
|
Tercio@13
|
1204 t4_2:Show()
|
|
Tercio@13
|
1205 middle_2:Show()
|
|
Tercio@13
|
1206 t1:Hide()
|
|
Tercio@13
|
1207 t2:Hide()
|
|
Tercio@13
|
1208 t3:Hide()
|
|
Tercio@13
|
1209 t4:Hide()
|
|
Tercio@13
|
1210 middle:Hide()
|
|
Tercio@13
|
1211
|
|
Tercio@13
|
1212 player_pos_frame:SetBackdropColor (0, 0, 0, 0)
|
|
Tercio@13
|
1213 player_pos_frame2:Show()
|
|
Tercio@13
|
1214
|
|
Tercio@13
|
1215 end
|
|
Tercio@13
|
1216
|
|
Tercio@13
|
1217 end
|
|
Tercio@13
|
1218
|
|
Tercio@4
|
1219 local track_function = function (self, elapsed)
|
|
Tercio@6
|
1220
|
|
Tercio@4
|
1221 local x, _ = GetPlayerMapPosition ("player")
|
|
Tercio@4
|
1222 local block
|
|
Tercio@4
|
1223
|
|
Tercio@6
|
1224 if (db.AUTO_FACING and x) then
|
|
Tercio@14
|
1225
|
|
Tercio@6
|
1226 local facing = GetPlayerFacing()
|
|
Tercio@14
|
1227 local current = self.facing
|
|
Tercio@6
|
1228
|
|
Tercio@14
|
1229 if (db.NO_VERTICAL) then
|
|
Tercio@14
|
1230 -- get 2 direction in radians
|
|
Tercio@14
|
1231 if (current ~= 1 and (facing > 5.3 or facing < 1.053)) then --north -> south -- ~30º tolerance
|
|
Tercio@14
|
1232 --print ("south")
|
|
Tercio@14
|
1233 self.facing = 1
|
|
Tercio@14
|
1234 elseif (current ~= 2 and (facing > 2.3 and facing < 4.3)) then
|
|
Tercio@14
|
1235 --print ("north")
|
|
Tercio@14
|
1236 self.facing = 2
|
|
Tercio@14
|
1237 end
|
|
Tercio@14
|
1238 else
|
|
Tercio@14
|
1239 -- get 4 directions in radians
|
|
Tercio@14
|
1240 if (facing < 0.7 or facing > 5.6) then --north
|
|
Tercio@14
|
1241 --print ("north")
|
|
Tercio@14
|
1242 self.facing = 1
|
|
Tercio@14
|
1243 elseif (facing >= 0.7 and facing < 2.45) then --west
|
|
Tercio@14
|
1244 --print ("west")
|
|
Tercio@14
|
1245 self.facing = 3
|
|
Tercio@14
|
1246 elseif (facing > 2.45 and facing < 3.85) then --south
|
|
Tercio@14
|
1247 --print ("south")
|
|
Tercio@14
|
1248 self.facing = 2
|
|
Tercio@14
|
1249 elseif (facing >= 3.85 and facing <= 5.6) then --east
|
|
Tercio@14
|
1250 --print ("east")
|
|
Tercio@14
|
1251 self.facing = 4
|
|
Tercio@14
|
1252 end
|
|
Tercio@6
|
1253 end
|
|
Tercio@13
|
1254
|
|
Tercio@13
|
1255 if (current ~= self.facing) then
|
|
Tercio@13
|
1256 f:ChangeDanceBar (self.facing)
|
|
Tercio@13
|
1257 end
|
|
Tercio@13
|
1258
|
|
Tercio@6
|
1259 end
|
|
Tercio@6
|
1260
|
|
Tercio@6
|
1261 if (x) then
|
|
Tercio@6
|
1262 for i = 1, #safe_track do
|
|
Tercio@6
|
1263 local loc = safe_track [i]
|
|
Tercio@6
|
1264 if (x >= loc.block.x2 and x <= loc.block.x1) then
|
|
Tercio@6
|
1265 block = i
|
|
Tercio@6
|
1266 break
|
|
Tercio@6
|
1267 end
|
|
Tercio@4
|
1268 end
|
|
Tercio@4
|
1269 end
|
|
Tercio@4
|
1270
|
|
Tercio@6
|
1271 if (block and safe_track [block]) then
|
|
Tercio@4
|
1272
|
|
Tercio@4
|
1273 player_pos_frame:Show()
|
|
Tercio@4
|
1274 block = safe_track [block]
|
|
Tercio@4
|
1275
|
|
Tercio@13
|
1276 if (self.facing == 3 or self.facing == 4) then --> west
|
|
Tercio@13
|
1277 player_pos_frame2:Show()
|
|
Tercio@13
|
1278 end
|
|
Tercio@13
|
1279
|
|
Tercio@4
|
1280 if (x >= block.left.x2 and x <= block.left.x1) then
|
|
Tercio@13
|
1281 if (self.facing == 2) then --> south
|
|
Tercio@6
|
1282 t2:SetTexture (0.1, 1, 0.1, green_alpha_enabled)
|
|
Tercio@6
|
1283 t3:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1284 elseif (self.facing == 1) then --> north
|
|
Tercio@6
|
1285 t3:SetTexture (0.2, 232/255, 1, green_alpha_enabled)
|
|
Tercio@6
|
1286 t2:SetTexture (0.2, 232/255, 1, green_alpha_disabled)
|
|
Tercio@13
|
1287 elseif (self.facing == 3) then --> west
|
|
Tercio@13
|
1288 t2_2:SetTexture (0.1, 1, 0.1, green_alpha_enabled)
|
|
Tercio@13
|
1289 t3_2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1290 elseif (self.facing == 4) then --> east
|
|
Tercio@13
|
1291 t3_2:SetTexture (0.2, 232/255, 1, green_alpha_enabled)
|
|
Tercio@13
|
1292 t2_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 elseif (x <= block.right.x2 and x >= block.right.x1) then
|
|
Tercio@13
|
1303 if (self.facing == 2) then --> south
|
|
Tercio@6
|
1304 t3:SetTexture (0.1, 1, 0.1, green_alpha_enabled)
|
|
Tercio@6
|
1305 t2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1306 elseif (self.facing == 1) then --> north
|
|
Tercio@6
|
1307 t2:SetTexture (0.2, 232/255, 1, green_alpha_enabled)
|
|
Tercio@6
|
1308 t3:SetTexture (0.2, 232/255, 1, green_alpha_disabled)
|
|
Tercio@13
|
1309 elseif (self.facing == 3) then --> west
|
|
Tercio@13
|
1310 t3_2:SetTexture (0.1, 1, 0.1, green_alpha_enabled)
|
|
Tercio@13
|
1311 t2_2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1312 elseif (self.facing == 4) then --> east
|
|
Tercio@13
|
1313 t2_2:SetTexture (0.2, 232/255, 1, green_alpha_enabled)
|
|
Tercio@13
|
1314 t3_2:SetTexture (0.2, 232/255, 1, green_alpha_disabled)
|
|
Tercio@6
|
1315 end
|
|
Tercio@4
|
1316
|
|
Tercio@4
|
1317 t1:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1318 t4:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1319 middle:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1320 t1_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1321 t4_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1322 middle_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1323
|
|
Tercio@4
|
1324 else
|
|
Tercio@4
|
1325 t1:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@4
|
1326 t4:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@4
|
1327 middle:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@13
|
1328 t1_2:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@13
|
1329 t4_2:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@13
|
1330 middle_2:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@4
|
1331
|
|
Tercio@4
|
1332 t2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@4
|
1333 t3:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1334 t2_2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1335 t3_2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@4
|
1336
|
|
Tercio@4
|
1337 end
|
|
Tercio@4
|
1338
|
|
Tercio@4
|
1339 --x = x - block.block.x2
|
|
Tercio@4
|
1340 --local at = abs ((x / (block.block.x1 - block.block.x2) * 100) - 100)
|
|
Tercio@4
|
1341 --div:SetPoint ("left", player_pos_frame, "left", self.width_pixel * at, 0)
|
|
Tercio@4
|
1342
|
|
Tercio@4
|
1343 else
|
|
Tercio@9
|
1344 if (f.unlocked_frame) then
|
|
Tercio@9
|
1345 player_pos_frame:Show()
|
|
Tercio@9
|
1346 else
|
|
Tercio@9
|
1347 player_pos_frame:Hide()
|
|
Tercio@13
|
1348 player_pos_frame2:Hide()
|
|
Tercio@9
|
1349 end
|
|
Tercio@4
|
1350 end
|
|
Tercio@4
|
1351 end
|
|
Tercio@4
|
1352
|
|
Tercio@4
|
1353 function f:StartTrackPlayerPosition()
|
|
Tercio@4
|
1354 player_pos_frame:Show()
|
|
Tercio@4
|
1355 tframe.width = player_pos_frame:GetWidth()
|
|
Tercio@4
|
1356 tframe.width_pixel = tframe.width / 100
|
|
Tercio@6
|
1357 tframe.facing = db.FACING_SIDE == 1
|
|
Tercio@4
|
1358 tframe:SetScript ("OnUpdate", track_function)
|
|
Tercio@4
|
1359 end
|
|
Tercio@4
|
1360 function f:EndTrackPlayerPosition()
|
|
Tercio@4
|
1361 player_pos_frame:Hide()
|
|
Tercio@13
|
1362 player_pos_frame2:Hide()
|
|
Tercio@4
|
1363 tframe:SetScript ("OnUpdate", nil)
|
|
Tercio@4
|
1364 end
|
|
Tercio@4
|
1365
|
|
Tercio@0
|
1366 local locs = {
|
|
Tercio@0
|
1367 --block 1:
|
|
Tercio@1
|
1368 {x1 = 0.51103663444519, y1 = 0.79726493358612, x2 = 0.50061076879501, y2 = 0.8241291642189},
|
|
Tercio@0
|
1369 --block 2:
|
|
Tercio@1
|
1370 {x1 = 0.49670505523682, y1 = 0.79692482948303, x2 = 0.48469054698944, y2 = 0.82489335536957},
|
|
Tercio@0
|
1371 --block 3:
|
|
Tercio@1
|
1372 {x1 = 0.48130965232849, y1 = 0.79742962121964, x2 = 0.46962946653366, y2 = 0.82453238964081},
|
|
Tercio@0
|
1373 --block 4:
|
|
Tercio@1
|
1374 {x1 = 0.46575212478638, y1 = 0.79766929149628, x2 = 0.45400339365005, y2 = 0.82176661491394},
|
|
Tercio@0
|
1375 --block 5:
|
|
Tercio@1
|
1376 {x1 = 0.45073217153549, y1 = 0.79751670360565, x2 = 0.43945103883743, y2 = 0.82504689693451},
|
|
Tercio@0
|
1377
|
|
Tercio@0
|
1378 --block 6
|
|
Tercio@1
|
1379 {x1 = 0.51104211807251, y1 = 0.76532691717148, x2 = 0.50021582841873, y2 = 0.79546189308167},
|
|
Tercio@1
|
1380 --block 7
|
|
Tercio@1
|
1381 {x1 = 0.4964514374733, y1 = 0.76603573560715, x2 = 0.48449218273163, y2 = 0.79527854919434},
|
|
Tercio@1
|
1382 --block 8
|
|
Tercio@1
|
1383 {x1 = 0.48101079463959, y1 = 0.76503103971481, x2 = 0.46944016218185, y2 = 0.79543298482895},
|
|
Tercio@1
|
1384 --block 9
|
|
Tercio@1
|
1385 {x1 = 0.46541726589203, y1 = 0.7654857635498, x2 = 0.45369201898575, y2 = 0.79529416561127},
|
|
Tercio@1
|
1386 --block 10
|
|
Tercio@1
|
1387 {x1 = 0.45051556825638, y1 = 0.76583826541901, x2 = 0.43931984901428, y2 = 0.79570162296295},
|
|
Tercio@1
|
1388
|
|
Tercio@1
|
1389
|
|
Tercio@1
|
1390 --block 11
|
|
Tercio@0
|
1391 {x1 = 0.51104187965393, y1 = 0.73422884941101, x2 = 0.49990028142929, y2 = 0.76343530416489},
|
|
Tercio@1
|
1392 --block 12
|
|
Tercio@0
|
1393 {x1 = 0.49673527479172, y1 = 0.73338270187378, x2 = 0.48483556509018, y2 = 0.76356953382492},
|
|
Tercio@1
|
1394 --block 13
|
|
Tercio@0
|
1395 {x1 = 0.48133307695389, y1 = 0.73373115062714, x2 = 0.46920585632324, y2 = 0.76366758346558},
|
|
Tercio@1
|
1396 --block 14
|
|
Tercio@0
|
1397 {x1 = 0.46568286418915, y1 = 0.73440700769424, x2 = 0.45381307601929, y2 = 0.76358675956726},
|
|
Tercio@1
|
1398 --block 15
|
|
Tercio@0
|
1399 {x1 = 0.45046973228455, y1 = 0.73361301422119, x2 = 0.43929302692413, y2 = 0.76388084888458},
|
|
Tercio@0
|
1400
|
|
Tercio@0
|
1401 --block 16
|
|
Tercio@1
|
1402 {x1 = 0.51104891300201, y1 = 0.70877063274384, x2 = 0.50024521350861, y2 = 0.73220580816269},
|
|
Tercio@0
|
1403 --block 17
|
|
Tercio@1
|
1404 {x1 = 0.49676024913788, y1 = 0.70914703607559, x2 = 0.48485481739044, y2 = 0.73210543394089},
|
|
Tercio@0
|
1405 --block 18
|
|
Tercio@1
|
1406 {x1 = 0.48142266273499, y1 = 0.70876735448837, x2 = 0.46925610303879, y2 = 0.73205661773682},
|
|
Tercio@0
|
1407 --block 19
|
|
Tercio@1
|
1408 {x1 = 0.46603119373322, y1 = 0.70929777622223, x2 = 0.45397216081619, y2 = 0.73167610168457},
|
|
Tercio@0
|
1409 --block 20
|
|
Tercio@1
|
1410 {x1 = 0.45079308748245, y1 = 0.70926278829575, x2 = 0.43927478790283, y2 = 0.73225915431976},
|
|
Tercio@0
|
1411 }
|
|
Tercio@0
|
1412
|
|
Tercio@0
|
1413 function f:WhichBlock (x, y)
|
|
Tercio@0
|
1414 for i = 1, #locs do
|
|
Tercio@0
|
1415 local loc = locs [i]
|
|
Tercio@0
|
1416 if (x >= loc.x2 and x <= loc.x1 and y >= loc.y1 and y <= loc.y2) then
|
|
Tercio@0
|
1417 return i
|
|
Tercio@0
|
1418 end
|
|
Tercio@0
|
1419 end
|
|
Tercio@0
|
1420 end
|
|
Tercio@0
|
1421
|
|
Tercio@0
|
1422 function f:percent_color (value, inverted)
|
|
Tercio@0
|
1423 local r, g
|
|
Tercio@0
|
1424 if (value < 50) then
|
|
Tercio@0
|
1425 r = 255
|
|
Tercio@0
|
1426 else
|
|
Tercio@0
|
1427 r = floor ( 255 - (value * 2 - 100) * 255 / 100)
|
|
Tercio@0
|
1428 end
|
|
Tercio@0
|
1429
|
|
Tercio@0
|
1430 if (value > 50) then
|
|
Tercio@0
|
1431 g = 255
|
|
Tercio@0
|
1432 else
|
|
Tercio@0
|
1433 g = floor ( (value * 2) * 255 / 100)
|
|
Tercio@0
|
1434 end
|
|
Tercio@0
|
1435
|
|
Tercio@0
|
1436 if (inverted) then
|
|
Tercio@0
|
1437 return g/255, r/255, 0
|
|
Tercio@0
|
1438 else
|
|
Tercio@0
|
1439 return r/255, g/255, 0
|
|
Tercio@0
|
1440 end
|
|
Tercio@0
|
1441 end
|