Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. while debuffNum <= debuffnumber do
  2. local debuffName = UnitDebuff(uid, index, filter)
  3. if ( debuffName ) then
  4. if ( CompactUnitFrame_UtilShouldDisplayDebuff(uid, index, filter) and isDebuff(uid, index, filter) and (not isPriorityDebuff(uid, index, filter) and not isPriorityWarning(uid, index, filter))) then
  5. local debuffFrame = v.debuffFrames[debuffNum]
  6. local name, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, _, spellId;
  7. name, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, _, spellId = UnitDebuff(uid, index, filter);
  8. debuffFrame.filter = filter;
  9. debuffFrame.icon:SetTexture(icon);
  10. debuffFrame.SpellId = spellId
  11. debuffFrame:SetScript("OnEnter", function(self)
  12. GameTooltip:SetOwner (self, "ANCHOR_RIGHT")
  13. GameTooltip:SetSpellByID(self.SpellId)
  14. GameTooltip:Show()
  15. end)
  16. debuffFrame:SetScript("OnLeave", function(self)
  17. GameTooltip:Hide()
  18. end)
  19. if count then
  20. if ( count > 1 ) then
  21. local countText = count;
  22. if ( count >= 100 ) then
  23. countText = BUFF_STACKS_OVERFLOW;
  24. end
  25. debuffFrame.count:Show();
  26. debuffFrame.count:SetText(countText);
  27. else
  28. debuffFrame.count:Hide();
  29. end
  30. end
  31. debuffFrame:SetID(index);
  32. local enabled = expirationTime and expirationTime ~= 0;
  33. if enabled then
  34. local startTime = expirationTime - duration;
  35. CooldownFrame_Set(debuffFrame.cooldown, startTime, duration, true);
  36. else
  37. CooldownFrame_Clear(debuffFrame.cooldown);
  38. end
  39. local color = DebuffTypeColor[debuffType] or DebuffTypeColor["none"];
  40. debuffFrame.border:SetVertexColor(color.r, color.g, color.b);
  41. --debuffFrame.border:Hide()
  42. debuffFrame:SetSize(f.buffFrames[3]:GetSize()*1,f.buffFrames[3]:GetSize()*1);
  43. debuffFrame:Show();
  44. debuffNum = debuffNum + 1
  45. end
  46. else
  47. break
  48. end
  49. index = index + 1
  50. end
  51. for i=debuffNum, debuffnumber do
  52. local debuffFrame = v.debuffFrames[i];
  53. if debuffFrame then
  54. debuffFrame:Hide()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement