|
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@5
|
251 f:SendCommMessage ("HAFR", UnitName ("player") .. " " .. 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@0
|
386 print ("|cFFFFAA00Hansgar and Franzok Assist|r: addon enabled, good look!")
|
|
Tercio@0
|
387
|
|
Tercio@0
|
388 if (f.StampersPhase) then
|
|
Tercio@0
|
389 f:StopTracking()
|
|
Tercio@0
|
390 end
|
|
Tercio@0
|
391
|
|
Tercio@0
|
392 elseif (event == "ENCOUNTER_END") then
|
|
Tercio@0
|
393 if (f.StampersPhase) then
|
|
Tercio@0
|
394 f:StopTracking()
|
|
Tercio@0
|
395 end
|
|
Tercio@4
|
396
|
|
Tercio@4
|
397 f:EndTrackPlayerPosition()
|
|
Tercio@0
|
398 end
|
|
Tercio@0
|
399 end
|
|
Tercio@0
|
400 end
|
|
Tercio@0
|
401
|
|
Tercio@0
|
402 end)
|
|
Tercio@0
|
403
|
|
Tercio@6
|
404 SLASH_Hansgar_And_Franzok_Assist1, SLASH_Hansgar_And_Franzok_Assist2 = "/hansgar", "/franzok"
|
|
Tercio@6
|
405 function SlashCmdList.Hansgar_And_Franzok_Assist (msg, editbox)
|
|
Tercio@6
|
406
|
|
Tercio@6
|
407 local command, rest = msg:match ("^(%S*)%s*(.-)$")
|
|
Tercio@6
|
408
|
|
Tercio@6
|
409 if (command == "users") then
|
|
Tercio@6
|
410 if (f.users_schedule) then
|
|
Tercio@6
|
411 print ("|cFFFFAA00Hansgar and Franzok Assist|r please wait 5 seconds...")
|
|
Tercio@6
|
412 elseif (IsInRaid()) then
|
|
Tercio@6
|
413 f.users = {}
|
|
Tercio@6
|
414 f:SendCommMessage ("HAFR", "US", "RAID")
|
|
Tercio@6
|
415 f.users_schedule = f:ScheduleTimer ("ShowUsers", 5)
|
|
Tercio@6
|
416 print ("|cFFFFAA00Hansgar and Franzok Assist|r please wait 5 seconds...")
|
|
Tercio@6
|
417 else
|
|
Tercio@6
|
418 print ("|cFFFFAA00Hansgar and Franzok Assist|r you aren't in a raid group.")
|
|
Tercio@6
|
419 end
|
|
Tercio@6
|
420
|
|
Tercio@10
|
421 elseif (command == "st") then
|
|
Tercio@10
|
422 f.stop_casting_frame:Show()
|
|
Tercio@10
|
423 f.stop_casting_frame.alert.animOut:Stop()
|
|
Tercio@10
|
424 f.stop_casting_frame.alert.animIn:Play()
|
|
Tercio@10
|
425 f:ScheduleTimer ("HideStopSpellAlert", 1.2)
|
|
Tercio@10
|
426
|
|
Tercio@9
|
427 elseif (command == "stopcast") then
|
|
Tercio@9
|
428 db.STOP_CAST = not db.STOP_CAST
|
|
Tercio@9
|
429
|
|
Tercio@9
|
430 if (db.STOP_CAST) then
|
|
Tercio@9
|
431 print ("|cFFFFAA00Hansgar and Franzok Assist|r stop cast alert enabled.")
|
|
Tercio@9
|
432 else
|
|
Tercio@9
|
433 print ("|cFFFFAA00Hansgar and Franzok Assist|r stop cast alert disabled.")
|
|
Tercio@9
|
434 end
|
|
Tercio@9
|
435
|
|
Tercio@9
|
436 elseif (command == "resetpos") then
|
|
Tercio@9
|
437 f:ClearAllPoints()
|
|
Tercio@9
|
438 f:SetPoint ("center", UIParent, "center")
|
|
Tercio@9
|
439
|
|
Tercio@9
|
440 player_bar:ClearAllPoints()
|
|
Tercio@9
|
441 player_bar:SetPoint ("center", UIParent, "center")
|
|
Tercio@9
|
442
|
|
Tercio@9
|
443 player_pos_frame:ClearAllPoints()
|
|
Tercio@9
|
444 player_pos_frame:SetPoint ("center", UIParent, "center")
|
|
Tercio@9
|
445
|
|
Tercio@9
|
446 if (f.StampersPhase) then
|
|
Tercio@9
|
447 f:EndTrackPlayerPosition()
|
|
Tercio@9
|
448 f:StopTracking()
|
|
Tercio@9
|
449 end
|
|
Tercio@9
|
450
|
|
Tercio@9
|
451 db.FRAME_LOCK = true
|
|
Tercio@9
|
452 f:SetLockState()
|
|
Tercio@9
|
453
|
|
Tercio@9
|
454 f.unlocked_frame = true
|
|
Tercio@9
|
455
|
|
Tercio@9
|
456 f:StartTracking()
|
|
Tercio@9
|
457 f:StartTrackPlayerPosition()
|
|
Tercio@9
|
458
|
|
Tercio@9
|
459 print ("|cFFFFAA00Hansgar and Franzok Assist|r: position reseted.")
|
|
Tercio@9
|
460 print ("|cFFFFAA00Hansgar and Franzok Assist|r: move between the tracks to show the other frames.")
|
|
Tercio@9
|
461 print ("|cFFFFAA00Hansgar and Franzok Assist|r: type '/hansgar lock' to lock the frames.")
|
|
Tercio@9
|
462
|
|
Tercio@6
|
463 elseif (command == "delay") then
|
|
Tercio@6
|
464 local t = tonumber (rest)
|
|
Tercio@6
|
465 if (t) then
|
|
Tercio@6
|
466 db.STAMPERS_DELAY = t
|
|
Tercio@6
|
467 print ("|cFFFFAA00Hansgar and Franzok Assist|r delay set to: ", t)
|
|
Tercio@6
|
468 else
|
|
Tercio@6
|
469 print ("|cFFFFAA00Hansgar and Franzok Assist|r invalid time.", t)
|
|
Tercio@6
|
470 end
|
|
Tercio@6
|
471
|
|
Tercio@6
|
472 elseif (command == "test" or command == "show") then
|
|
Tercio@6
|
473 if (f.StampersPhase) then
|
|
Tercio@6
|
474 f:EndTrackPlayerPosition()
|
|
Tercio@6
|
475 return f:StopTracking()
|
|
Tercio@6
|
476 end
|
|
Tercio@6
|
477
|
|
Tercio@6
|
478 f:StartTracking()
|
|
Tercio@6
|
479 f:StartTrackPlayerPosition()
|
|
Tercio@6
|
480
|
|
Tercio@6
|
481 elseif (command == "hide") then
|
|
Tercio@6
|
482 if (f.StampersPhase) then
|
|
Tercio@6
|
483 return f:StopTracking()
|
|
Tercio@6
|
484 end
|
|
Tercio@6
|
485 f:EndTrackPlayerPosition()
|
|
Tercio@6
|
486
|
|
Tercio@7
|
487 elseif (command == "unlock") then
|
|
Tercio@7
|
488 db.FRAME_LOCK = true
|
|
Tercio@7
|
489 f:SetLockState()
|
|
Tercio@7
|
490 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame unlocked.")
|
|
Tercio@9
|
491
|
|
Tercio@9
|
492 f.unlocked_frame = true
|
|
Tercio@9
|
493 player_pos_frame:Show()
|
|
Tercio@9
|
494 player_bar:Show()
|
|
Tercio@10
|
495 f.stop_casting_frame:Show()
|
|
Tercio@7
|
496
|
|
Tercio@6
|
497 elseif (command == "lock") then
|
|
Tercio@6
|
498 f:SetLockState()
|
|
Tercio@6
|
499
|
|
Tercio@6
|
500 if (db.FRAME_LOCK) then
|
|
Tercio@6
|
501 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame locked.")
|
|
Tercio@9
|
502 f.unlocked_frame = false
|
|
Tercio@10
|
503 f.stop_casting_frame:Hide()
|
|
Tercio@6
|
504 else
|
|
Tercio@6
|
505 print ("|cFFFFAA00Hansgar and Franzok Assist|r frame unlocked.")
|
|
Tercio@9
|
506
|
|
Tercio@9
|
507 f.unlocked_frame = true
|
|
Tercio@9
|
508 player_pos_frame:Show()
|
|
Tercio@9
|
509 player_bar:Show()
|
|
Tercio@10
|
510 f.stop_casting_frame:Show()
|
|
Tercio@9
|
511
|
|
Tercio@6
|
512 end
|
|
Tercio@6
|
513
|
|
Tercio@6
|
514 elseif (command == "facing") then
|
|
Tercio@6
|
515 if (rest == "1") then
|
|
Tercio@6
|
516 db.FACING_SIDE = 1
|
|
Tercio@6
|
517 tframe.facing = true
|
|
Tercio@6
|
518 print ("|cFFFFAA00Hansgar and Franzok Assist|r facing set to south.")
|
|
Tercio@6
|
519
|
|
Tercio@6
|
520 elseif (rest == "2") then
|
|
Tercio@6
|
521 db.FACING_SIDE = 2
|
|
Tercio@6
|
522 tframe.facing = false
|
|
Tercio@6
|
523 print ("|cFFFFAA00Hansgar and Franzok Assist|r facing set to north.")
|
|
Tercio@6
|
524
|
|
Tercio@6
|
525 elseif (rest == "auto") then
|
|
Tercio@6
|
526 db.AUTO_FACING = true
|
|
Tercio@6
|
527 print ("|cFFFFAA00Hansgar and Franzok Assist|r auto facing enabled.")
|
|
Tercio@6
|
528
|
|
Tercio@6
|
529 else
|
|
Tercio@6
|
530 print ("|cFFFFFF00/hansgar facing|r: |cFF00FF001|r = south |cFF00FF002|r = north, use to set the dance bar when auto facing is disabled.")
|
|
Tercio@6
|
531 end
|
|
Tercio@6
|
532
|
|
Tercio@6
|
533 elseif (command == "autofacing") then
|
|
Tercio@6
|
534 db.AUTO_FACING = not db.AUTO_FACING
|
|
Tercio@6
|
535 if (db.AUTO_FACING) then
|
|
Tercio@6
|
536 print ("|cFFFFAA00Hansgar and Franzok Assist|r auto facing enabled.")
|
|
Tercio@6
|
537 else
|
|
Tercio@6
|
538 print ("|cFFFFAA00Hansgar and Franzok Assist|r auto facing disabled.")
|
|
Tercio@6
|
539 tframe.facing = db.FACING_SIDE == 1
|
|
Tercio@6
|
540 end
|
|
Tercio@6
|
541
|
|
Tercio@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@2
|
839 if (token == "SPELL_AURA_APPLIED" and spellid == 162124 and not f.StampersPhase) then
|
|
Tercio@0
|
840 f:StartTracking()
|
|
Tercio@5
|
841 f:EndTrackPlayerPosition()
|
|
Tercio@0
|
842
|
|
Tercio@2
|
843 elseif (token == "SPELL_AURA_REMOVED" and spellid == 162124 and f.StampersPhase) then
|
|
Tercio@0
|
844 f:StopTracking()
|
|
Tercio@5
|
845 if (db.SHOW_DANCE) then
|
|
Tercio@5
|
846 f:StartTrackPlayerPosition()
|
|
Tercio@5
|
847 end
|
|
Tercio@0
|
848
|
|
Tercio@9
|
849 elseif (token == "SPELL_CAST_START" and spellid == 160838 and db.STOP_CAST) then --Disrupting Roar
|
|
Tercio@10
|
850 f.stop_casting_frame:Show()
|
|
Tercio@10
|
851 f.stop_casting_frame.alert.animOut:Stop()
|
|
Tercio@10
|
852 f.stop_casting_frame.alert.animIn:Play()
|
|
Tercio@10
|
853 f:ScheduleTimer ("HideStopSpellAlert", 1.2)
|
|
Tercio@10
|
854
|
|
Tercio@0
|
855 end
|
|
Tercio@9
|
856
|
|
Tercio@9
|
857 if (token == "SPELL_INTERRUPT" and spellid == 160838 and db.STOP_CAST) then
|
|
Tercio@9
|
858 local link = GetSpellLink (buff_type)
|
|
Tercio@9
|
859 print ("Stop Cast Fail:", target_name, link)
|
|
Tercio@9
|
860 end
|
|
Tercio@0
|
861
|
|
Tercio@0
|
862 end)
|
|
Tercio@10
|
863 -- /run Hansgar_And_Franzok_AssistStopCastingAlert.animIn:Play()
|
|
Tercio@0
|
864
|
|
Tercio@9
|
865 --Hansgar_And_Franzok_AssistStopCasting:Show(); Hansgar_And_Franzok_Assist:ScheduleTimer ("HideStopSpellAlert", 1)
|
|
Tercio@9
|
866 --Hansgar_And_Franzok_Assist:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
|
|
Tercio@9
|
867
|
|
Tercio@0
|
868 local frame_tracker = CreateFrame ("frame", "Hansgar_And_Franzok_AssistTracker", UIParent)
|
|
Tercio@0
|
869 local on_update_tracker = function (self, elapsed)
|
|
Tercio@0
|
870
|
|
Tercio@4
|
871 local raid_size = GetNumGroupMembers()
|
|
Tercio@4
|
872
|
|
Tercio@4
|
873 for i = 1, raid_size do
|
|
Tercio@0
|
874 local x, y = GetPlayerMapPosition ("raid"..i)
|
|
Tercio@0
|
875 if (UnitExists ("raid"..i) and UnitHealth ("raid"..i) > 1 and x and y) then
|
|
Tercio@0
|
876 local block = f:WhichBlock (x, y)
|
|
Tercio@0
|
877 if (block) then
|
|
Tercio@0
|
878 if (not f.block_tracker [block]) then --> was a clear block
|
|
Tercio@0
|
879 f.block_tracker [block] = GetTime()
|
|
Tercio@0
|
880 f:Paint (f.all_blocks [block])
|
|
Tercio@0
|
881 end
|
|
Tercio@0
|
882 end
|
|
Tercio@0
|
883 end
|
|
Tercio@0
|
884 end
|
|
Tercio@0
|
885
|
|
Tercio@0
|
886 local px, py = GetPlayerMapPosition ("player")
|
|
Tercio@0
|
887 local player_block = f:WhichBlock (px, py)
|
|
Tercio@6
|
888 if (player_block and f.block_tracker [player_block] and raid_size > 0) then
|
|
Tercio@0
|
889
|
|
Tercio@0
|
890 local time_limit_at = f.block_tracker [player_block] + db.STAMPERS_DELAY
|
|
Tercio@0
|
891 local time_now = GetTime()
|
|
Tercio@0
|
892
|
|
Tercio@7
|
893 local timeleft = time_limit_at - time_now
|
|
Tercio@7
|
894 f.player_bar:SetValue ((timeleft) / db.STAMPERS_DELAY * 100)
|
|
Tercio@7
|
895 if (timeleft > 0) then
|
|
Tercio@7
|
896 f.player_bar.text:SetText (format ("%.1f", timeleft))
|
|
Tercio@7
|
897 else
|
|
Tercio@7
|
898 f.player_bar.text:SetText ("Move!")
|
|
Tercio@7
|
899 end
|
|
Tercio@0
|
900 f.player_bar:Show()
|
|
Tercio@7
|
901
|
|
Tercio@0
|
902 local block_frame = f.all_blocks [player_block]
|
|
Tercio@0
|
903 f.player_loc_box:SetPoint ("center", block_frame, "center")
|
|
Tercio@0
|
904 f.player_loc_box:Show()
|
|
Tercio@7
|
905
|
|
Tercio@0
|
906 else
|
|
Tercio@9
|
907 if (f.unlocked_frame) then
|
|
Tercio@9
|
908 f.player_loc_box:Show()
|
|
Tercio@9
|
909 f.player_bar:Show()
|
|
Tercio@9
|
910 f.player_bar:SetValue (100)
|
|
Tercio@9
|
911 else
|
|
Tercio@9
|
912 f.player_loc_box:Hide()
|
|
Tercio@9
|
913 f.player_bar:Hide()
|
|
Tercio@9
|
914 end
|
|
Tercio@0
|
915 end
|
|
Tercio@0
|
916 end
|
|
Tercio@0
|
917
|
|
Tercio@0
|
918 function f:StartTracking()
|
|
Tercio@0
|
919
|
|
Tercio@0
|
920 print ("|cFFFFAA00Hansgar and Franzok Assist|r: Smart Stampers phase started.")
|
|
Tercio@0
|
921
|
|
Tercio@0
|
922 f.StampersPhase = true
|
|
Tercio@0
|
923
|
|
Tercio@0
|
924 if (not f.frames_built) then
|
|
Tercio@0
|
925 f:CreateWindow()
|
|
Tercio@0
|
926 end
|
|
Tercio@7
|
927
|
|
Tercio@0
|
928 f:ResetBlocks()
|
|
Tercio@0
|
929 f.player_loc_box:Hide()
|
|
Tercio@0
|
930
|
|
Tercio@0
|
931 f.block_tracker = f.block_tracker or {}
|
|
Tercio@0
|
932 table.wipe (f.block_tracker)
|
|
Tercio@7
|
933
|
|
Tercio@0
|
934 SetMapToCurrentZone()
|
|
Tercio@7
|
935
|
|
Tercio@0
|
936 frame_tracker:SetScript ("OnUpdate", on_update_tracker)
|
|
Tercio@0
|
937 f:Show()
|
|
Tercio@7
|
938 f.player_bar:Show()
|
|
Tercio@7
|
939
|
|
Tercio@0
|
940 end
|
|
Tercio@0
|
941
|
|
Tercio@0
|
942 function f:StopTracking()
|
|
Tercio@0
|
943 print ("|cFFFFAA00Hansgar and Franzok Assist|r: Smart Stampers phase ended.")
|
|
Tercio@0
|
944
|
|
Tercio@0
|
945 f.StampersPhase = false
|
|
Tercio@0
|
946 frame_tracker:SetScript ("OnUpdate", nil)
|
|
Tercio@0
|
947 table.wipe (f.block_tracker)
|
|
Tercio@0
|
948 f.player_loc_box:Hide()
|
|
Tercio@0
|
949 f:Hide()
|
|
Tercio@7
|
950 f.player_bar:SetValue (0)
|
|
Tercio@7
|
951 f.player_bar:Hide()
|
|
Tercio@0
|
952 end
|
|
Tercio@0
|
953
|
|
Tercio@0
|
954 local on_mouse_down = function (self)
|
|
Tercio@5
|
955 if (not self.isMoving and not db.FRAME_LOCK) then
|
|
Tercio@0
|
956 self.isMoving = true
|
|
Tercio@0
|
957 f:StartMoving()
|
|
Tercio@0
|
958 end
|
|
Tercio@0
|
959 end
|
|
Tercio@0
|
960 local on_mouse_up = function (self)
|
|
Tercio@0
|
961 if (self.isMoving) then
|
|
Tercio@0
|
962 self.isMoving = nil
|
|
Tercio@0
|
963 f:StopMovingOrSizing()
|
|
Tercio@0
|
964 end
|
|
Tercio@0
|
965 end
|
|
Tercio@0
|
966
|
|
Tercio@0
|
967 local painting = function (self, elapsed)
|
|
Tercio@0
|
968 self.step = self.step + elapsed
|
|
Tercio@0
|
969 self.total_time = self.total_time + elapsed
|
|
Tercio@0
|
970
|
|
Tercio@0
|
971 if (self.step > 0.2) then
|
|
Tercio@0
|
972 self.step = 0
|
|
Tercio@0
|
973 local percent = self.total_time / db.STAMPERS_DELAY * 100
|
|
Tercio@0
|
974
|
|
Tercio@0
|
975 percent = min (percent, 100)
|
|
Tercio@0
|
976
|
|
Tercio@0
|
977 local r, g, b = f:percent_color (percent, true)
|
|
Tercio@0
|
978 self:SetBackdropColor (r, g, b, 0.5)
|
|
Tercio@0
|
979
|
|
Tercio@0
|
980 self.number:SetText (floor (percent) .. "%")
|
|
Tercio@0
|
981 self.number:SetTextColor (1, 1, 1, 1)
|
|
Tercio@0
|
982
|
|
Tercio@0
|
983 if (percent == 100) then
|
|
Tercio@0
|
984 self:SetScript ("OnUpdate", nil)
|
|
Tercio@0
|
985 self.stamper_icon:Show()
|
|
Tercio@0
|
986 self.number:Hide()
|
|
Tercio@5
|
987 self.cooldown:Show()
|
|
Tercio@4
|
988 self.cooldown:SetCooldown (GetTime(), 37 - db.STAMPERS_DELAY, 0, 0)
|
|
Tercio@0
|
989 end
|
|
Tercio@0
|
990 end
|
|
Tercio@0
|
991 end
|
|
Tercio@4
|
992
|
|
Tercio@4
|
993 function f:UnPaint (block)
|
|
Tercio@4
|
994 f:ResetBlock (block)
|
|
Tercio@4
|
995 end
|
|
Tercio@0
|
996 function f:Paint (block)
|
|
Tercio@0
|
997 block.step = 0
|
|
Tercio@0
|
998 block.total_time = 0
|
|
Tercio@0
|
999 block:SetScript ("OnUpdate", painting)
|
|
Tercio@4
|
1000 local unpaint = f:ScheduleTimer ("UnPaint", 37, block)
|
|
Tercio@4
|
1001 block.unpaint_process = unpaint
|
|
Tercio@4
|
1002 end
|
|
Tercio@4
|
1003
|
|
Tercio@4
|
1004 function f:ResetBlock (block)
|
|
Tercio@4
|
1005 block:SetScript ("OnUpdate", nil)
|
|
Tercio@4
|
1006 block:SetBackdropColor (.8, .8, .8, 0.5)
|
|
Tercio@4
|
1007 block.number:SetText (block.id)
|
|
Tercio@4
|
1008 block.number:SetTextColor (1, 1, 1, 0.5)
|
|
Tercio@4
|
1009 block.number:Show()
|
|
Tercio@4
|
1010 block.stamper_icon:Hide()
|
|
Tercio@4
|
1011 block.cooldown:SetCooldown (0, 0, 0, 0)
|
|
Tercio@5
|
1012 block.cooldown:Hide()
|
|
Tercio@4
|
1013
|
|
Tercio@4
|
1014 f.block_tracker [block.id] = nil
|
|
Tercio@4
|
1015 if (block.unpaint_process) then
|
|
Tercio@4
|
1016 f:CancelTimer (block.unpaint_process)
|
|
Tercio@4
|
1017 block.unpaint_process = nil
|
|
Tercio@4
|
1018 end
|
|
Tercio@0
|
1019 end
|
|
Tercio@0
|
1020
|
|
Tercio@0
|
1021 function f:ResetBlocks()
|
|
Tercio@0
|
1022 for _, block in ipairs (f.all_blocks) do
|
|
Tercio@4
|
1023 f:ResetBlock (block)
|
|
Tercio@4
|
1024 end
|
|
Tercio@4
|
1025 end
|
|
Tercio@4
|
1026
|
|
Tercio@4
|
1027 function f:RefreshCooldownSettings()
|
|
Tercio@4
|
1028 for _, block in ipairs (f.all_blocks) do
|
|
Tercio@4
|
1029 if (not db.CD_NUMBER) then
|
|
Tercio@4
|
1030 block.cooldown:SetHideCountdownNumbers (true)
|
|
Tercio@4
|
1031 block.cooldown:SetDrawEdge (false)
|
|
Tercio@4
|
1032 else
|
|
Tercio@4
|
1033 block.cooldown:SetHideCountdownNumbers (false)
|
|
Tercio@4
|
1034 block.cooldown:SetDrawEdge (true)
|
|
Tercio@4
|
1035 end
|
|
Tercio@0
|
1036 end
|
|
Tercio@0
|
1037 end
|
|
Tercio@0
|
1038
|
|
Tercio@16
|
1039 function f:SetDanceBarSize (size)
|
|
Tercio@36
|
1040 if (not db.DANCE_SIZE) then
|
|
Tercio@37
|
1041 db.DANCE_SIZE = 8
|
|
Tercio@36
|
1042 end
|
|
Tercio@16
|
1043 if (not size) then
|
|
Tercio@16
|
1044 size = db.DANCE_SIZE
|
|
Tercio@16
|
1045 end
|
|
Tercio@16
|
1046 db.DANCE_SIZE = size
|
|
Tercio@16
|
1047
|
|
Tercio@16
|
1048 t1:SetSize (player_pos_frame:GetWidth()*0.30, size)
|
|
Tercio@16
|
1049 t2:SetSize (player_pos_frame:GetWidth()*0.15, size)
|
|
Tercio@16
|
1050 middle:SetSize (player_pos_frame:GetWidth()*0.10, size)
|
|
Tercio@16
|
1051 t3:SetSize (player_pos_frame:GetWidth()*0.15, size)
|
|
Tercio@16
|
1052 t4:SetSize (player_pos_frame:GetWidth()*0.30, size)
|
|
Tercio@16
|
1053
|
|
Tercio@16
|
1054 t1_2:SetSize (size, player_pos_frame:GetWidth()*0.30)
|
|
Tercio@16
|
1055 t2_2:SetSize (size, player_pos_frame:GetWidth()*0.15)
|
|
Tercio@16
|
1056 middle_2:SetSize (size, player_pos_frame:GetWidth()*0.10)
|
|
Tercio@16
|
1057 t3_2:SetSize (size, player_pos_frame:GetWidth()*0.15)
|
|
Tercio@16
|
1058 t4_2:SetSize (size, player_pos_frame:GetWidth()*0.30)
|
|
Tercio@16
|
1059
|
|
Tercio@16
|
1060 player_pos_frame2:SetSize (size, 155)
|
|
Tercio@16
|
1061 player_pos_frame:SetSize (155, size)
|
|
Tercio@16
|
1062 end
|
|
Tercio@16
|
1063
|
|
Tercio@7
|
1064 function f:SetLockState (just_refresh)
|
|
Tercio@7
|
1065
|
|
Tercio@7
|
1066 if (not just_refresh) then
|
|
Tercio@7
|
1067 db.FRAME_LOCK = not db.FRAME_LOCK
|
|
Tercio@7
|
1068 end
|
|
Tercio@7
|
1069
|
|
Tercio@5
|
1070 if (db.FRAME_LOCK) then
|
|
Tercio@5
|
1071 --locked
|
|
Tercio@5
|
1072 f:EnableMouse (false)
|
|
Tercio@7
|
1073 player_bar:EnableMouse (false)
|
|
Tercio@7
|
1074 player_pos_frame:EnableMouse (false)
|
|
Tercio@10
|
1075 stop_casting_frame:SetMovable (false)
|
|
Tercio@10
|
1076 stop_casting_frame:EnableMouse (false)
|
|
Tercio@7
|
1077
|
|
Tercio@5
|
1078 for _, block in ipairs (f.all_blocks) do
|
|
Tercio@5
|
1079 block:EnableMouse (false)
|
|
Tercio@5
|
1080 end
|
|
Tercio@7
|
1081
|
|
Tercio@7
|
1082 if (f.StampersPhase and not just_refresh) then
|
|
Tercio@7
|
1083 f:EndTrackPlayerPosition()
|
|
Tercio@7
|
1084 f:StopTracking()
|
|
Tercio@7
|
1085 end
|
|
Tercio@10
|
1086
|
|
Tercio@5
|
1087 else
|
|
Tercio@5
|
1088 --unlocked
|
|
Tercio@5
|
1089 f:EnableMouse (true)
|
|
Tercio@7
|
1090 player_bar:EnableMouse (true)
|
|
Tercio@7
|
1091 player_pos_frame:EnableMouse (true)
|
|
Tercio@10
|
1092 stop_casting_frame:SetMovable (true)
|
|
Tercio@10
|
1093 stop_casting_frame:EnableMouse (true)
|
|
Tercio@7
|
1094
|
|
Tercio@5
|
1095 for _, block in ipairs (f.all_blocks) do
|
|
Tercio@5
|
1096 block:EnableMouse (true)
|
|
Tercio@5
|
1097 end
|
|
Tercio@7
|
1098
|
|
Tercio@7
|
1099 if (not f.StampersPhase and not just_refresh) then
|
|
Tercio@7
|
1100 f:StartTracking()
|
|
Tercio@7
|
1101 f:StartTrackPlayerPosition()
|
|
Tercio@7
|
1102 end
|
|
Tercio@10
|
1103
|
|
Tercio@7
|
1104 end
|
|
Tercio@7
|
1105
|
|
Tercio@7
|
1106 if (not db.FRAME_LOCK) then
|
|
Tercio@7
|
1107 player_bar.grip:Show()
|
|
Tercio@7
|
1108 else
|
|
Tercio@7
|
1109 player_bar.grip:Hide()
|
|
Tercio@5
|
1110 end
|
|
Tercio@5
|
1111 end
|
|
Tercio@5
|
1112
|
|
Tercio@0
|
1113 function f:CreateWindow()
|
|
Tercio@0
|
1114 local x = 0
|
|
Tercio@0
|
1115 local y = 0
|
|
Tercio@0
|
1116
|
|
Tercio@0
|
1117 f.player_loc_box = frame_event:CreateTexture (nil, "overlay")
|
|
Tercio@0
|
1118 f.player_loc_box:SetSize (32, 40)
|
|
Tercio@0
|
1119 f.player_loc_box:SetTexture ([[Interface\ContainerFrame\UI-Icon-QuestBorder]])
|
|
Tercio@0
|
1120 f.player_loc_box:Hide()
|
|
Tercio@0
|
1121
|
|
Tercio@0
|
1122 f.all_blocks = {}
|
|
Tercio@0
|
1123
|
|
Tercio@0
|
1124 for i = 1, 20 do
|
|
Tercio@0
|
1125
|
|
Tercio@0
|
1126 local block = CreateFrame ("frame", "Hansgar_And_Franzok_Assist_Block" .. i, f)
|
|
Tercio@0
|
1127 block:SetSize (30, 38)
|
|
Tercio@0
|
1128 block:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0},
|
|
Tercio@0
|
1129 })
|
|
Tercio@0
|
1130 block:SetBackdropBorderColor (0, 0, 0, 1)
|
|
Tercio@0
|
1131 block:SetBackdropColor (.8, .8, .8, 0.5)
|
|
Tercio@0
|
1132 block:SetPoint ("TopLeft", f, "TopLeft", x, y)
|
|
Tercio@0
|
1133
|
|
Tercio@0
|
1134 block:SetScript ("OnMouseDown", on_mouse_down)
|
|
Tercio@0
|
1135 block:SetScript ("OnMouseUp", on_mouse_up)
|
|
Tercio@0
|
1136
|
|
Tercio@4
|
1137 local cooldown = CreateFrame ("cooldown", "Hansgar_And_Franzok_Assist_BlockCooldown" .. i, block, "CooldownFrameTemplate")
|
|
Tercio@4
|
1138 cooldown:SetAllPoints()
|
|
Tercio@4
|
1139 cooldown:SetFrameLevel (block:GetFrameLevel()+2)
|
|
Tercio@4
|
1140
|
|
Tercio@4
|
1141 if (not db.CD_NUMBER) then
|
|
Tercio@4
|
1142 cooldown:SetHideCountdownNumbers (true)
|
|
Tercio@4
|
1143 cooldown:SetDrawEdge (false)
|
|
Tercio@4
|
1144 end
|
|
Tercio@4
|
1145
|
|
Tercio@4
|
1146 block.cooldown = cooldown
|
|
Tercio@4
|
1147
|
|
Tercio@0
|
1148 block.id = i
|
|
Tercio@0
|
1149
|
|
Tercio@0
|
1150 local number = block:CreateFontString (nil, "artwork", "GameFontHighlight")
|
|
Tercio@0
|
1151 number:SetPoint ("center", block, "center")
|
|
Tercio@0
|
1152 number:SetText (i)
|
|
Tercio@0
|
1153 number:SetTextColor (1, 1, 1, 0.5)
|
|
Tercio@0
|
1154 block.number = number
|
|
Tercio@0
|
1155
|
|
Tercio@0
|
1156 local stamper_icon = block:CreateTexture (nil, "overlay")
|
|
Tercio@0
|
1157 stamper_icon:SetTexture ([[Interface\ICONS\Warrior_talent_icon_LambsToTheSlaughter]])
|
|
Tercioo@31
|
1158 stamper_icon:SetTexCoord (5/64, 59/64, 5/64, 59/64)
|
|
Tercioo@31
|
1159 stamper_icon:SetSize (23, 23)
|
|
Tercio@0
|
1160 stamper_icon:SetPoint ("center", block, "center")
|
|
Tercio@0
|
1161 stamper_icon:Hide()
|
|
Tercio@0
|
1162 block.stamper_icon = stamper_icon
|
|
Tercio@0
|
1163
|
|
Tercio@0
|
1164 x = x + 31
|
|
Tercio@0
|
1165 if (x >= 155) then
|
|
Tercio@0
|
1166 x = 0
|
|
Tercio@0
|
1167 y = y - 40
|
|
Tercio@0
|
1168 end
|
|
Tercio@0
|
1169
|
|
Tercio@0
|
1170 tinsert (f.all_blocks, block)
|
|
Tercio@0
|
1171
|
|
Tercio@0
|
1172 end
|
|
Tercio@0
|
1173
|
|
Tercio@7
|
1174 f:SetLockState (true)
|
|
Tercio@5
|
1175
|
|
Tercio@0
|
1176 f.frames_built = true
|
|
Tercio@0
|
1177
|
|
Tercio@16
|
1178 f:SetDanceBarSize()
|
|
Tercio@0
|
1179 end
|
|
Tercio@0
|
1180
|
|
Tercio@4
|
1181 local safe_track = {
|
|
Tercio@4
|
1182 --space 1
|
|
Tercio@4
|
1183 {
|
|
Tercio@4
|
1184 block = {x1 = 0.50154542922974, x2 = 0.49563668874741},
|
|
Tercio@8
|
1185 left = {x1 = 0.49963343143463, x2 = 0.49963343143463 - 0.000624573974608},
|
|
Tercio@8
|
1186 right = {x1 = 0.49710285663605, x2 = 0.49710285663605 + 0.000992229919432},
|
|
Tercio@4
|
1187 -- {x1 = 0.49963343143463, y1 = 0.73492467403412} -- {x1 = 0.49710285663605, y1 = 0.74445152282715}
|
|
Tercio@4
|
1188 },
|
|
Tercio@4
|
1189 --space 2
|
|
Tercio@4
|
1190 {
|
|
Tercio@4
|
1191 block = {x1 = 0.4858917593956, x2 = 0.48044270277023},
|
|
Tercio@4
|
1192 left = {x1 = 0.48433673381805, x2 = 0.48433673381805 - 0.00091059207916},
|
|
Tercio@4
|
1193 right = {x1 = 0.48206025362015, x2 = 0.48206025362015 + 0.00075059207916},
|
|
Tercio@4
|
1194 -- {x1 = 0.48433673381805, y1 = 0.74292266368866} -- {x1 = 0.48206025362015, y1 = 0.78930181264877}
|
|
Tercio@4
|
1195 },
|
|
Tercio@4
|
1196 --space 3
|
|
Tercio@4
|
1197 {
|
|
Tercio@4
|
1198 block = {x1 = 0.47047740221024, x2 = 0.4648859500885},
|
|
Tercio@8
|
1199 left = {x1 = 0.46893924474716, x2 = 0.46893924474716 - 0.000902948493956},
|
|
Tercio@8
|
1200 right = {x1 = 0.46635687351227, x2 = 0.46635687351227 + 0.000970948493956},
|
|
Tercio@4
|
1201 --{x1 = 0.46893924474716, y1 = 0.7981019616127} -- {x1 = 0.46635687351227, y1 = 0.73558133840561}
|
|
Tercio@4
|
1202 },
|
|
Tercio@4
|
1203 --space 4
|
|
Tercio@4
|
1204 {
|
|
Tercio@4
|
1205 block = {x1 = 0.45503282546997, x2 = 0.44976264238358},
|
|
Tercio@8
|
1206 left = {x1 = 0.4533554315567, x2 = 0.4533554315567 - 0.000714573974608},
|
|
Tercio@4
|
1207 right = {x1 = 0.45124399662018, x2 = 0.45124399662018 + 0.000770009999999},
|
|
Tercio@4
|
1208 --{x1 = 0.4533554315567, y1 = 0.74078941345215} -- {x1 = 0.45124399662018, y1 = 0.74088287353516}
|
|
Tercio@4
|
1209 }
|
|
Tercio@4
|
1210 }
|
|
Tercio@4
|
1211 Hansgar_safe_track = safe_track
|
|
Tercio@4
|
1212
|
|
Tercio@4
|
1213 -- /hansgar test
|
|
Tercio@8
|
1214 -- /run Hansgar_safe_track [4].left.x2 = 0.4533554315567 - 0.000714573974608
|
|
Tercio@4
|
1215
|
|
Tercio@7
|
1216 local red_alpha_disabled = 0.2
|
|
Tercio@4
|
1217 local red_alpha_enabled = 0.5
|
|
Tercio@4
|
1218
|
|
Tercio@4
|
1219 local green_alpha_disabled = 0.05
|
|
Tercio@4
|
1220 local green_alpha_enabled = 0.9
|
|
Tercio@4
|
1221
|
|
Tercio@13
|
1222 function f:ChangeDanceBar (facing)
|
|
Tercio@13
|
1223
|
|
Tercio@13
|
1224 if (facing == 1 or facing == 2) then --> north or south
|
|
Tercio@13
|
1225 t1_2:Hide()
|
|
Tercio@13
|
1226 t2_2:Hide()
|
|
Tercio@13
|
1227 t3_2:Hide()
|
|
Tercio@13
|
1228 t4_2:Hide()
|
|
Tercio@13
|
1229 middle_2:Hide()
|
|
Tercio@13
|
1230 t1:Show()
|
|
Tercio@13
|
1231 t2:Show()
|
|
Tercio@13
|
1232 t3:Show()
|
|
Tercio@13
|
1233 t4:Show()
|
|
Tercio@13
|
1234 middle:Show()
|
|
Tercio@13
|
1235
|
|
Tercio@13
|
1236 player_pos_frame2:Hide()
|
|
Tercio@13
|
1237 player_pos_frame:SetBackdropColor (0, 0, 0, 1)
|
|
Tercio@13
|
1238
|
|
Tercio@13
|
1239 elseif (facing == 3 or facing == 4) then --> west or east
|
|
Tercio@13
|
1240 t1_2:Show()
|
|
Tercio@13
|
1241 t2_2:Show()
|
|
Tercio@13
|
1242 t3_2:Show()
|
|
Tercio@13
|
1243 t4_2:Show()
|
|
Tercio@13
|
1244 middle_2:Show()
|
|
Tercio@13
|
1245 t1:Hide()
|
|
Tercio@13
|
1246 t2:Hide()
|
|
Tercio@13
|
1247 t3:Hide()
|
|
Tercio@13
|
1248 t4:Hide()
|
|
Tercio@13
|
1249 middle:Hide()
|
|
Tercio@13
|
1250
|
|
Tercio@13
|
1251 player_pos_frame:SetBackdropColor (0, 0, 0, 0)
|
|
Tercio@13
|
1252 player_pos_frame2:Show()
|
|
Tercio@13
|
1253
|
|
Tercio@13
|
1254 end
|
|
Tercio@13
|
1255
|
|
Tercio@13
|
1256 end
|
|
Tercio@13
|
1257
|
|
Tercio@4
|
1258 local track_function = function (self, elapsed)
|
|
Tercio@6
|
1259
|
|
Tercio@4
|
1260 local x, _ = GetPlayerMapPosition ("player")
|
|
Tercio@4
|
1261 local block
|
|
Tercio@4
|
1262
|
|
Tercio@6
|
1263 if (db.AUTO_FACING and x) then
|
|
Tercio@14
|
1264
|
|
Tercio@6
|
1265 local facing = GetPlayerFacing()
|
|
Tercio@14
|
1266 local current = self.facing
|
|
Tercio@6
|
1267
|
|
Tercio@14
|
1268 if (db.NO_VERTICAL) then
|
|
Tercio@14
|
1269 -- get 2 direction in radians
|
|
Tercio@14
|
1270 if (current ~= 1 and (facing > 5.3 or facing < 1.053)) then --north -> south -- ~30º tolerance
|
|
Tercio@14
|
1271 --print ("south")
|
|
Tercio@14
|
1272 self.facing = 1
|
|
Tercio@14
|
1273 elseif (current ~= 2 and (facing > 2.3 and facing < 4.3)) then
|
|
Tercio@14
|
1274 --print ("north")
|
|
Tercio@14
|
1275 self.facing = 2
|
|
Tercio@14
|
1276 end
|
|
Tercio@14
|
1277 else
|
|
Tercio@14
|
1278 -- get 4 directions in radians
|
|
Tercio@14
|
1279 if (facing < 0.7 or facing > 5.6) then --north
|
|
Tercio@14
|
1280 --print ("north")
|
|
Tercio@14
|
1281 self.facing = 1
|
|
Tercio@14
|
1282 elseif (facing >= 0.7 and facing < 2.45) then --west
|
|
Tercio@14
|
1283 --print ("west")
|
|
Tercio@14
|
1284 self.facing = 3
|
|
Tercio@14
|
1285 elseif (facing > 2.45 and facing < 3.85) then --south
|
|
Tercio@14
|
1286 --print ("south")
|
|
Tercio@14
|
1287 self.facing = 2
|
|
Tercio@14
|
1288 elseif (facing >= 3.85 and facing <= 5.6) then --east
|
|
Tercio@14
|
1289 --print ("east")
|
|
Tercio@14
|
1290 self.facing = 4
|
|
Tercio@14
|
1291 end
|
|
Tercio@6
|
1292 end
|
|
Tercio@13
|
1293
|
|
Tercio@13
|
1294 if (current ~= self.facing) then
|
|
Tercio@13
|
1295 f:ChangeDanceBar (self.facing)
|
|
Tercio@13
|
1296 end
|
|
Tercio@13
|
1297
|
|
Tercio@6
|
1298 end
|
|
Tercio@6
|
1299
|
|
Tercio@6
|
1300 if (x) then
|
|
Tercio@6
|
1301 for i = 1, #safe_track do
|
|
Tercio@6
|
1302 local loc = safe_track [i]
|
|
Tercio@6
|
1303 if (x >= loc.block.x2 and x <= loc.block.x1) then
|
|
Tercio@6
|
1304 block = i
|
|
Tercio@6
|
1305 break
|
|
Tercio@6
|
1306 end
|
|
Tercio@4
|
1307 end
|
|
Tercio@4
|
1308 end
|
|
Tercio@4
|
1309
|
|
Tercio@6
|
1310 if (block and safe_track [block]) then
|
|
Tercio@4
|
1311
|
|
Tercio@4
|
1312 player_pos_frame:Show()
|
|
Tercio@4
|
1313 block = safe_track [block]
|
|
Tercio@4
|
1314
|
|
Tercio@13
|
1315 if (self.facing == 3 or self.facing == 4) then --> west
|
|
Tercio@13
|
1316 player_pos_frame2:Show()
|
|
Tercio@13
|
1317 end
|
|
Tercio@13
|
1318
|
|
Tercio@4
|
1319 if (x >= block.left.x2 and x <= block.left.x1) then
|
|
Tercio@13
|
1320 if (self.facing == 2) then --> south
|
|
Tercio@6
|
1321 t2:SetTexture (0.1, 1, 0.1, green_alpha_enabled)
|
|
Tercio@6
|
1322 t3:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1323 elseif (self.facing == 1) then --> north
|
|
Tercio@6
|
1324 t3:SetTexture (0.2, 232/255, 1, green_alpha_enabled)
|
|
Tercio@6
|
1325 t2:SetTexture (0.2, 232/255, 1, green_alpha_disabled)
|
|
Tercio@13
|
1326 elseif (self.facing == 3) then --> west
|
|
Tercio@13
|
1327 t2_2:SetTexture (0.1, 1, 0.1, green_alpha_enabled)
|
|
Tercio@13
|
1328 t3_2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1329 elseif (self.facing == 4) then --> east
|
|
Tercio@13
|
1330 t3_2:SetTexture (0.2, 232/255, 1, green_alpha_enabled)
|
|
Tercio@13
|
1331 t2_2:SetTexture (0.2, 232/255, 1, green_alpha_disabled)
|
|
Tercio@6
|
1332 end
|
|
Tercio@4
|
1333
|
|
Tercio@4
|
1334 t1:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1335 t4:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1336 middle:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1337 t1_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1338 t4_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1339 middle_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1340
|
|
Tercio@4
|
1341 elseif (x <= block.right.x2 and x >= block.right.x1) then
|
|
Tercio@13
|
1342 if (self.facing == 2) then --> south
|
|
Tercio@6
|
1343 t3:SetTexture (0.1, 1, 0.1, green_alpha_enabled)
|
|
Tercio@6
|
1344 t2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1345 elseif (self.facing == 1) then --> north
|
|
Tercio@6
|
1346 t2:SetTexture (0.2, 232/255, 1, green_alpha_enabled)
|
|
Tercio@6
|
1347 t3:SetTexture (0.2, 232/255, 1, green_alpha_disabled)
|
|
Tercio@13
|
1348 elseif (self.facing == 3) then --> west
|
|
Tercio@13
|
1349 t3_2:SetTexture (0.1, 1, 0.1, green_alpha_enabled)
|
|
Tercio@13
|
1350 t2_2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1351 elseif (self.facing == 4) then --> east
|
|
Tercio@13
|
1352 t2_2:SetTexture (0.2, 232/255, 1, green_alpha_enabled)
|
|
Tercio@13
|
1353 t3_2:SetTexture (0.2, 232/255, 1, green_alpha_disabled)
|
|
Tercio@6
|
1354 end
|
|
Tercio@4
|
1355
|
|
Tercio@4
|
1356 t1:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1357 t4:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1358 middle:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1359 t1_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1360 t4_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@13
|
1361 middle_2:SetVertexColor (1, 0.2, 0.2, red_alpha_disabled) --red
|
|
Tercio@4
|
1362
|
|
Tercio@4
|
1363 else
|
|
Tercio@4
|
1364 t1:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@4
|
1365 t4:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@4
|
1366 middle:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@13
|
1367 t1_2:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@13
|
1368 t4_2:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@13
|
1369 middle_2:SetVertexColor (1, 0.2, 0.2, red_alpha_enabled) --red
|
|
Tercio@4
|
1370
|
|
Tercio@4
|
1371 t2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@4
|
1372 t3:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1373 t2_2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@13
|
1374 t3_2:SetTexture (0.2, 1, 0.2, green_alpha_disabled)
|
|
Tercio@4
|
1375
|
|
Tercio@4
|
1376 end
|
|
Tercio@4
|
1377
|
|
Tercio@4
|
1378 --x = x - block.block.x2
|
|
Tercio@4
|
1379 --local at = abs ((x / (block.block.x1 - block.block.x2) * 100) - 100)
|
|
Tercio@4
|
1380 --div:SetPoint ("left", player_pos_frame, "left", self.width_pixel * at, 0)
|
|
Tercio@4
|
1381
|
|
Tercio@4
|
1382 else
|
|
Tercio@9
|
1383 if (f.unlocked_frame) then
|
|
Tercio@9
|
1384 player_pos_frame:Show()
|
|
Tercio@9
|
1385 else
|
|
Tercio@9
|
1386 player_pos_frame:Hide()
|
|
Tercio@13
|
1387 player_pos_frame2:Hide()
|
|
Tercio@9
|
1388 end
|
|
Tercio@4
|
1389 end
|
|
Tercio@4
|
1390 end
|
|
Tercio@4
|
1391
|
|
Tercio@4
|
1392 function f:StartTrackPlayerPosition()
|
|
Tercio@4
|
1393 player_pos_frame:Show()
|
|
Tercio@4
|
1394 tframe.width = player_pos_frame:GetWidth()
|
|
Tercio@4
|
1395 tframe.width_pixel = tframe.width / 100
|
|
Tercio@6
|
1396 tframe.facing = db.FACING_SIDE == 1
|
|
Tercio@4
|
1397 tframe:SetScript ("OnUpdate", track_function)
|
|
Tercio@4
|
1398 end
|
|
Tercio@4
|
1399 function f:EndTrackPlayerPosition()
|
|
Tercio@4
|
1400 player_pos_frame:Hide()
|
|
Tercio@13
|
1401 player_pos_frame2:Hide()
|
|
Tercio@4
|
1402 tframe:SetScript ("OnUpdate", nil)
|
|
Tercio@4
|
1403 end
|
|
Tercio@4
|
1404
|
|
Tercio@0
|
1405 local locs = {
|
|
Tercio@0
|
1406 --block 1:
|
|
Tercio@34
|
1407 {x1 = 0.51103663544519, y1 = 0.79726493458612, x2 = 0.50061076879501, y2 = 0.8241291642189},
|
|
Tercio@0
|
1408 --block 2:
|
|
Tercio@1
|
1409 {x1 = 0.49670505523682, y1 = 0.79692482948303, x2 = 0.48469054698944, y2 = 0.82489335536957},
|
|
Tercio@0
|
1410 --block 3:
|
|
Tercio@1
|
1411 {x1 = 0.48130965232849, y1 = 0.79742962121964, x2 = 0.46962946653366, y2 = 0.82453238964081},
|
|
Tercio@0
|
1412 --block 4:
|
|
Tercio@34
|
1413 {x1 = 0.46575214478638, y1 = 0.79766989149628, x2 = 0.45400339365005, y2 = 0.82176661491394},
|
|
Tercio@0
|
1414 --block 5:
|
|
Tercio@1
|
1415 {x1 = 0.45073217153549, y1 = 0.79751670360565, x2 = 0.43945103883743, y2 = 0.82504689693451},
|
|
Tercio@0
|
1416
|
|
Tercio@0
|
1417 --block 6
|
|
Tercio@1
|
1418 {x1 = 0.51104211807251, y1 = 0.76532691717148, x2 = 0.50021582841873, y2 = 0.79546189308167},
|
|
Tercio@1
|
1419 --block 7
|
|
Tercio@1
|
1420 {x1 = 0.4964514374733, y1 = 0.76603573560715, x2 = 0.48449218273163, y2 = 0.79527854919434},
|
|
Tercio@1
|
1421 --block 8
|
|
Tercio@1
|
1422 {x1 = 0.48101079463959, y1 = 0.76503103971481, x2 = 0.46944016218185, y2 = 0.79543298482895},
|
|
Tercio@1
|
1423 --block 9
|
|
Tercio@1
|
1424 {x1 = 0.46541726589203, y1 = 0.7654857635498, x2 = 0.45369201898575, y2 = 0.79529416561127},
|
|
Tercio@1
|
1425 --block 10
|
|
Tercio@1
|
1426 {x1 = 0.45051556825638, y1 = 0.76583826541901, x2 = 0.43931984901428, y2 = 0.79570162296295},
|
|
Tercio@1
|
1427
|
|
Tercio@1
|
1428
|
|
Tercio@1
|
1429 --block 11
|
|
Tercio@0
|
1430 {x1 = 0.51104187965393, y1 = 0.73422884941101, x2 = 0.49990028142929, y2 = 0.76343530416489},
|
|
Tercio@1
|
1431 --block 12
|
|
Tercio@0
|
1432 {x1 = 0.49673527479172, y1 = 0.73338270187378, x2 = 0.48483556509018, y2 = 0.76356953382492},
|
|
Tercio@1
|
1433 --block 13
|
|
Tercio@0
|
1434 {x1 = 0.48133307695389, y1 = 0.73373115062714, x2 = 0.46920585632324, y2 = 0.76366758346558},
|
|
Tercio@1
|
1435 --block 14
|
|
Tercio@0
|
1436 {x1 = 0.46568286418915, y1 = 0.73440700769424, x2 = 0.45381307601929, y2 = 0.76358675956726},
|
|
Tercio@1
|
1437 --block 15
|
|
Tercio@0
|
1438 {x1 = 0.45046973228455, y1 = 0.73361301422119, x2 = 0.43929302692413, y2 = 0.76388084888458},
|
|
Tercio@0
|
1439
|
|
Tercio@0
|
1440 --block 16
|
|
Tercio@1
|
1441 {x1 = 0.51104891300201, y1 = 0.70877063274384, x2 = 0.50024521350861, y2 = 0.73220580816269},
|
|
Tercio@0
|
1442 --block 17
|
|
Tercio@1
|
1443 {x1 = 0.49676024913788, y1 = 0.70914703607559, x2 = 0.48485481739044, y2 = 0.73210543394089},
|
|
Tercio@0
|
1444 --block 18
|
|
Tercio@1
|
1445 {x1 = 0.48142266273499, y1 = 0.70876735448837, x2 = 0.46925610303879, y2 = 0.73205661773682},
|
|
Tercio@0
|
1446 --block 19
|
|
Tercio@1
|
1447 {x1 = 0.46603119373322, y1 = 0.70929777622223, x2 = 0.45397216081619, y2 = 0.73167610168457},
|
|
Tercio@0
|
1448 --block 20
|
|
Tercio@1
|
1449 {x1 = 0.45079308748245, y1 = 0.70926278829575, x2 = 0.43927478790283, y2 = 0.73225915431976},
|
|
Tercio@0
|
1450 }
|
|
Tercio@0
|
1451
|
|
Tercio@0
|
1452 function f:WhichBlock (x, y)
|
|
Tercio@0
|
1453 for i = 1, #locs do
|
|
Tercio@0
|
1454 local loc = locs [i]
|
|
Tercio@0
|
1455 if (x >= loc.x2 and x <= loc.x1 and y >= loc.y1 and y <= loc.y2) then
|
|
Tercio@0
|
1456 return i
|
|
Tercio@0
|
1457 end
|
|
Tercio@0
|
1458 end
|
|
Tercio@0
|
1459 end
|
|
Tercio@0
|
1460
|
|
Tercio@0
|
1461 function f:percent_color (value, inverted)
|
|
Tercio@0
|
1462 local r, g
|
|
Tercio@0
|
1463 if (value < 50) then
|
|
Tercio@0
|
1464 r = 255
|
|
Tercio@0
|
1465 else
|
|
Tercio@0
|
1466 r = floor ( 255 - (value * 2 - 100) * 255 / 100)
|
|
Tercio@0
|
1467 end
|
|
Tercio@0
|
1468
|
|
Tercio@0
|
1469 if (value > 50) then
|
|
Tercio@0
|
1470 g = 255
|
|
Tercio@0
|
1471 else
|
|
Tercio@0
|
1472 g = floor ( (value * 2) * 255 / 100)
|
|
Tercio@0
|
1473 end
|
|
Tercio@0
|
1474
|
|
Tercio@0
|
1475 if (inverted) then
|
|
Tercio@0
|
1476 return g/255, r/255, 0
|
|
Tercio@0
|
1477 else
|
|
Tercio@0
|
1478 return r/255, g/255, 0
|
|
Tercio@0
|
1479 end
|
|
Tercio@0
|
1480 end
|