Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 42.68 KB | None | 0 0
  1. local _, class = UnitClass('player')
  2. local playerColor = RAID_CLASS_COLORS[select(2, UnitClass('player'))]
  3.  
  4. local texture = 'Interface\\AddOns\\oUF_Aftermathh\\media\\texture.tga'
  5. local border = 'Interface\\AddOns\\oUF_Aftermathh\\media\\border.tga'
  6. local font = 'Interface\\AddOns\\oUF_Aftermathh\\media\\font.ttf'
  7. local borderbg = 'Interface\\AddOns\\oUF_Aftermathh\\media\\borderBackground.tga'
  8.  
  9. local PowerMiddle = false
  10. local PowerRight = false
  11. local PowerNormal = true
  12.  
  13. local Debuffs = true
  14. local Buffs = true
  15. local DebuffType = true
  16.  
  17. local PvPIcon = false
  18. local Portraits = false
  19.  
  20. local BossFrame = true
  21.  
  22. local CastBars = true
  23. local Safezone = true
  24. local Latency = true
  25. local ClassColor = false
  26.  
  27. local FocusShowInterruptHighlight = true
  28. local TargetShowInterruptHighlight = true
  29.  
  30. local FocusCastBarIcon = true
  31. local TargetCastBarIcon = true
  32.  
  33. local backdrop = {
  34.     bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=],
  35.     insets = {top = -1, left = -1, bottom = -1, right = -1},
  36. }
  37.  
  38. local function UpdateChannelStart(self, event, unit, name, rank, text)
  39.     if (self.Latency) then
  40.         self.Latency:ClearAllPoints()
  41.         self.Latency:SetPoint('LEFT', self, 'BOTTOMLEFT', 1, -1)
  42.  
  43.         local _, _, ms = GetNetStats()
  44.         self.Latency:SetFormattedText('%dms', ms)
  45.     end
  46.  
  47.     if (self.SafeZone) then
  48.         self.SafeZone:SetDrawLayer('ARTWORK')
  49.         self.SafeZone:SetPoint('TOPLEFT', self)
  50.         self.SafeZone:SetPoint('BOTTOMLEFT', self)
  51.     end
  52. end
  53.  
  54. local function UpdateCastStart(self, event, unit, name, rank, text, castid)
  55.     if (self.Latency) then
  56.         self.Latency:ClearAllPoints()
  57.         self.Latency:SetPoint('RIGHT', self, 'BOTTOMRIGHT', -1, 1)
  58.  
  59.         local _, _, ms = GetNetStats()
  60.         self.Latency:SetFormattedText('%dms', ms)
  61.     end
  62.  
  63.     if (self.SafeZone) then
  64.         self.SafeZone:SetDrawLayer('BORDER')
  65.         self.SafeZone:SetPoint('TOPRIGHT', self)
  66.         self.SafeZone:SetPoint('BOTTOMRIGHT', self)
  67.     end
  68. end
  69.  
  70. local menu = function(self)
  71.     local unit = self.unit:sub(1, -2)
  72.     local cunit = self.unit:gsub('(.)', string.upper, 1)
  73.  
  74.     if(unit == 'party' or unit == 'partypet') then
  75.         ToggleDropDownMenu(1, nil, _G['PartyMemberFrame'..self.id..'DropDown'], 'cursor', 0, 0)
  76.     elseif(_G[cunit..'FrameDropDown']) then
  77.         ToggleDropDownMenu(1, nil, _G[cunit..'FrameDropDown'], 'cursor', 0, 0)
  78.     end
  79. end
  80.  
  81. local function ShortenValue(value)
  82.     if(value >= 1e6) then
  83.         return ('%.2fm'):format(value / 1e6):gsub('%.?0+([km])$', '%1')
  84.     elseif(value >= 1e4) then
  85.         return ('%.1fk'):format(value / 1e3):gsub('%.?0+([km])$', '%1')
  86.     else
  87.         return value
  88.     end
  89. end
  90.  
  91. oUF.Tags['Afterpower'] = function(unit)
  92.     local power = UnitPower(unit)
  93.     if(power > 0 and not UnitIsDeadOrGhost(unit)) then
  94.         local _, type = UnitPowerType(unit)
  95.         local colors = _COLORS.power
  96.         return ('%s%d'):format(Hex(colors[type] or colors['RUNES']), power)
  97.     end
  98. end
  99. oUF.TagEvents['Afterpower'] = 'UNIT_POWER'
  100.  
  101. oUF.Tags['Afterhealth'] = function(unit)
  102.     local min, max = UnitHealth(unit), UnitHealthMax(unit)
  103.     local status = not UnitIsConnected(unit) and 'Offline' or UnitIsGhost(unit) and 'Ghost' or UnitIsDead(unit) and 'Dead'
  104.  
  105.     if(status) then
  106.         return status
  107.     elseif(unit == 'target' and UnitCanAttack('player', unit)) then
  108.         return ('%s | %d %%'):format(ShortenValue(min), min / max * 100)
  109.     elseif(unit == 'player' and min ~= max) then
  110.         return ('%d | %d%%'):format(min - max, min / max * 100)
  111.     elseif(min ~= max) then
  112.         return ('%s | %s'):format(ShortenValue(min), ShortenValue(max))
  113.     else
  114.         return max
  115.     end
  116. end
  117. oUF.TagEvents['Afterhealth'] = 'UNIT_HEALTH'
  118.  
  119. oUF.Tags['Aftermathh:BossHP']  = function(unit)
  120.     local min, max = UnitHealth(unit), UnitHealthMax(unit)
  121.     return ShortenValue(min)..' | '..math.floor(min/max*100+.5)..'%'
  122. end
  123. oUF.TagEvents['Aftermathh:BossHP'] = 'UNIT_HEALTH'
  124.  
  125. local auraIcon = function(icons, button)
  126.    
  127.     if(DebuffType) then
  128.       icons.showDebuffType = true
  129.     end
  130.    
  131.     button.icon:SetTexCoord(0.03, 0.97, 0.03, 0.97)
  132.    
  133.     button.overlay:SetTexture(border)
  134.     button.overlay:SetTexCoord(0, 1, 0, 1)
  135.     button.overlay:ClearAllPoints()
  136.     button.overlay:SetPoint('TOPRIGHT', button, 1.35, 1.35)
  137.     button.overlay:SetPoint('BOTTOMLEFT', button, -1.35, -1.35)
  138.     button.overlay.Hide = function(self) self:SetVertexColor(0.65, 0.65, 0.65) end
  139.  
  140.     button.cd.noCooldownCount = true
  141.     button.cd:SetReverse()
  142.     button.cd:ClearAllPoints()
  143.     button.cd:SetPoint('TOPRIGHT', button.icon, 'TOPRIGHT', -1, -1)
  144.     button.cd:SetPoint('BOTTOMLEFT', button.icon, 'BOTTOMLEFT', 1, 1)
  145.  
  146.     button.count:SetFont(font, 14, 'THINOUTLINE')
  147.     button.count:ClearAllPoints()
  148.     button.count:SetPoint('BOTTOMRIGHT', 1, 1)
  149.    
  150.     button.background = button:CreateTexture(nil, 'BACKGROUND')
  151.     button.background:SetPoint('TOPLEFT', button.icon, 'TOPLEFT', -4, 4)
  152.     button.background:SetPoint('BOTTOMRIGHT', button.icon, 'BOTTOMRIGHT', 4, -4)
  153.     button.background:SetTexture(borderbg)
  154.     button.background:SetVertexColor(0, 0, 0, 1)
  155.    
  156. end
  157.  
  158. local Shared = function(self, unit)
  159.  
  160.     self:SetScript('OnEnter', UnitFrame_OnEnter)
  161.     self:SetScript('OnLeave', UnitFrame_OnLeave)
  162.     self:RegisterForClicks'AnyDown'
  163.     self:SetAttribute('*type2', 'menu')
  164.     self.menu = menu
  165.    
  166.     self.disallowVehicleSwap = true
  167.  
  168.     self.DebuffHighlightBackdrop = true
  169.     self.DebuffHighlightFilter = false
  170.  
  171.     self:SetBackdrop(backdrop)
  172.     self:SetBackdropColor(0, 0, 0, 0.8)
  173.    
  174.     --CreateBorder(self, 12, R, G, B, 4, 4, 4, 4, 4, 4, 4, 4)
  175.  
  176.     local health = CreateFrame('StatusBar', nil, self)
  177.     health:SetHeight(27*.85)
  178.     health:SetStatusBarTexture(texture)
  179.     health:SetStatusBarColor(.25, .25, .25)    
  180.     health:SetParent(self)
  181.     health:SetPoint'TOP'
  182.     health:SetPoint'LEFT'
  183.     health:SetPoint'RIGHT'
  184.    
  185.     health.Smooth = true
  186.     health.frequentUpdates = true
  187.    
  188.     self.Health = health
  189.    
  190.     local healthbg = health:CreateTexture(nil, 'BORDER')
  191.     healthbg:SetAllPoints(health)
  192.     healthbg:SetTexture(texture)
  193.     healthbg:SetVertexColor(0, 0, 0, 0.7)
  194.  
  195.     local healthtext = health:CreateFontString(nil, 'OVERLAY')
  196.     healthtext:SetFont(font, 15, 'THINOUTLINE')
  197.     healthtext:SetPoint('RIGHT', health, -2, 0)
  198.     self:Tag(healthtext, '[raidcolor][Afterhealth]')
  199.    
  200.     if(unit and unit:find('boss%d')) then
  201.         self:Tag(healthtext, '[raidcolor][Aftermathh:BossHP]')
  202.     end
  203.    
  204.     if(unit == 'focus' or unit == 'pet' or unit == 'targettarget' or unit == 'focustarget' or unit == 'party' or unit == 'player' or unit == 'target' or unit and unit:find('boss%d')) then
  205.    
  206.         local power = CreateFrame('StatusBar', nil, self)
  207.        
  208.         power:SetStatusBarTexture(texture)
  209.  
  210.         if(PowerNormal) then
  211.        
  212.             power:SetHeight(27*.11)
  213.             power:SetParent(self)
  214.             power:SetPoint('BOTTOM')
  215.             power:SetPoint('LEFT', .2, 0)
  216.             power:SetPoint('RIGHT', -.2, 0)
  217.            
  218.             CreateBorder(self.Health, 12, R, G, B, 4, 4, 4, 4, 4, 8, 4, 8)
  219.            
  220.         end
  221.        
  222.         if(PowerMiddle) then
  223.        
  224.             power:SetHeight(25)
  225.             power:SetWidth(440)
  226.             power:SetPoint('LEFT', health, 20, -11)
  227.             power:SetPoint('RIGHT', health, -12, 20)
  228.             power:SetFrameStrata('LOW')
  229.            
  230.             CreateBorder(self.Health, 12, R, G, B, 4, 4, 4, 4, 4, 4, 4, 4)
  231.            
  232.             CreateBorder(power, 12, R, G, B, 1, 1, 1, 1, 1, 1, 1, 1)
  233.            
  234.         end
  235.        
  236.         if(PowerRight) then
  237.        
  238.             power:SetHeight(25)
  239.             power:SetWidth(440)
  240.             power:SetPoint('LEFT', health, 20, -10)
  241.             power:SetPoint('RIGHT', health, 10, 20)
  242.             power:SetFrameStrata('LOW')
  243.            
  244.             CreateBorder(self.Health, 12, R, G, B, 4, 4, 4, 4, 4, 4, 4, 4)
  245.            
  246.             CreateBorder(power, 12, R, G, B, 1, 1, 1, 1, 1, 1, 1, 1)
  247.            
  248.         end
  249.        
  250.         power.Smooth = true
  251.         power.frequentUpdates = true
  252.         power.colorTapowering = true
  253.         power.colorHapoweriness = true
  254.         power.colorClass = true
  255.         power.colorReaction = true
  256.        
  257.         self.Power = power
  258.  
  259.         local powerbg = power:CreateTexture(nil, 'BORDER')
  260.         powerbg:SetAllPoints(power)
  261.         powerbg:SetTexture(texture)
  262.         powerbg.multiplier = .3
  263.        
  264.         power.bg = powerbg
  265.  
  266.         local powertext = health:CreateFontString(nil, 'OVERLAY')
  267.         powertext:SetFont(font, 15, 'THINOUTLINE')
  268.         powertext:SetPoint('LEFT', health, 2, 0)
  269.         self:Tag(powertext, '[Afterpower]')
  270.        
  271.         self.colors.power.MANA = {0, 144/255, 1}
  272.         self.colors.power.RUNIC_POWER = {0, 0.82, 1}
  273.        
  274.         self.Range = {
  275.             insideAlpha = 1,
  276.             outsideAlpha = 0.3,
  277.         }
  278.    
  279.         self.SpellRange = {
  280.             insideAlpha = 1,
  281.             outsideAlpha = 0.3,
  282.         }
  283.    
  284.         if(unit == 'focus' or unit == 'pet' or unit == 'targettarget' or unit == 'focustarget' or unit == 'party') then
  285.            powertext:Hide()
  286.            healthtext:Hide()
  287.         end
  288.        
  289.         if(unit and unit:find('boss%d')) then
  290.           powertext:Hide()
  291.         end
  292.        
  293.         if(unit == 'focus' or unit == 'pet' or unit == 'targettarget' or unit == 'focustarget') then
  294.            self:SetSize(150, 27)
  295.         end
  296.        
  297.         if(unit == 'player' or unit == 'target') then
  298.            self:SetSize(270, 27)
  299.         end
  300.    
  301.         if(unit == 'focus' or unit == 'pet') then
  302.            self:SetScale(0.95)
  303.         end
  304.     end
  305.    
  306.     if(CastBars) then
  307.    
  308.         if(unit == 'player' or unit == 'focus' or unit == 'target' or unit == 'pet') then
  309.        
  310.             self.Castbar = CreateFrame('StatusBar', nil, self)
  311.             self.Castbar:SetStatusBarTexture(texture)
  312.             self.Castbar:SetScale(1.139)
  313.             self.Castbar:SetStatusBarColor(.25, .25, .25)
  314.        
  315.             CreateBorder(self.Castbar, 12, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3)
  316.  
  317.             self.Castbar.Bg = self.Castbar:CreateTexture(nil, 'BACKGROUND')
  318.             self.Castbar.Bg:SetAllPoints(self.Castbar)
  319.             self.Castbar.Bg:SetTexture(texture)
  320.             self.Castbar.Bg:SetVertexColor(0, 0, 0, 0.7)
  321.            
  322.             if(unit == 'player') then -- Player CastBar
  323.            
  324.                 self.Castbar:SetPoint('BOTTOM', UIParent, -2, 80) -- here we move the player castbar.
  325.                 self.Castbar:SetHeight(25)
  326.                 self.Castbar:SetWidth(309)
  327.                 self.Castbar:SetParent(self)
  328.  
  329.                 if(ClassColor) then
  330.                    self.Castbar:SetStatusBarColor(playerColor.r, playerColor.g, playerColor.b)
  331.                    self.Castbar.Bg:SetVertexColor(playerColor.r*0.3, playerColor.g*0.3, playerColor.b*0.3, 0.8)
  332.                 end
  333.        
  334.                 if(Safezone) then
  335.                     self.Castbar.SafeZone = self.Castbar:CreateTexture(nil, 'BORDER')
  336.                     self.Castbar.SafeZone:SetTexture('Interface\\Buttons\\WHITE8x8')
  337.                     self.Castbar.SafeZone:SetVertexColor(1, 0.5, 0, 1)
  338.                 end
  339.  
  340.                 if(Latency) then
  341.                     self.Castbar.Latency = self:CreateFontString(nil, 'ARTWORK')
  342.                     self.Castbar.Latency:SetFont(font, 12, 'OUTLINE')
  343.                     self.Castbar.Latency:SetParent(self.Castbar)
  344.                     self.Castbar.Latency:SetDrawLayer('OVERLAY')
  345.                     self.Castbar.Latency:SetVertexColor(0.6, 0.6, 0.6)
  346.                     self.Castbar.Latency:SetAlpha(1)
  347.                 end
  348.  
  349.                 self.Castbar.PostCastStart = UpdateCastStart
  350.                 self.Castbar.PostChannelStart = UpdateChannelStart
  351.             end
  352.  
  353.             self.Castbar.CustomDelayText = function(self, duration)
  354.                 self.Time:SetFormattedText('(|cffff0000-%.1f|r) %.1f | %.1f', self.delay, duration, self.max)
  355.             end
  356.    
  357.             self.Castbar.CustomTimeText = function(self, duration)
  358.                 self.Time:SetFormattedText('%.1f | %.1f', duration, self.max)
  359.             end
  360.  
  361.             self.Castbar.Time = self:CreateFontString(nil, 'ARTWORK')
  362.             self.Castbar.Time:SetFont(font, 13, 'THINOUTLINE')
  363.             self.Castbar.Time:SetPoint('RIGHT', self.Castbar, 'RIGHT', -7, 0)
  364.             self.Castbar.Time:SetHeight(25)
  365.             self.Castbar.Time:SetParent(self.Castbar)
  366.             self.Castbar.Time:SetJustifyH('RIGHT')
  367.  
  368.             self.Castbar.Text = self:CreateFontString(nil, 'ARTWORK')
  369.             self.Castbar.Text:SetFont(font, 13, 'THINOUTLINE')
  370.             self.Castbar.Text:SetPoint('LEFT', self.Castbar, 4, 0)
  371.             self.Castbar.Text:SetPoint('RIGHT', self.Castbar.Time, 'LEFT', -7, 0)
  372.             self.Castbar.Text:SetHeight(25)
  373.             self.Castbar.Text:SetParent(self.Castbar)
  374.             self.Castbar.Text:SetJustifyH('LEFT')
  375.            
  376.             if(unit == 'target') then -- Target Castbar
  377.            
  378.                 self.Castbar:SetWidth(200)
  379.                 self.Castbar:SetHeight(26)
  380.                 self.Castbar:SetStatusBarColor(.25, .25, .25)
  381.                 self.Castbar:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 143, 94) -- here we move the target castbar
  382.                
  383.                
  384.                 if(TargetCastBarIcon) then
  385.                
  386.                     self.Castbar.Icon = self.Castbar:CreateTexture(nil, 'ARTWORK')
  387.                     self.Castbar.Icon:SetHeight(39)
  388.                     self.Castbar.Icon:SetWidth(39)
  389.                     self.Castbar.Icon:SetPoint('RIGHT', 47, 4)
  390.                     self.IconOverlay = self.Castbar:CreateTexture(nil, 'OVERLAY')
  391.                     self.IconOverlay:SetPoint('TOPLEFT', self.Castbar.Icon, 'TOPLEFT')
  392.                     self.IconOverlay:SetPoint('BOTTOMRIGHT', self.Castbar.Icon, 'BOTTOMRIGHT')
  393.                     self.IconOverlay:SetTexture(border)
  394.                     self.IconOverlay:SetVertexColor(0.75, 0.75, 0.75, 1)
  395.                     self.Castbar.IconBg = self.Castbar:CreateTexture(nil, 'BACKGROUND')
  396.                     self.Castbar.IconBg:SetPoint('TOPLEFT',self.Castbar.Icon,'TOPLEFT',-5,5)
  397.                     self.Castbar.IconBg:SetPoint('BOTTOMRIGHT',self.Castbar.Icon,'BOTTOMRIGHT',5,-5)
  398.                     self.Castbar.IconBg:SetTexture(borderbg)
  399.                     self.Castbar.IconBg:SetVertexColor(0, 0, 0, 9)
  400.                    
  401.                 end
  402.            
  403.             end
  404.            
  405.             if(unit == 'focus') then -- Focus Castbar
  406.            
  407.                 self.Castbar:SetWidth(260)
  408.                 self.Castbar:SetHeight(25)
  409.                 self.Castbar:SetScale(1.210)
  410.                 self.Castbar:SetStatusBarColor(.25, .25, .25)
  411.                 self.Castbar:SetPoint('CENTER', UIParent, 'CENTER', -10, -10) -- here we move focus castbar
  412.                
  413.                 if(FocusCastBarIcon) then
  414.                
  415.                     self.Castbar.Icon = self.Castbar:CreateTexture(nil, 'ARTWORK')
  416.                     self.Castbar.Icon:SetHeight(39)
  417.                     self.Castbar.Icon:SetWidth(39)
  418.                     self.Castbar.Icon:SetPoint('LEFT', -48, 3)
  419.                     self.IconOverlay = self.Castbar:CreateTexture(nil, 'OVERLAY')
  420.                     self.IconOverlay:SetPoint('TOPLEFT', self.Castbar.Icon, 'TOPLEFT')
  421.                     self.IconOverlay:SetPoint('BOTTOMRIGHT', self.Castbar.Icon, 'BOTTOMRIGHT')
  422.                     self.IconOverlay:SetTexture(border)
  423.                     self.IconOverlay:SetVertexColor(0.75, 0.75, 0.75, 1)
  424.                     self.Castbar.IconBg = self.Castbar:CreateTexture(nil, 'BACKGROUND')
  425.                     self.Castbar.IconBg:SetPoint('TOPLEFT',self.Castbar.Icon,'TOPLEFT',-5,5)
  426.                     self.Castbar.IconBg:SetPoint('BOTTOMRIGHT',self.Castbar.Icon,'BOTTOMRIGHT',5,-5)
  427.                     self.Castbar.IconBg:SetTexture(borderbg)
  428.                     self.Castbar.IconBg:SetVertexColor(0, 0, 0, 9)
  429.                    
  430.                 end
  431.                
  432.             end
  433.    
  434.             if(unit == 'pet') then -- Pet Castbar
  435.            
  436.                 self.Castbar:SetHeight(22)
  437.                 self.Castbar:SetWidth(200)
  438.                 self.Castbar:SetStatusBarColor(.25, .25, .25)
  439.                 self.Castbar:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', -12, 56) -- here we move the pet castbar
  440.                
  441.             end
  442.         end
  443.        
  444.         -- Interrupt Highlight, don't touch this IF you know what your doing.
  445.        
  446.         if(unit == 'target' or unit == 'focus') then
  447.        
  448.             if ((unit == 'target' and TargetShowInterruptHighlight) or (unit == 'focus' and FocusShowInterruptHighlight)) then
  449.            
  450.                 self.Shadow = {}
  451.                
  452.                 for i = 1, 8 do
  453.                     self.Shadow[i] = self.Castbar:CreateTexture(nil, 'BACKGROUND')
  454.                     self.Shadow[i]:SetParent(self.Castbar)
  455.                     self.Shadow[i]:SetTexture(borderbg)
  456.                     self.Shadow[i]:SetWidth(20)
  457.                     self.Shadow[i]:SetHeight(20)
  458.                     self.Shadow[i]:SetVertexColor(1, 0, 1)
  459.                 end
  460.                
  461.                 self.Shadow[1]:SetTexCoord(0, 1/3, 0, 1/3)
  462.                 self.Shadow[1]:SetPoint('TOPLEFT', self.Castbar, -10, 10)
  463.  
  464.                 self.Shadow[2]:SetTexCoord(2/3, 1, 0, 1/3)
  465.                 self.Shadow[2]:SetPoint('TOPRIGHT', self.Castbar, 10, 10)
  466.  
  467.                 self.Shadow[3]:SetTexCoord(0, 1/3, 2/3, 1)
  468.                 self.Shadow[3]:SetPoint('BOTTOMLEFT', self.Castbar, -10, -10)
  469.  
  470.                 self.Shadow[4]:SetTexCoord(2/3, 1, 2/3, 1)
  471.                 self.Shadow[4]:SetPoint('BOTTOMRIGHT', self.Castbar, 10, -10)
  472.  
  473.                 self.Shadow[5]:SetTexCoord(1/3, 2/3, 0, 1/3)
  474.                 self.Shadow[5]:SetPoint('TOPLEFT', self.Shadow[1], 'TOPRIGHT')
  475.                 self.Shadow[5]:SetPoint('TOPRIGHT', self.Shadow[2], 'TOPLEFT')
  476.  
  477.                 self.Shadow[6]:SetTexCoord(1/3, 2/3, 2/3, 1)
  478.                 self.Shadow[6]:SetPoint('BOTTOMLEFT', self.Shadow[3], 'BOTTOMRIGHT')
  479.                 self.Shadow[6]:SetPoint('BOTTOMRIGHT', self.Shadow[4], 'BOTTOMLEFT')
  480.  
  481.                 self.Shadow[7]:SetTexCoord(0, 1/3, 1/3, 2/3)
  482.                 self.Shadow[7]:SetPoint('TOPLEFT', self.Shadow[1], 'BOTTOMLEFT')
  483.                 self.Shadow[7]:SetPoint('BOTTOMLEFT', self.Shadow[3], 'TOPLEFT')
  484.  
  485.                 self.Shadow[8]:SetTexCoord(2/3, 1, 1/3, 2/3)
  486.                 self.Shadow[8]:SetPoint('TOPRIGHT', self.Shadow[2], 'BOTTOMRIGHT')
  487.                 self.Shadow[8]:SetPoint('BOTTOMRIGHT', self.Shadow[4], 'TOPRIGHT')
  488.                
  489.                 self.hasShadow = true
  490.             else
  491.                 self.hasShadow = false
  492.             end
  493.            
  494.             local interruptFrame = CreateFrame('Frame')
  495.        
  496.             interruptFrame:RegisterEvent('UNIT_SPELLCAST_START')
  497.             interruptFrame:RegisterEvent('UNIT_SPELLCAST_DELAYED')
  498.             interruptFrame:RegisterEvent('UNIT_SPELLCAST_CHANNEL_START')
  499.             interruptFrame:RegisterEvent('UNIT_SPELLCAST_CHANNEL_UPDATE')
  500.             interruptFrame:RegisterEvent('PLAYER_TARGET_CHANGED')
  501.             interruptFrame:RegisterEvent('PLAYER_FOCUS_CHANGED')
  502.            
  503.             interruptFrame:SetScript('OnEvent', function()
  504.                 local name, _, _, _, _, _, _, _, interrupt = UnitCastingInfo(unit)
  505.            
  506.                 if (self.hasShadow) then  
  507.                     for i = 1, 8 do
  508.                         self.Shadow[i]:Hide()
  509.                     end
  510.                 end
  511.                
  512.                 if (name) then
  513.                     if (interrupt) then
  514.                    
  515.                         self.Castbar:SetStatusBarColor(.25, .25, .25)
  516.                         self.Castbar.Bg:SetVertexColor(1, 0, 1)
  517.                        
  518.                         if (self.hasShadow) then
  519.                             for i = 1, 8 do
  520.                                 self.Shadow[i]:Show()
  521.                             end
  522.                         end
  523.                     else
  524.                    
  525.                         self.Castbar:SetStatusBarColor(.25, .25, .25)
  526.                         self.Castbar.Bg:SetVertexColor(0, 0, 0, 0.6)
  527.                        
  528.                         if (self.hasShadow) then
  529.                             for i = 1, 8 do
  530.                                 self.Shadow[i]:Hide()
  531.                             end
  532.                         end
  533.                     end
  534.                 end
  535.             end)
  536.         end
  537.     end
  538.    
  539.     for _, bar in pairs({
  540.         'MirrorTimer1',
  541.         'MirrorTimer2',
  542.         'MirrorTimer3',
  543.     }) do
  544.    
  545.         for i, region in pairs({_G[bar]:GetRegions()}) do
  546.             if (region.GetTexture and region:GetTexture() == 'SolidTexture') then
  547.                 region:Hide()
  548.             end
  549.         end
  550.  
  551.         CreateBorder(_G[bar], 12, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3)
  552.  
  553.         _G[bar..'Border']:Hide()
  554.  
  555.         _G[bar]:SetParent(UIParent)
  556.         _G[bar]:SetScale(1)
  557.         _G[bar]:SetHeight(27)
  558.         _G[bar]:SetWidth(320)
  559.  
  560.         _G[bar..'Background'] = _G[bar]:CreateTexture(bar..'Background', 'BACKGROUND', _G[bar])
  561.         _G[bar..'Background']:SetTexture('Interface\\Buttons\\WHITE8x8')
  562.         _G[bar..'Background']:SetAllPoints(bar)
  563.         _G[bar..'Background']:SetVertexColor(0, 0, 0, 0.5)                                         
  564.  
  565.         _G[bar..'Text']:SetFont(font, 14, 'THINOUTLINE')
  566.         _G[bar..'Text']:ClearAllPoints()
  567.         _G[bar..'Text']:SetPoint('CENTER', MirrorTimer1StatusBar, 0, 1)
  568.  
  569.         _G[bar..'StatusBar']:SetAllPoints(_G[bar])
  570.        
  571.     end
  572.    
  573.     self.RaidIcon = health:CreateTexture(nil, 'OVERLAY')
  574.     self.RaidIcon:SetHeight(25)
  575.     self.RaidIcon:SetWidth(25)
  576.     self.RaidIcon:SetPoint('CENTER', self, 'TOP', 0, 5)
  577.    
  578.     if(PvPIcon) then
  579.         local PvPIcon = self:CreateTexture('$parentPVPIcon', 'OVERLAY')
  580.         PvPIcon:SetHeight(33)
  581.         PvPIcon:SetWidth(33)
  582.         PvPIcon:SetPoint('BOTTOMRIGHT', health, 'TOPRIGHT', 21, -33)
  583.         self.PvP = PvPIcon
  584.  
  585.         if(unit == 'target') then
  586.            PvPIcon:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', 111, -50)
  587.         end
  588.    
  589.         if(unit == 'player') then
  590.            PvPIcon:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', 0, 0)
  591.         else
  592.            PvPIcon:SetPoint('BOTTOMRIGHT', health, 'TOPRIGHT', 21, -33)
  593.         end
  594.    
  595.         self.PvPTimer = self.Health:CreateFontString('$parentPVPTimer', 'OVERLAY')
  596.         self.PvPTimer:SetFont(font, 12, 'THINOUTLINE')
  597.         self.PvPTimer:SetPoint('BOTTOM', self.PvP, 'TOP', -12, 0)
  598.  
  599.         self.LastUpdate = 0    
  600.         self:HookScript('OnUpdate', function(self, elapsed)
  601.             local time = nil
  602.             if (IsPVPTimerRunning()) then
  603.                 time = GetPVPTimer()
  604.             end
  605.  
  606.             if (time) then
  607.                 time = time - elapsed * 1000
  608.                 local timeLeft = time
  609.                 if (timeLeft < 0) then
  610.                     self.PvPTimer:SetText('')
  611.                 end
  612.                 self.PvPTimer:SetFormattedText(SecondsToTimeAbbrev(floor(timeLeft/1000)))
  613.             else
  614.                 self.PvPTimer:SetText('')
  615.             end
  616.         end)
  617.     end
  618.    
  619.     if(unit == 'party') then
  620.        local PhaseIcon = health:CreateTexture(nil, 'OVERLAY')
  621.        PhaseIcon:SetSize(15, 15)
  622.        PhaseIcon:SetPoint('RIGHT', self, 22, 0)
  623.        self.PhaseIcon = PhaseIcon
  624.     end
  625.    
  626.     if(unit == 'player' or unit == 'party') then
  627.         local LeaderIcon = health:CreateTexture('$parentLeaderIcon', 'OVERLAY')
  628.         LeaderIcon:SetHeight(15)
  629.         LeaderIcon:SetWidth(15)
  630.         LeaderIcon:SetPoint('BOTTOMLEFT', health, 'TOPLEFT', -5, -2)
  631.         self.Leader = LeaderIcon
  632.    
  633.         local MasterLooterIcon = health:CreateTexture('$parentMasterLooterIcon', 'OVERLAY')
  634.         MasterLooterIcon:SetHeight(12)
  635.         MasterLooterIcon:SetWidth(12)
  636.         MasterLooterIcon:SetPoint('BOTTOMLEFT', health, 'TOPLEFT', 12, 0)
  637.         self.MasterLooter = MasterLooterIcon
  638.     end
  639.    
  640.     if(unit == 'player' or unit == 'target') then
  641.         local ComboPoints = self:CreateFontString(nil, 'OVERLAY')
  642.         ComboPoints:SetFont(font, 26, 'THINOUTLINE')
  643.         ComboPoints:SetTextColor(playerColor.r, playerColor.g, playerColor.b)
  644.         ComboPoints:SetPoint('CENTER', self, 'RIGHT', -5, 32)
  645.         ComboPoints:SetJustifyH('RIGHT')
  646.         self:Tag(ComboPoints, '[cpoints]')
  647.     end
  648.    
  649.     if(unit == 'player') then
  650.         local CombatIcon = health:CreateTexture('$parentCombatIcon', 'OVERLAY')
  651.         CombatIcon:SetSize(25, 25)
  652.         CombatIcon:SetPoint('CENTER', health, -3, 0)
  653.         self.Combat = CombatIcon
  654.        
  655.         local RestingIcon = health:CreateTexture(nil, 'OVERLAY')
  656.         RestingIcon:SetSize(20, 20)
  657.         RestingIcon:SetPoint('CENTER', health, -25, 2)
  658.         self.Resting = RestingIcon
  659.     end
  660.    
  661.     if(Portraits) then
  662.         local Portrait = CreateFrame('PlayerModel', nil, self)
  663.         Portrait:SetBackdrop(backdrop)
  664.         Portrait:SetBackdropColor(0, 0, 0, 0.9)
  665.         Portrait:SetWidth(27*3)
  666.         Portrait:SetHeight(27*2)
  667.        
  668.         CreateBorder(Portrait, 12, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3)
  669.  
  670.         if(unit == 'player' or unit == 'focus' or unit == 'pet' or unit == 'party' or unit and unit:find('boss%d')) then
  671.            Portrait:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', -92, -26)
  672.         end
  673.        
  674.         if(unit == 'target') then
  675.            Portrait:SetPoint('BOTTOMLEFT', self, 'BOTTOMRIGHT', 11, -26)
  676.         end
  677.    
  678.         self.Portrait = Portrait       
  679.     end
  680.    
  681.     if unit then
  682.        
  683.         self.Name = health:CreateFontString(nil, 'OVERLAY')
  684.         self.Name:SetFont(font, 15, 'THINOUTLINE')
  685.  
  686.         -- Boss + Player Name Hidden.
  687.        
  688.         if(unit == 'player' or unit and unit:find('boss%d')) then
  689.             self.Name:Hide()
  690.         end
  691.        
  692.         -- Target Name, Tags.
  693.        
  694.         if(unit == 'target')then
  695.             self.Name:SetPoint('LEFT', health, 'LEFT', -5, 26)             
  696.             self:Tag(self.Name,'[difficulty][level][shortclassification] [raidcolor][AfterName]')
  697.         end
  698.        
  699.         -- Target of Target, Focus, Pet, Focus Target and, Party Names, Tags.
  700.        
  701.         if(unit == 'targettarget' or unit == 'focus' or unit == 'pet' or unit =='focustarget' or unit == 'party') then
  702.             self.Name:SetPoint('CENTER')
  703.             self:Tag(self.Name, '[raidcolor][AfterShortName] [happiness]')
  704.         end
  705.     end
  706.    
  707.     if(Buffs) then
  708.    
  709.         -- Buffs Configure --
  710.    
  711.         local Buffs = CreateFrame('Frame', nil, self)
  712.         Buffs:SetHeight(270)
  713.         Buffs:SetWidth(270)
  714.         Buffs.size = 28
  715.         Buffs.spacing = 3
  716.         Buffs.PostCreateIcon = auraIcon
  717.        
  718.         -- Player Buffs --
  719.        
  720.         if(unit == 'player') then
  721.             Buffs.initialAnchor = 'TOPLEFT'
  722.             Buffs['growth-y'] = 'RIGHT'
  723.             Buffs['growth-x'] = 'DOWN'
  724.             Buffs:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', -3, -8)
  725.             Buffs.num = 0
  726.         end
  727.        
  728.         -- Target Buffs --
  729.        
  730.         if(unit == 'target') then
  731.             Buffs.initialAnchor = 'TOPLEFT'
  732.             Buffs['growth-y'] = 'RIGHT'
  733.             Buffs['growth-x'] = 'DOWN'
  734.             Buffs:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', -3, -8)
  735.             Buffs.num = 9
  736.         end
  737.        
  738.         -- Target Of Target Buffs --
  739.        
  740.         if(unit == 'targettarget') then
  741.             Buffs.initialAnchor = 'TOPLEFT'
  742.             Buffs['growth-y'] = 'RIGHT'
  743.             Buffs['growth-x'] = 'DOWN'
  744.             Buffs:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', -3, -8)
  745.             Buffs.num = 0
  746.         end
  747.        
  748.         -- Party And Boss Buffs --
  749.        
  750.         if(unit == 'party' or unit and unit:find('boss%d')) then
  751.             Buffs.initialAnchor = 'TOPLEFT'    
  752.             Buffs['growth-y'] = 'RIGHT'
  753.             Buffs['growth-x'] = 'DOWN'
  754.             Buffs:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', -3, -8)
  755.             Buffs.num = 5
  756.         end
  757.        
  758.         -- Pet Buffs --
  759.        
  760.         if(unit == 'pet') then
  761.             Buffs.initialAnchor = 'TOPLEFT'
  762.             Buffs['growth-y'] = 'RIGHT'
  763.             Buffs['growth-x'] = 'DOWN'
  764.             Buffs:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', -3, -8)
  765.             Buffs.num = 6
  766.         end
  767.        
  768.         -- Focus Buffs --
  769.        
  770.         if(unit == 'focus') then
  771.             Buffs.initialAnchor = 'TOPLEFT'
  772.             Buffs['growth-y'] = 'RIGHT'
  773.             Buffs['growth-x'] = 'DOWN'
  774.             Buffs:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', -3, -8)
  775.             Buffs.num = 6
  776.         end
  777.        
  778.         -- FocusTarget Buffs --
  779.        
  780.         if(unit == 'focustarget') then
  781.             Buffs.initialAnchor = 'TOPLEFT'
  782.             Buffs['growth-y'] = 'RIGHT'
  783.             Buffs['growth-x'] = 'DOWN'
  784.             Buffs:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', -3, -8)
  785.             Buffs.num = 0
  786.         end                                                                                                            
  787.    
  788.         self.Buffs = Buffs
  789.     end
  790.  
  791.     if(Debuffs) then
  792.    
  793.         -- Debuffs Configure --
  794.    
  795.         local Debuffs = CreateFrame('Frame', nil, self)
  796.         Debuffs:SetHeight(270)
  797.         Debuffs:SetWidth(270)
  798.         Debuffs.size = 32
  799.         Debuffs.spacing = 3
  800.         Debuffs.PostCreateIcon = auraIcon
  801.        
  802.         -- Player Debuffs --
  803.        
  804.         if(unit == 'player') then
  805.             Debuffs:SetPoint('LEFT', self, 'RIGHT', 20, 5)
  806.             Debuffs['growth-x'] = 'RIGHT'
  807.             Debuffs.initialAnchor = 'LEFT'
  808.             Debuffs.num = 0
  809.             Debuffs.onlyShowPlayer = false
  810.         end        
  811.  
  812.         -- Target Debuffs --
  813.        
  814.         if(unit == 'target') then
  815.             Debuffs:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', -3, 28)
  816.             Debuffs['growth-y'] = 'UP'
  817.             Debuffs.initialAnchor = 'BOTTOMLEFT'
  818.             Debuffs.num = 7
  819.             Debuffs.onlyShowPlayer = true
  820.         end
  821.        
  822.         -- Target Of Target Debuffs --
  823.        
  824.         if(unit == 'targettarget') then
  825.             Debuffs:SetPoint('LEFT', self, 'RIGHT', 20, 5)
  826.             Debuffs['growth-x'] = 'RIGHT'
  827.             Debuffs.initialAnchor = 'LEFT'
  828.             Debuffs.num = 0
  829.             Debuffs.onlyShowPlayer = false
  830.         end
  831.        
  832.         -- Party Debuffs --
  833.        
  834.         if(unit == 'party') then
  835.             Debuffs:SetPoint('LEFT', self, 'RIGHT', 8, 0)
  836.             Debuffs['growth-x'] = 'RIGHT'
  837.             Debuffs.initialAnchor = 'LEFT'
  838.             Debuffs.num = 5
  839.             Debuffs.onlyShowPlayer = false
  840.         end
  841.        
  842.         -- Pet Debuffs --
  843.        
  844.         if(unit == 'pet') then
  845.             Debuffs:SetPoint('LEFT', self, 'RIGHT', 8, 0)
  846.             Debuffs['growth-x'] = 'RIGHT'
  847.             Debuffs.initialAnchor = 'LEFT'
  848.             Debuffs.num = 5
  849.             Debuffs.onlyShowPlayer = false
  850.         end
  851.        
  852.         -- Focus Debuffs --
  853.  
  854.         if(unit == 'focus') then
  855.             Debuffs:SetPoint('LEFT', self, 'RIGHT', 8, 0)
  856.             Debuffs['growth-x'] = 'RIGHT'
  857.             Debuffs.initialAnchor = 'LEFT'
  858.             Debuffs.num = 5
  859.             Debuffs.onlyShowPlayer = false
  860.         end
  861.        
  862.         -- Focus Target Debuffs --
  863.        
  864.         if(unit == 'focustarget') then
  865.             Debuffs:SetPoint('LEFT', self, 'RIGHT', 8, 0)
  866.             Debuffs['growth-x'] = 'RIGHT'
  867.             Debuffs.initialAnchor = 'LEFT'
  868.             Debuffs.num = 5
  869.             Debuffs.onlyShowPlayer = true
  870.         end
  871.        
  872.         self.Debuffs = Debuffs
  873.     end
  874.    
  875.     if(unit == 'player') then
  876.        
  877.         if IsAddOnLoaded('oUF_Swing') then
  878.        
  879.             self.Swing = CreateFrame('StatusBar', nil, self)
  880.             self.Swing:SetPoint('TOP', self, 'BOTTOM', 335, -68)
  881.             self.Swing:SetStatusBarTexture(texture)
  882.             self.Swing:SetStatusBarColor(playerColor.r, playerColor.g, playerColor.b)
  883.             self.Swing:SetHeight(15)
  884.             self.Swing:SetWidth(270)
  885.             self.Swing:SetBackdrop(backdrop)
  886.             self.Swing:SetBackdropColor(0, 0, 0)
  887.    
  888.             self.Swing.disableMelee = false
  889.             self.Swing.disableRanged = false
  890.            
  891.             CreateBorder(self.Swing, 12, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3)
  892.  
  893.             self.Swing.Text = self.Swing:CreateFontString(nil, 'OVERLAY')
  894.             self.Swing.Text:SetFont(font, 24, 'THINOUTLINE')
  895.             self.Swing.Text:SetPoint('CENTER', self.Swing)
  896.            
  897.             self.Swing.bg = self.Swing:CreateTexture(nil, 'BORDER')
  898.             self.Swing.bg:SetAllPoints(self.Swing)
  899.             self.Swing.bg:SetTexture(0, 0, 0, 0.1)
  900.            
  901.         end
  902.    
  903.         if IsAddOnLoaded('oUF_Experience') then
  904.        
  905.             self.Experience = CreateFrame('StatusBar', nil, self)
  906.             self.Experience:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, 52)
  907.             self.Experience:SetStatusBarTexture(texture)
  908.             self.Experience:SetStatusBarColor(0,.7,1)
  909.             self.Experience:SetHeight(15)
  910.             self.Experience:SetWidth(235)
  911.             self.Experience:SetBackdrop(backdrop)
  912.             self.Experience:SetBackdropColor(0, 0, 0, .5)
  913.             self.Experience.Tooltip = true
  914.  
  915.             CreateBorder(self.Experience, 12, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3)
  916.  
  917.             self.Experience.Text = self.Experience:CreateFontString(nil, 'OVERLAY')
  918.             self.Experience.Text:SetFont(font, 15, 'THINOUTLINE')
  919.             self.Experience.Text:SetPoint('CENTER', self.Experience)
  920.  
  921.             self.Experience.bg = self.Experience:CreateTexture(nil, 'BORDER')
  922.             self.Experience.bg:SetAllPoints(self.Experience)
  923.             self.Experience.bg:SetTexture(0, 0, 0, .5)
  924.            
  925.         end
  926.    
  927.         if IsAddOnLoaded('oUF_TotemBar') and class == 'SHAMAN' then
  928.        
  929.             self.TotemBar = {}
  930.             self.TotemBar.Destroy = true
  931.            
  932.             for i = 1, 4 do
  933.            
  934.                 self.TotemBar[i] = CreateFrame('StatusBar', nil, self)
  935.                 self.TotemBar[i]:SetHeight(12)
  936.                 self.TotemBar[i]:SetWidth(265/4 - 5)
  937.                
  938.                 if (i == 1) then
  939.                     self.TotemBar[i]:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', -1, -9)
  940.                 else
  941.                     self.TotemBar[i]:SetPoint('RIGHT', self.TotemBar[i-1], 'LEFT', -8, 0)
  942.                 end
  943.  
  944.                 CreateBorder(self.TotemBar[i], 12, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3)
  945.  
  946.                 self.TotemBar[i]:SetStatusBarTexture(texture)
  947.                 self.TotemBar[i]:SetBackdrop(backdrop)
  948.                 self.TotemBar[i]:SetBackdropColor(0,0,0,6)
  949.                 self.TotemBar[i]:SetMinMaxValues(0, 1)
  950.  
  951.                 self.TotemBar[i].bg = self.TotemBar[i]:CreateTexture(nil, 'BORDER')
  952.                 self.TotemBar[i].bg:SetAllPoints(self.TotemBar[i])
  953.                 self.TotemBar[i].bg:SetTexture(texture)
  954.                 self.TotemBar[i].bg.multiplier = 0.3
  955.                
  956.             end
  957.         end
  958.  
  959.         if (class == 'DEATHKNIGHT') then
  960.        
  961.             self.Runes = CreateFrame('Frame', nil, self)
  962.            
  963.             for i = 1, 6 do
  964.            
  965.                 self.Runes[i] = CreateFrame('StatusBar', self:GetName()..'_Runes'..i, self)
  966.                 self.Runes[i]:SetHeight(10)
  967.                 self.Runes[i]:SetWidth(250/6 - 0.85)
  968.                
  969.                 if(i == 1) then
  970.                     self.Runes[i]:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -8)
  971.                 else
  972.                     self.Runes[i]:SetPoint('TOPLEFT', self.Runes[i-1], 'TOPRIGHT', 5, 0)
  973.                 end
  974.                
  975.                 CreateBorder(self.Runes[i], 11, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3)
  976.                
  977.                 self.Runes[i]:SetStatusBarTexture(texture)
  978.                 self.Runes[i]:SetBackdrop(backdrop)
  979.                 self.Runes[i]:SetBackdropColor(0, 0, 0)
  980.                 self.Runes[i]:SetMinMaxValues(0, 1)
  981.  
  982.                 self.Runes[i].bg = self.Runes[i]:CreateTexture(nil, 'BORDER')
  983.                 self.Runes[i].bg:SetAllPoints(self.Runes[i])
  984.                 self.Runes[i].bg:SetTexture(0.1, 0.1, 0.1)
  985.                 self.Runes[i].bg.multiplier = 0.2
  986.                
  987.                 RuneFrame:Hide()
  988.                
  989.             end
  990.         end
  991.        
  992.         if(class == 'DRUID') then
  993.             local EclipseBar = CreateFrame('Frame', nil, self)
  994.             EclipseBar:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -10)
  995.             EclipseBar:SetWidth(270)
  996.             EclipseBar:SetHeight(13)
  997.             EclipseBar:SetBackdrop(backdrop)
  998.             EclipseBar:SetBackdropColor(0, 0, 0, 0.8)
  999.        
  1000.             CreateBorder(EclipseBar, 12, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4)
  1001.            
  1002.             self.EclipseBar = EclipseBar
  1003.          
  1004.             local LunarBar = CreateFrame('StatusBar', nil, EclipseBar)
  1005.             LunarBar:SetPoint('LEFT', EclipseBar, 'LEFT', 0, 0)
  1006.             LunarBar:SetWidth(270)
  1007.             LunarBar:SetHeight(13)
  1008.             LunarBar:SetStatusBarTexture(texture)
  1009.             LunarBar:SetStatusBarColor(0.36, 0.45, 0.88)
  1010.             EclipseBar.LunarBar = LunarBar
  1011.  
  1012.             local SolarBar = CreateFrame('StatusBar', nil, EclipseBar)
  1013.             SolarBar:SetPoint('LEFT', LunarBar:GetStatusBarTexture(), 'RIGHT', 0, 0)
  1014.             SolarBar:SetWidth(270)
  1015.             SolarBar:SetHeight(13)
  1016.             SolarBar:SetStatusBarTexture(texture)
  1017.             SolarBar:SetStatusBarColor(0.85, 0.83, 0.1)
  1018.             EclipseBar.SolarBar = SolarBar
  1019.  
  1020.             local EclipseBarText = SolarBar:CreateFontString(nil, 'OVERLAY')
  1021.             EclipseBarText:SetPoint('CENTER', EclipseBar, 'CENTER', 0, 0)
  1022.             EclipseBarText:SetFont(font, 15, 'THINOUTLINE')
  1023.             self:Tag(EclipseBarText, '[pereclipse]%')
  1024.    
  1025.         end
  1026.        
  1027.         -- Here are some awsome tags.. ;)
  1028.        
  1029.         if(class == 'HUNTER') then
  1030.             local LockAndLoad = self:CreateFontString(nil, 'OVERLAY')
  1031.             LockAndLoad:SetPoint('CENTER', self, 'RIGHT', -5, 31)
  1032.             LockAndLoad:SetFont(font, 25, 'THINOUTLINE')
  1033.             LockAndLoad:SetTextColor(playerColor.r, playerColor.g, playerColor.b)
  1034.             LockAndLoad:SetJustifyH('CENTER')
  1035.             self:Tag(LockAndLoad, '[Aftermathh:LockAndLoad]')
  1036.         end
  1037.    
  1038.         if(class == 'WARRIOR') then
  1039.             local ThunderStruck = self:CreateFontString(nil, 'OVERLAY')
  1040.             ThunderStruck:SetPoint('CENTER', self, 'RIGHT', -5, 31)
  1041.             ThunderStruck:SetFont(font, 25, 'THINOUTLINE')
  1042.             ThunderStruck:SetTextColor(playerColor.r, playerColor.g, playerColor.b)
  1043.             ThunderStruck:SetJustifyH('CENTER')
  1044.             self:Tag(ThunderStruck, '[Aftermathh:ThunderStruck]')
  1045.         end
  1046.    
  1047.         if(class == 'PRIEST') then
  1048.             local ShadowOrbs = self:CreateFontString(nil, 'OVERLAY')
  1049.             ShadowOrbs:SetPoint('CENTER', self, 'RIGHT', -5, 31)
  1050.             ShadowOrbs:SetFont(font, 25, 'THINOUTLINE')
  1051.             ShadowOrbs:SetTextColor(playerColor.r, playerColor.g, playerColor.b)
  1052.             ShadowOrbs:SetJustifyH('CENTER')
  1053.             self:Tag(ShadowOrbs, '[Aftermathh:ShadowOrbs]')
  1054.        
  1055.             local Evangelism = self:CreateFontString(nil, 'OVERLAY')
  1056.             Evangelism:SetPoint('CENTER', self, 'RIGHT', 15, -2)
  1057.             Evangelism:SetFont(font, 22, 'THINOUTLINE')
  1058.             Evangelism:SetTextColor(playerColor.r, playerColor.g, playerColor.b)
  1059.             Evangelism:SetJustifyH('CENTER')
  1060.             self:Tag(Evangelism, '[Aftermathh:Evangelism]')
  1061.         end
  1062.    
  1063.         if(class == 'SHAMAN') then     
  1064.             local WaterShield = self:CreateFontString(nil, 'OVERLAY')
  1065.             WaterShield:SetPoint('CENTER', self, 'RIGHT', -5, 31)
  1066.             WaterShield:SetFont(font, 25, 'THINOUTLINE')
  1067.             WaterShield:SetTextColor(playerColor.r, playerColor.g, playerColor.b)
  1068.             self:Tag(WaterShield, '[Aftermathh:WaterShield]')
  1069.            
  1070.             local LightingShield = self:CreateFontString(nil, 'OVERLAY')
  1071.             LightingShield:SetPoint('CENTER', self, 'RIGHT', -5, 31)
  1072.             LightingShield:SetFont(font, 25, 'THINOUTLINE')
  1073.             LightingShield:SetTextColor(playerColor.r, playerColor.g, playerColor.b)
  1074.             LightingShield:SetJustifyH('CENTER')
  1075.             self:Tag(LightingShield, '[Aftermathh:LightningShield]')
  1076.            
  1077.             local Maelstorm = self:CreateFontString(nil, 'OVERLAY')
  1078.             Maelstorm:SetPoint('CENTER', self, 'RIGHT', 15, -2)
  1079.             Maelstorm:SetFont(font, 22, 'THINOUTLINE')
  1080.             Maelstorm:SetTextColor(playerColor.r, playerColor.g, playerColor.b)
  1081.             Maelstorm:SetJustifyH('CENTER')
  1082.             self:Tag(Maelstorm, '[Aftermathh:Maelstorm]')
  1083.            
  1084.             local TidalWaves = self:CreateFontString(nil, 'OVERLAY')
  1085.             TidalWaves:SetPoint('CENTER', self, 'RIGHT', 15, -2)
  1086.             TidalWaves:SetFont(font, 22, 'THINOUTLINE')
  1087.             TidalWaves:SetTextColor(playerColor.r, playerColor.g, playerColor.b)
  1088.             TidalWaves:SetJustifyH('CENTER')
  1089.             self:Tag(TidalWaves, '[Aftermathh:TidalWaves]')
  1090.         end
  1091.        
  1092.         if(class == 'WARLOCK') then
  1093.             local Shards = self:CreateFontString(nil, 'OVERLAY')
  1094.             Shards:SetPoint('CENTER', self, 'RIGHT', -5, 31)
  1095.             Shards:SetFont(font, 25, 'THINOUTLINE')
  1096.             Shards:SetTextColor(playerColor.r, playerColor.g, playerColor.b)
  1097.             Shards:SetJustifyH('CENTER')
  1098.             self:Tag(Shards, '[Aftermathh:Shards]')
  1099.         end
  1100.        
  1101.         if(class == 'PALADIN') then
  1102.             local HolyPower = self:CreateFontString(nil, 'OVERLAY')
  1103.             HolyPower:SetPoint('CENTER', self, 'RIGHT', -5, 31)
  1104.             HolyPower:SetFont(font, 25, 'THINOUTLINE')
  1105.             HolyPower:SetTextColor(playerColor.r, playerColor.g, playerColor.b)
  1106.             HolyPower:SetJustifyH('CENTER')
  1107.             self:Tag(HolyPower, '[Aftermathh:HolyPower]')
  1108.         end
  1109.     end
  1110.  
  1111.     return self
  1112. end
  1113.  
  1114. local function menu(self)
  1115.     if(self.unit:match('party' or 'raid')) then
  1116.         ToggleDropDownMenu(1, nil, _G['PartyMemberFrame'..self.id..'DropDown'], 'cursor')
  1117.     else
  1118.         FriendsDropDown.unit = self.unit
  1119.         FriendsDropDown.id = self.id
  1120.         FriendsDropDown.initialize = RaidFrameDropDown_Initialize
  1121.         ToggleDropDownMenu(1, nil, FriendsDropDown, 'cursor')
  1122.     end
  1123. end
  1124.  
  1125. local function UpdateThreat(self, _, unit)
  1126.     if (self.unit ~= unit) then
  1127.         return
  1128.     end
  1129.  
  1130.     if (self.Aggro) then
  1131.         local threat = UnitThreatSituation(self.unit)
  1132.         if (threat == 3) then
  1133.             self.Aggro:SetText('|cFFFF0000AGGRO')
  1134.             self.Health:SetBackdropColor(0.9, 0, 0)
  1135.         else
  1136.             self.Aggro:SetText('')
  1137.             self.Health:SetBackdropColor(0, 0, 0)
  1138.         end
  1139.     end
  1140. end
  1141.  
  1142. local function RaidFrames(self, unit)
  1143.  
  1144.     self.menu = menu
  1145.     self:RegisterForClicks('AnyDown')
  1146.     self:SetScript('OnEnter', UnitFrame_OnEnter)
  1147.     self:SetScript('OnLeave', UnitFrame_OnLeave)
  1148.     self:SetAttribute('*type2', 'menu')
  1149.  
  1150.     CreateBorder(self, 11, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4)
  1151.  
  1152.     self:SetBackdrop({bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=], insets = {top = -1.5, left = -1.5, bottom = -1.5, right = -1.5}})
  1153.     self:SetBackdropColor(0, 0, 0, 0.8)
  1154.    
  1155.     self.DebuffHighlightBackdrop = true
  1156.     self.DebuffHighlightFilter = true
  1157.    
  1158.     self.Health = CreateFrame('StatusBar', nil, self)
  1159.     self.Health:SetStatusBarTexture(texture)
  1160.     self.Health:SetParent(self)
  1161.     self.Health:SetAllPoints(self)
  1162.    
  1163.     self.Health.Smooth = true
  1164.     self.Health.colorClass = true
  1165.  
  1166.     self.Health:SetOrientation('HORIZONTAL')
  1167.     self.Health:SetOrientation('VERTICAL')
  1168.    
  1169.     self.Health.bg = self.Health:CreateTexture(nil, 'BORDER')
  1170.     self.Health.bg:SetAllPoints(self.Health)
  1171.     self.Health.bg:SetTexture(texture)
  1172.     self.Health.bg:SetAlpha(0.4)
  1173.    
  1174.     self.Name = self.Health:CreateFontString(nil, 'OVERLAY')
  1175.     self.Name:SetPoint('TOP', 0, -12)
  1176.     self.Name:SetFont(font, 11, 'THINOUTLINE')
  1177.     self:Tag(self.Name, '|cffffffff[AfterRaidName]|r')
  1178.  
  1179.     self.MasterLooter = self.Health:CreateTexture('$parentMasterLooterIcon', 'OVERLAY', self)
  1180.     self.MasterLooter:SetHeight(12)
  1181.     self.MasterLooter:SetWidth(12)
  1182.     self.MasterLooter:SetPoint('RIGHT', self.Health, 'TOPRIGHT', 2, 2)
  1183.  
  1184.     self.Leader = self.Health:CreateTexture('$parentLeaderIcon', 'OVERLAY', self)
  1185.     self.Leader:SetHeight(14)
  1186.     self.Leader:SetWidth(14)
  1187.     self.Leader:SetPoint('LEFT', self.Health, 'TOPLEFT', -5, 2)
  1188.  
  1189.     self.RaidIcon = self.Health:CreateTexture(nil, 'OVERLAY')
  1190.     self.RaidIcon:SetHeight(17)
  1191.     self.RaidIcon:SetWidth(17)
  1192.     self.RaidIcon:SetPoint('CENTER', self, 'TOP')
  1193.     self.RaidIcon:SetTexture('Interface\\TargetingFrame\\UI-RaidTargetingIcons')
  1194.  
  1195.     self.ReadyCheck = self.Health:CreateTexture(nil, 'OVERLAY')
  1196.     self.ReadyCheck:SetPoint('TOPRIGHT', self.Health, -7, -7)
  1197.     self.ReadyCheck:SetPoint('BOTTOMLEFT', self.Health, 7, 7)
  1198.     self.ReadyCheck.delayTime = 4
  1199.     self.ReadyCheck.fadeTime = 1
  1200.    
  1201.     self.Aggro = self.Health:CreateFontString(nil, 'OVERLAY')
  1202.     self.Aggro:SetPoint('CENTER', self.Health, 'BOTTOM')
  1203.     self.Aggro:SetFont(font, 11, 'THINOUTLINE')
  1204.    
  1205.     table.insert(self.__elements, UpdateThreat)
  1206.     self:RegisterEvent('PLAYER_TARGET_CHANGED', UpdateThreat)
  1207.     self:RegisterEvent('UNIT_THREAT_LIST_UPDATE', UpdateThreat)
  1208.     self:RegisterEvent('UNIT_THREAT_SITUATION_UPDATE', UpdateThreat)
  1209.  
  1210.     self.Range = {
  1211.         insideAlpha = 1,
  1212.         outsideAlpha = 0.3,
  1213.     }
  1214.    
  1215.     self.SpellRange = {
  1216.         insideAlpha = 1,
  1217.         outsideAlpha = 0.3,
  1218.     }
  1219.    
  1220.     return self
  1221. end
  1222.  
  1223. CompactRaidFrameManager:UnregisterAllEvents()
  1224. CompactRaidFrameManager:Hide()
  1225. CompactRaidFrameContainer:UnregisterAllEvents()
  1226. CompactRaidFrameContainer:Hide()
  1227. CompactRaidFrameContainer:Hide()
  1228.  
  1229. oUF:RegisterStyle('AftermathhRaid', RaidFrames)
  1230.  
  1231. oUF:Factory(function(self)
  1232.   oUF:SetActiveStyle'AftermathhRaid'
  1233.  
  1234.     local Raid = self:SpawnHeader(nil, nil, 'solo,party,raid',
  1235.         'showPlayer', true,
  1236.         'showRaid', true,
  1237.         'showParty', false,
  1238.         'showSolo', false,
  1239.         'xoffset', 12,
  1240.         'yOffset', -5,
  1241.         'point', 'LEFT',
  1242.         'groupFilter', '1,2,3,4,5,6,7,8',
  1243.         'groupingOrder', '1,2,3,4,5,6,7,8',
  1244.         'groupBy', 'GROUP',
  1245.         'maxColumns', 12,
  1246.         'unitsPerColumn', 5,
  1247.         'columnSpacing', 12,
  1248.         'columnAnchorPoint', 'TOP',
  1249.         'oUF-initialConfigFunction', [[
  1250.             self:SetHeight(38)
  1251.             self:SetWidth(42)
  1252.             self:SetScale(1)
  1253.         ]]
  1254.     )
  1255.     Raid:SetPoint('TOPLEFT', UIParent, 10, -9)
  1256.    
  1257. end)
  1258.  
  1259. oUF:RegisterStyle('Aftermathh', Shared)
  1260.  
  1261. oUF:Factory(function(self)
  1262.   oUF:SetActiveStyle'Aftermathh'
  1263.    
  1264.     self:Spawn'Player':SetPoint('BOTTOMLEFT', UIParent, 196, 186)
  1265.     self:Spawn'Target':SetPoint('BOTTOMRIGHT', UIParent, -226, 186)
  1266.     self:Spawn'Targettarget':SetPoint('RIGHT', UIParent, -64, -188)
  1267.     self:Spawn'Pet':SetPoint('LEFT', UIParent, 105, -156)
  1268.     self:Spawn'Focus':SetPoint('LEFT', UIParent, 108, -45)
  1269.     --self:Spawn'Focustarget':SetPoint('LEFT', UIParent, 17, -3)
  1270.    
  1271.     local Party = self:SpawnHeader(nil, nil, 'party',
  1272.         'showParty', true,
  1273.         'showPlayer', false,
  1274.         'xoffset', 25,
  1275.         'yOffset', -50,
  1276.         'oUF-initialConfigFunction', [[
  1277.             self:SetHeight(27)
  1278.             self:SetWidth(150)
  1279.             self:SetScale(0.95)
  1280.         ]]
  1281.     )
  1282.     Party:SetPoint('TOPLEFT', UIParent, 92, -12)
  1283.    
  1284.     if(BossFrame) then
  1285.         local boss = {}
  1286.         for i = 1, MAX_BOSS_FRAMES do
  1287.             boss[i] = oUF:Spawn('boss'..i, 'oUF_BossAftermathh'..i)
  1288.             if i == 1 then
  1289.                 boss[i]:SetPoint('TOPRIGHT', UIParent, -16, -490)
  1290.             else
  1291.                 boss[i]:SetPoint('BOTTOM', boss[i-1], 'TOP', 0, 55)            
  1292.             end
  1293.            
  1294.             boss[i]:SetSize(150, 27)
  1295.             boss[i]:SetScale(0.95)
  1296.         end
  1297.     end
  1298.    
  1299. end)
  1300.  
  1301. SlashCmdList['TESTBOSS'] = function()
  1302.     oUF_BossAftermathh1:Show(); oUF_BossAftermathh1.Hide = function() end oUF_BossAftermathh1.unit = 'player'
  1303.     oUF_BossAftermathh2:Show(); oUF_BossAftermathh2.Hide = function() end oUF_BossAftermathh2.unit = 'player'
  1304.     oUF_BossAftermathh3:Show(); oUF_BossAftermathh3.Hide = function() end oUF_BossAftermathh3.unit = 'player'
  1305.     oUF_BossAftermathh4:Show(); oUF_BossAftermathh4.Hide = function() end oUF_BossAftermathh4.unit = 'player'
  1306. end
  1307. SLASH_TESTBOSS1 = '/testboss'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement