vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | SatBuff_Version = 11100.01 |
2 | |||
3 | SBFVar = {} |
||
4 | SATBUFF = {} |
||
5 | |||
6 | function SatrinaBuffFrame_OnLoad() |
||
7 | SLASH_SATBUFF1 = "/satbuff" |
||
8 | SlashCmdList["SATBUFF"] = SatrinaBuffFrame_SlashCommands |
||
9 | |||
10 | this:RegisterEvent("VARIABLES_LOADED") |
||
11 | this:RegisterEvent("PLAYER_ENTERING_WORLD") |
||
12 | |||
13 | SATBUFF = { player = UnitName("player") } |
||
14 | end |
||
15 | |||
16 | function SatrinaBuffFrame_SlashCommands(msg) |
||
17 | if (strlower(msg) == "home") then |
||
18 | SatrinaBuffFrame:ClearAllPoints() |
||
19 | SatrinaDebuffFrame:ClearAllPoints() |
||
20 | SatrinaEnchantFrame:ClearAllPoints() |
||
21 | SatrinaEnchantFrame:SetPoint("TOPRIGHT", "UIParent", "TOPRIGHT", -70, -200) |
||
22 | SatrinaBuffFrame:SetPoint("TOPRIGHT", "UIParent", "TOPRIGHT", -65, -240) |
||
23 | SatrinaDebuffFrame:SetPoint("TOPRIGHT", "UIParent", "TOPRIGHT", -110, -240) |
||
24 | else |
||
25 | SatrinaBuffFrame_ShowOptions() |
||
26 | end |
||
27 | end |
||
28 | |||
29 | function SatrinaBuffFrame_OnEvent(event) |
||
30 | if (event == "VARIABLES_LOADED") then |
||
31 | SatrinaBuffFrame_Initialise() |
||
32 | end |
||
33 | |||
34 | if (event == "PLAYER_ENTERING_WORLD") then |
||
35 | SatrinaBuffFrame_DoUIScale() |
||
36 | SatrinaBuffFrame_DoOpacity() |
||
37 | end |
||
38 | end |
||
39 | |||
40 | function SatrinaBuffFrame_Initialise() |
||
41 | default = 1.0 |
||
42 | |||
43 | if not SBFVar["version"] then |
||
44 | SBFVar["version"] = SatBuff_Version |
||
45 | end |
||
46 | |||
47 | if not SBFVar[SATBUFF.player] then |
||
48 | UIErrorsFrame:AddMessage(SBF_NEWPLAYER..SATBUFF.player, 1.0, 1.0, 1.0, 1.0, UIERRORS_HOLD_TIME) |
||
49 | |||
50 | SBFVar[SATBUFF.player] = {} |
||
51 | SBFVar[SATBUFF.player].uiscale = 1 |
||
52 | SBFVar[SATBUFF.player].addonmenu = 1 |
||
53 | end |
||
54 | |||
55 | if (SBFVar["version"] < SatBuff_Version) then |
||
56 | UIErrorsFrame:AddMessage(string.format(SBF_UPDATE, SatBuff_Version), 1.0, 1.0, 1.0, 1.0, UIERRORS_HOLD_TIME) |
||
57 | if (SBFVar["version"] < 11000.02) then |
||
58 | SBFVar[SATBUFF.player].addonmenu = 1 |
||
59 | end |
||
60 | SBFVar["version"] = SatBuff_Version |
||
61 | end |
||
62 | |||
63 | SatrinaBuffFrame_DoSavedVars() |
||
64 | DebuffTypeColor["Curse"] = { r = 1.00, g = 0.40, b = 1.00 }; |
||
65 | DebuffTypeColor["Disease"] = { r = 1.00, g = 1.00, b = 0.25 }; |
||
66 | DebuffTypeColor["Poison"] = { r = 0.00, g = 0.90, b = 0.00 }; |
||
67 | |||
68 | |||
69 | -- Update to current version |
||
70 | if (tonumber(SBFVar["version"]) < tonumber(SatBuff_Version)) then |
||
71 | UIErrorsFrame:AddMessage(SBF_UPDATE..CastProgress_Version, 1.0, 1.0, 1.0, 1.0, UIERRORS_HOLD_TIME) |
||
72 | SBFVar["version"] = SatBuff_Version |
||
73 | end |
||
74 | |||
75 | SatrinaBuffFrame_DisableDefaultBuffFrame() |
||
76 | SatrinaBuffFrame_InitOptions() |
||
77 | end |
||
78 | |||
79 | function SatrinaBuffFrame_BuffButton_OnLoad() |
||
80 | this:RegisterForClicks("RightButtonUp") |
||
81 | this:RegisterEvent("PLAYER_ENTERING_WORLD") |
||
82 | this:RegisterEvent("PLAYER_LEAVING_WORLD") |
||
83 | this.durationText = getglobal(this:GetName().."DurationText") |
||
84 | this.icon = getglobal(this:GetName().."Icon") |
||
85 | this.count = getglobal(this:GetName().."Count") |
||
86 | this.id = this:GetID() |
||
87 | SatrinaBuffFrame_BuffButton_Update() |
||
88 | end |
||
89 | |||
90 | -- |
||
91 | -- Functions that do things with buffs |
||
92 | -- |
||
93 | |||
94 | function SatrinaBuffFrame_BuffButton_OnEvent(event) |
||
95 | if (event == "PLAYER_ENTERING_WORLD") then |
||
96 | this:RegisterEvent("PLAYER_AURAS_CHANGED") |
||
97 | return |
||
98 | end |
||
99 | |||
100 | if (event == "PLAYER_LEAVING_WORLD") then |
||
101 | this:UnregisterEvent("PLAYER_AURAS_CHANGED") |
||
102 | return |
||
103 | end |
||
104 | |||
105 | -- Auras changed |
||
106 | if not SATBUFF.showingOptions then |
||
107 | SatrinaBuffFrame_BuffButton_Update() |
||
108 | end |
||
109 | end |
||
110 | |||
111 | function SatrinaBuffFrame_ParseBuffTooltip(buff) |
||
112 | if SATBUFF.player then |
||
113 | SBFTooltip:SetOwner(UIParent,"ANCHOR_NONE") |
||
114 | SBFTooltip:SetPlayerBuff(buff.index) |
||
115 | local name = SBFTooltipTextLeft1:GetText() |
||
116 | local t1 = SBFVar["spells"][name] |
||
117 | local t2 = math.ceil(GetPlayerBuffTimeLeft(buff.index) / 60) |
||
118 | if not t1 or (t2 > t1) then |
||
119 | if (t2 > 2.9) then |
||
120 | SBFVar["spells"][name] = t2 |
||
121 | end |
||
122 | t1 = t2 |
||
123 | end |
||
124 | buff.name = name |
||
125 | buff.warnExpire = (not SBFVar[SATBUFF.player].longBuff) or (t1 >= SBFVar[SATBUFF.player].warnTime) |
||
126 | end |
||
127 | end |
||
128 | |||
129 | function SatrinaBuffFrame_BuffButton_Update(button) |
||
130 | if not button then |
||
131 | button = this |
||
132 | end |
||
133 | local buffIndex, untilCancelled = GetPlayerBuff(button.id, button.buffFilter) |
||
134 | |||
135 | if (buffIndex >= 0) and not ((buffIndex > 16) and SATBUFF.player and not SBFVar[SATBUFF.player].sixteenBuffs) then |
||
136 | button.index = buffIndex |
||
137 | button.untilCancelled = untilCancelled |
||
138 | if (untilCancelled == 1) then |
||
139 | button.durationText:Hide() |
||
140 | else |
||
141 | button.durationText:Show() |
||
142 | end |
||
143 | if (button.buffFilter == "HELPFUL") then |
||
144 | SatrinaBuffFrame_ParseBuffTooltip(button) |
||
145 | end |
||
146 | if (button.buffFilter == "HARMFUL") then |
||
147 | -- Set color of debuff border based on dispel class. |
||
148 | local color |
||
149 | button.debuffType = GetPlayerBuffDispelType(GetPlayerBuff(this:GetID(), HARMFUL)) |
||
150 | local debuffSlot = getglobal(button:GetName().."Border") |
||
151 | if button.debuffType then |
||
152 | color = DebuffTypeColor[button.debuffType] |
||
153 | else |
||
154 | color = DebuffTypeColor["none"] |
||
155 | end |
||
156 | if debuffSlot then |
||
157 | debuffSlot:SetVertexColor(color.r, color.g, color.b) |
||
158 | end |
||
159 | |||
160 | local count = GetPlayerBuffApplications(buffIndex) |
||
161 | if (count > 1) then |
||
162 | button.count:SetText(count) |
||
163 | button.count:Show() |
||
164 | else |
||
165 | button.count:Hide() |
||
166 | end |
||
167 | end |
||
168 | button.icon:SetTexture(GetPlayerBuffTexture(buffIndex)) |
||
169 | |||
170 | if GameTooltip:IsOwned(button) then |
||
171 | GameTooltip:SetPlayerBuff(buffIndex) |
||
172 | end |
||
173 | UpdateBuffTime(button) |
||
174 | button.updateTime = 0 |
||
175 | button:Show() |
||
176 | else |
||
177 | button.buffIndex = nil |
||
178 | button:Hide() |
||
179 | return |
||
180 | end |
||
181 | end |
||
182 | |||
183 | function SatrinaBuffFrame_BuffButton_OnUpdate(elapsed) |
||
184 | if not SATBUFF.showingOptions then |
||
185 | if (this.updateTime < 0.95) then |
||
186 | this.updateTime = this.updateTime + elapsed |
||
187 | else |
||
188 | this.updateTime = 0 |
||
189 | UpdateBuffTime(this) |
||
190 | end |
||
191 | end |
||
192 | end |
||
193 | |||
194 | function SatrinaBuffFrame_OnEnchantUpdate(elapsed) |
||
195 | if not SATBUFF.showingOptions then |
||
196 | if (this.updateTime < 0.95) then |
||
197 | this.updateTime = this.updateTime + elapsed |
||
198 | else |
||
199 | this.updateTime = 0 |
||
200 | |||
201 | local hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges = GetWeaponEnchantInfo() |
||
202 | if not hasMainHandEnchant and not hasOffHandEnchant then |
||
203 | SatrinaEnchant1:Hide() |
||
204 | SatrinaEnchant2:Hide() |
||
205 | return |
||
206 | end |
||
207 | |||
208 | if hasMainHandEnchant then |
||
209 | textureName = GetInventoryItemTexture("player", 16) |
||
210 | SatrinaEnchant1Icon:SetTexture(textureName) |
||
211 | SatrinaEnchant1:Show() |
||
212 | SatrinaEnchant1DurationText:SetText(SatrinaBuffFrame_GetTimeString(mainHandExpiration/1000)) |
||
213 | else |
||
214 | SatrinaEnchant1:Hide() |
||
215 | return |
||
216 | end |
||
217 | |||
218 | if hasOffHandEnchant then |
||
219 | textureName = GetInventoryItemTexture("player", 17) |
||
220 | SatrinaEnchant2Icon:SetTexture(textureName) |
||
221 | SatrinaEnchant2:Show() |
||
222 | SatrinaEnchant2DurationText:SetText(SatrinaBuffFrame_GetTimeString(offHandExpiration/1000)) |
||
223 | else |
||
224 | SatrinaEnchant2:Hide() |
||
225 | return |
||
226 | end |
||
227 | end |
||
228 | end |
||
229 | end |
||
230 | |||
231 | function UpdateBuffTime(buff) |
||
232 | if not buff then |
||
233 | buff = this |
||
234 | end |
||
235 | if (buff.untilCancelled == 0) or not buff.untilCancelled then |
||
236 | timeLeft = GetPlayerBuffTimeLeft(buff.index) |
||
237 | buff.durationText:SetText(SatrinaBuffFrame_GetTimeString(timeLeft)) |
||
238 | if (buff.buffFilter == "HELPFUL") then |
||
239 | if (timeLeft <= 30) then |
||
240 | buff.durationText:SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b) |
||
241 | else |
||
242 | buff.warnedT = nil |
||
243 | buff.warnedS = nil |
||
244 | buff.durationText:SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b) |
||
245 | end |
||
246 | if SATBUFF.player and SBFVar[SATBUFF.player].textWarning and (floor(timeLeft) == 30) then |
||
247 | if buff.warnExpire and not buff.warnedT then |
||
248 | DEFAULT_CHAT_FRAME:AddMessage("|cff00ff00"..buff.name..SBF_BUFFEXPIRE) |
||
249 | buff.warnedT = 1 |
||
250 | end |
||
251 | end |
||
252 | if SATBUFF.player and SBFVar[SATBUFF.player].soundWarning and (floor(timeLeft) == 30) then |
||
253 | if buff.warnExpire and not buff.warnedS then |
||
254 | PlaySoundFile(SATBUFF.sounds[SBFVar[SATBUFF.player].sound]) |
||
255 | buff.warnedS = 1 |
||
256 | end |
||
257 | end |
||
258 | else |
||
259 | if buff.debuffType then |
||
260 | buff.durationText:SetVertexColor(DebuffTypeColor[buff.debuffType].r, DebuffTypeColor[buff.debuffType].g, DebuffTypeColor[buff.debuffType].b) |
||
261 | else |
||
262 | buff.durationText:SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b) |
||
263 | end |
||
264 | end |
||
265 | end |
||
266 | end |
||
267 | |||
268 | function SatrinaBuffFrame_BuffButton_OnClick() |
||
269 | if not SATBUFF.showingOptions then |
||
270 | CancelPlayerBuff(this.index) |
||
271 | else |
||
272 | ChatFrame1:AddMessage("Click index "..this.index) |
||
273 | end |
||
274 | end |
||
275 | |||
276 | -- |
||
277 | -- Support Functions |
||
278 | -- |
||
279 | |||
280 | function SatrinaBuffFrame_GetTimeString(timeLeft) |
||
281 | if (timeLeft == 0) then |
||
282 | return nil |
||
283 | end |
||
284 | |||
285 | local timeStr = "" |
||
286 | local minutes = 0 |
||
287 | local seconds = 0 |
||
288 | |||
289 | minutes = floor(timeLeft/60) |
||
290 | seconds = floor(timeLeft - (minutes * 60)) |
||
291 | if SBFVar[SATBUFF.player] and SBFVar[SATBUFF.player].blizzardTimers then |
||
292 | timestr = SecondsToTimeAbbrev(timeLeft) |
||
293 | else |
||
294 | timestr = string.format("%02d:%02d", minutes, seconds) |
||
295 | end |
||
296 | return timestr |
||
297 | end |
||
298 | |||
299 | oldBuffFrame_Enchant_OnUpdate = BuffFrame_Enchant_OnUpdate |
||
300 | function BuffFrame_Enchant_OnUpdate() |
||
301 | end |
||
302 | |||
303 | function SatrinaBuffFrame_OnEnchantLoad() |
||
304 | this.updateTime = 1 |
||
305 | end |
||
306 | |||
307 | function SatrinaBuffFrame_DisableDefaultBuffFrame() |
||
308 | -- Unregister default buff frame events |
||
309 | for i=0,23 do |
||
310 | button = getglobal("BuffButton"..i) |
||
311 | button:RegisterForClicks() |
||
312 | button:UnregisterEvent("PLAYER_AURAS_CHANGED") |
||
313 | button:Hide() |
||
314 | end |
||
315 | |||
316 | for i=1,2 do |
||
317 | button = getglobal("TempEnchant"..i) |
||
318 | button:RegisterForClicks() |
||
319 | button:UnregisterEvent("PLAYER_AURAS_CHANGED") |
||
320 | button:Hide() |
||
321 | end |
||
322 | end |
||
323 | |||
324 | -- |
||
325 | -- Functions that do scaling |
||
326 | -- |
||
327 | |||
328 | function SatrinaBuffFrame_ScaleBuffs() |
||
329 | for i=1,20 do |
||
330 | getglobal("SatrinaBuffButton"..i):SetScale(SBFVar[SATBUFF.player].iconScale["Buff"]) |
||
331 | getglobal("SatrinaBuffButton"..i.."Duration"):SetScale(SBFVar[SATBUFF.player].textScale["Buff"]) |
||
332 | end |
||
333 | for i=1,16 do |
||
334 | getglobal("SatrinaDebuffButton"..i):SetScale(SBFVar[SATBUFF.player].iconScale["Debuff"]) |
||
335 | getglobal("SatrinaDebuffButton"..i.."Duration"):SetScale(SBFVar[SATBUFF.player].textScale["Debuff"]) |
||
336 | end |
||
337 | SatrinaEnchant1:SetScale(SBFVar[SATBUFF.player].iconScale["Enchant"]) |
||
338 | SatrinaEnchant1Duration:SetScale(SBFVar[SATBUFF.player].textScale["Enchant"]) |
||
339 | SatrinaEnchant2:SetScale(SBFVar[SATBUFF.player].iconScale["Enchant"]) |
||
340 | SatrinaEnchant2Duration:SetScale(SBFVar[SATBUFF.player].textScale["Enchant"]) |
||
341 | SatrinaBuffFrame_ScaleFrames() |
||
342 | end |
||
343 | |||
344 | function SatrinaBuffFrame_DoOpacity() |
||
345 | SatrinaBuffFrame:SetAlpha(SBFVar[SATBUFF.player].opacity["Buff"]) |
||
346 | SatrinaDebuffFrame:SetAlpha(SBFVar[SATBUFF.player].opacity["Debuff"]) |
||
347 | SatrinaEnchantFrame:SetAlpha(SBFVar[SATBUFF.player].opacity["Enchant"]) |
||
348 | end |
||
349 | |||
350 | function SatrinaBuffFrame_DoUIScale() |
||
351 | if SBFVar[SATBUFF.player].uiscale then |
||
352 | local scale = 1.0 |
||
353 | SBFVar[SATBUFF.player].iconScale["Buff"] = scale |
||
354 | SBFVar[SATBUFF.player].iconScale["Debuff"] = scale |
||
355 | SBFVar[SATBUFF.player].iconScale["Enchant"] = scale |
||
356 | SBFVar[SATBUFF.player].textScale["Buff"] = scale |
||
357 | SBFVar[SATBUFF.player].textScale["Debuff"] = scale |
||
358 | SBFVar[SATBUFF.player].textScale["Enchant"] = scale |
||
359 | |||
360 | OptionsFrame_DisableSlider(SatrinaBuffScaleSlider) |
||
361 | OptionsFrame_DisableSlider(SatrinaDebuffScaleSlider) |
||
362 | OptionsFrame_DisableSlider(SatrinaEnchantScaleSlider) |
||
363 | OptionsFrame_DisableSlider(SatrinaBuffTextSlider) |
||
364 | OptionsFrame_DisableSlider(SatrinaDebuffTextSlider) |
||
365 | OptionsFrame_DisableSlider(SatrinaEnchantTextSlider) |
||
366 | else |
||
367 | SatrinaBuffScaleSlider:SetValue(SBFVar[SATBUFF.player].iconScale["Buff"]) |
||
368 | SatrinaDebuffScaleSlider:SetValue(SBFVar[SATBUFF.player].iconScale["Debuff"]) |
||
369 | SatrinaEnchantScaleSlider:SetValue(SBFVar[SATBUFF.player].iconScale["Enchant"]) |
||
370 | SatrinaBuffTextSlider:SetValue(SBFVar[SATBUFF.player].textScale["Buff"]) |
||
371 | SatrinaDebuffTextSlider:SetValue(SBFVar[SATBUFF.player].textScale["Debuff"]) |
||
372 | SatrinaEnchantTextSlider:SetValue(SBFVar[SATBUFF.player].textScale["Enchant"]) |
||
373 | OptionsFrame_EnableSlider(SatrinaBuffScaleSlider) |
||
374 | OptionsFrame_EnableSlider(SatrinaDebuffScaleSlider) |
||
375 | OptionsFrame_EnableSlider(SatrinaEnchantScaleSlider) |
||
376 | OptionsFrame_EnableSlider(SatrinaBuffTextSlider) |
||
377 | OptionsFrame_EnableSlider(SatrinaDebuffTextSlider) |
||
378 | OptionsFrame_EnableSlider(SatrinaEnchantTextSlider) |
||
379 | end |
||
380 | SatrinaBuffFrame_ScaleBuffs() |
||
381 | SatrinaBuffFrame_ArrangeIcons("SatrinaBuffFrame") |
||
382 | SatrinaBuffFrame_ArrangeIcons("SatrinaDebuffFrame") |
||
383 | SatrinaBuffFrame_ArrangeEnchantIcons() |
||
384 | end |
||
385 | |||
386 | function SatrinaBuffFrame_ArrangeEnchantIcons() |
||
387 | SatrinaEnchant2:ClearAllPoints() |
||
388 | if SBFVar[SATBUFF.player].verticalEnchants then |
||
389 | SatrinaEnchant2:SetPoint("TOP", "SatrinaEnchant1", "BOTTOM", 0, -20 + SBFVar[SATBUFF.player].spacing["Enchant"]) |
||
390 | else |
||
391 | SatrinaEnchant2:SetPoint("LEFT", "SatrinaEnchant1", "RIGHT", 20 + SBFVar[SATBUFF.player].spacing["Enchant"], 0) |
||
392 | end |
||
393 | end |
||
394 | |||
395 | function SatrinaBuffFrame_ArrangeIcons(frame) |
||
396 | local count = 1 |
||
397 | local isHeader = 1 |
||
398 | local currBuff = 1 |
||
399 | local buff |
||
400 | |||
401 | local button, num, rows, reverse, spacing, bottom |
||
402 | local headerAnchor, buffAnchor, lastbuff, rowCount |
||
403 | |||
404 | if (frame == "SatrinaBuffFrame") then |
||
405 | button = "SatrinaBuffButton" |
||
406 | num = SBFVar[SATBUFF.player].count["Buff"] |
||
407 | rows = SBFVar[SATBUFF.player].buffHorizontal |
||
408 | reverse = SBFVar[SATBUFF.player].reverseBuffs |
||
409 | bottom = SBFVar[SATBUFF.player].bottomBuffs |
||
410 | spacing = SBFVar[SATBUFF.player].spacing["Buff"] |
||
411 | n = (SBFVar[SATBUFF.player].sixteenBuffs and 16) or 20 |
||
412 | else |
||
413 | button = "SatrinaDebuffButton" |
||
414 | num = SBFVar[SATBUFF.player].count["Debuff"] |
||
415 | rows = SBFVar[SATBUFF.player].debuffHorizontal |
||
416 | reverse = SBFVar[SATBUFF.player].reverseDebuffs |
||
417 | bottom = SBFVar[SATBUFF.player].bottomDebuffs |
||
418 | spacing = SBFVar[SATBUFF.player].spacing["Debuff"] |
||
419 | n = 16 |
||
420 | end |
||
421 | rowCount = math.ceil(n/num) |
||
422 | lastBuff = rowCount |
||
423 | |||
424 | if reverse then |
||
425 | if bottom then |
||
426 | headerAnchor = "BOTTOMLEFT" |
||
427 | else |
||
428 | headerAnchor = "TOPLEFT" |
||
429 | end |
||
430 | else |
||
431 | if bottom then |
||
432 | headerAnchor = "BOTTOMRIGHT" |
||
433 | else |
||
434 | headerAnchor = "TOPRIGHT" |
||
435 | end |
||
436 | end |
||
437 | |||
438 | if bottom then |
||
439 | getglobal(frame.."DragTab"):ClearAllPoints() |
||
440 | getglobal(frame.."DragTab"):SetPoint("TOP", frame, "BOTTOM", 0, -15) |
||
441 | else |
||
442 | getglobal(frame.."DragTab"):ClearAllPoints() |
||
443 | getglobal(frame.."DragTab"):SetPoint("BOTTOM", frame, "TOP", 0, 0) |
||
444 | end |
||
445 | |||
446 | while (currBuff <= n) do |
||
447 | buff = getglobal(button..currBuff) |
||
448 | buff:ClearAllPoints() |
||
449 | |||
450 | if isHeader then |
||
451 | local headerSpacing = ((count - 1) * spacing) + ((count -1) * 40) |
||
452 | if rows then |
||
453 | if bottom then |
||
454 | buff:SetPoint(headerAnchor, frame, headerAnchor, 0, headerSpacing) |
||
455 | else |
||
456 | buff:SetPoint(headerAnchor, frame, headerAnchor, 0, headerSpacing * -1) |
||
457 | end |
||
458 | else |
||
459 | if reverse then |
||
460 | buff:SetPoint(headerAnchor, frame, headerAnchor, headerSpacing * -1, 0) |
||
461 | else |
||
462 | buff:SetPoint(headerAnchor, frame, headerAnchor, headerSpacing, 0) |
||
463 | end |
||
464 | end |
||
465 | isHeader = nil |
||
466 | else |
||
467 | if rows then |
||
468 | if reverse then |
||
469 | buff:SetPoint("RIGHT", getglobal(button..currBuff - 1), "LEFT", (-15 - spacing), 0) |
||
470 | else |
||
471 | buff:SetPoint("LEFT", getglobal(button..currBuff - 1), "RIGHT", (15 + spacing), 0) |
||
472 | end |
||
473 | else |
||
474 | if bottom then |
||
475 | buff:SetPoint("BOTTOM", getglobal(button..currBuff - 1), "TOP", 0, (15 + spacing)) |
||
476 | else |
||
477 | buff:SetPoint("TOP", getglobal(button..currBuff - 1), "BOTTOM", 0, (-15 - spacing)) |
||
478 | end |
||
479 | end |
||
480 | end |
||
481 | if (currBuff == lastBuff) then |
||
482 | isHeader = 1 |
||
483 | lastBuff = lastBuff + rowCount |
||
484 | count = count + 1 |
||
485 | end |
||
486 | currBuff = currBuff + 1 |
||
487 | end |
||
488 | SatrinaBuffFrame_ScaleFrames() |
||
489 | end |
||
490 | |||
491 | function SatrinaBuffFrame_ScaleFrames() |
||
492 | end |
||
493 | |||
494 | function SatrinaBuffFrame_OnEnter(buff) |
||
495 | if not SATBUFF.showingOptions then |
||
496 | local x = "RIGHT" |
||
497 | if (this:GetLeft() < UIParent:GetRight()/2) then |
||
498 | x = "LEFT" |
||
499 | end |
||
500 | GameTooltip:SetOwner(this, "ANCHOR_TOP"..x) |
||
501 | if buff then |
||
502 | GameTooltip:SetPlayerBuff(this.index, "HELPFUL") |
||
503 | else |
||
504 | GameTooltip:SetPlayerBuff(this.index, "HARMFUL") |
||
505 | end |
||
506 | end |
||
507 | end |