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