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