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