Advertisement
Guest User

Untitled

a guest
Dec 11th, 2014
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 38.88 KB | None | 0 0
  1. --oUF_Terenna
  2. local _, ns = ...
  3. local oUF = ns.oUF or oUF
  4.  
  5. --local FONT    = [=[Interface\AddOns\oUF_Terenna\Font.ttf]=]
  6. local FONT      = [=[Interface\AddOns\oUF_P3lim\pixel.ttf]=]
  7. local TEXTURE   = [=[Interface\ChatFrame\ChatFrameBackground]=]
  8. local BACKDROP  = {
  9.     bgFile = TEXTURE,
  10.     insets = {top = -1, bottom = -1, left = -1, right = -1}
  11. }
  12.  
  13. local function round(val, decimal)
  14.     if (decimal) then
  15.         return math.floor((val*10^decimal) + 0.5) / (10^decimal)
  16.     else
  17.         return math.floor(val + 0.5)
  18.     end
  19. end
  20.  
  21. local UnitSpecific = {
  22.     player = function(self)
  23.         self:SetSize(250, 32)
  24.         self:SetBackdrop(BACKDROP)
  25.         self:SetBackdropColor(0, 0, 0)
  26.         -----------------------
  27.         --Player Health Stuff--
  28.         -----------------------
  29.         local Health = CreateFrame('StatusBar', nil, self)
  30.             Health:SetHeight(29)
  31.             Health:SetPoint('TOPLEFT')
  32.             Health:SetPoint('TOPRIGHT')
  33.             Health:SetStatusBarTexture(TEXTURE)
  34.             Health:SetStatusBarColor(0.2, 0.2, 0.2)
  35.             Health.frequentUpdates = true
  36.             self.Health = Health
  37.    
  38.         local HealthBG = Health:CreateTexture(nil, 'BORDER')
  39.             HealthBG:SetAllPoints()
  40.             HealthBG:SetTexture(.55, .1, .1)
  41.             self.HealthBG = HealthBG
  42.            
  43.         local playerhealthtextframe = CreateFrame('Button', 'PlayerHealthTextFrame', self)
  44.             playerhealthtextframe:SetSize(350, 10)
  45.             playerhealthtextframe:SetPoint('TOP', self, 'TOP')
  46.             playerhealthtextframe:EnableMouse(false)
  47.             playerhealthtextframe:RegisterEvent('PLAYER_ENTERING_WORLD')
  48.             playerhealthtextframe:RegisterUnitEvent('UNIT_HEALTH', 'player', 'vehicle')
  49.             playerhealthtextframe:RegisterUnitEvent('UNIT_ENTERED_VEHICLE', 'player')
  50.             playerhealthtextframe:RegisterUnitEvent('UNIT_EXITED_VEHICLE', 'player')
  51.        
  52.         local playerhealthtext = playerhealthtextframe:CreateFontString('PlayerHealthText', 'OVERLAY')
  53.             playerhealthtext:SetSize(50, 10)
  54.             playerhealthtext:SetPoint('RIGHT', 'PlayerHealthTextFrame', 'RIGHT', 5, -10)
  55.             playerhealthtext:SetFont(FONT, 10, 'OUTLINE')
  56.             playerhealthtext:SetJustifyH('LEFT')
  57.            
  58.         local playerhealthpercenttext = playerhealthtextframe:CreateFontString('PlayerHealthPercentText', 'OVERLAY')
  59.             playerhealthpercenttext:SetSize(50, 10)
  60.             playerhealthpercenttext:SetPoint('LEFT', 'PlayerHealthTextFrame', 'LEFT', -5, -10)
  61.             playerhealthpercenttext:SetFont(FONT, 10, 'OUTLINE')
  62.             playerhealthpercenttext:SetJustifyH('RIGHT')
  63.                
  64.         local playerhealthcurrent, playerhealthmax, r, g, playervehiclestatus
  65.         playerhealthtextframe:SetScript('OnEvent', function(self, event, unit)
  66.             if UnitIsGhost('player') then
  67.                 return playerhealthtext:SetText('|cffb40000Ghost'), playerhealthpercenttext:SetText('')
  68.             elseif UnitIsDead('player') then
  69.                 return playerhealthtext:SetText('|cffb40000Dead'), playerhealthpercenttext:SetText('')
  70.             elseif (event == 'PLAYER_ENTERING_WORLD' and UnitInVehicle('player')) or event == 'UNIT_ENTERED_VEHICLE' then
  71.                 playervehiclestatus = 'vehicle'
  72.                 playerhealthtextframe:UnregisterEvent('UNIT_HEALTH')
  73.                 playerhealthtextframe:RegisterUnitEvent('UNIT_HEALTH', 'vehicle')
  74.             elseif event == 'PLAYER_ENTERING_WORLD' or event == 'UNIT_EXITED_VEHICLE' then
  75.                 playervehiclestatus = 'player'
  76.                 playerhealthtextframe:UnregisterEvent('UNIT_HEALTH')
  77.                 playerhealthtextframe:RegisterUnitEvent('UNIT_HEALTH', 'player')
  78.             end
  79.            
  80.             playerhealthcurrent, playerhealthmax = UnitHealth(playervehiclestatus), UnitHealthMax(playervehiclestatus)
  81.            
  82.             if playerhealthcurrent < playerhealthmax then
  83.                 r, g = 180, 0
  84.             else
  85.                 r, g = 0, 180
  86.             end
  87.            
  88.             local a = round(100*(playerhealthcurrent/playerhealthmax))
  89.             if playerhealthcurrent >= 1000000 then
  90.                 playerhealthcurrent = format('%.1fm', playerhealthcurrent/1000000)
  91.             elseif playerhealthcurrent >= 1000 then
  92.                 playerhealthcurrent = format('%.0fk', playerhealthcurrent/1000)
  93.             end
  94.            
  95.             playerhealthtext:SetFormattedText('|cff%02x%02x%02x%s', r, g, 0, playerhealthcurrent)
  96.             playerhealthpercenttext:SetFormattedText('|cff%02x%02x%02x%s'..'%%', r, g, 0, a)
  97.         end)
  98.         -------------------------------------
  99.         --Player Incoming Heals/Absorbs Bar--
  100.         -------------------------------------
  101.         local playerincominghealsbar = CreateFrame('StatusBar', nil, self.Health)
  102.             playerincominghealsbar:SetPoint('TOP')
  103.             playerincominghealsbar:SetPoint('BOTTOM')
  104.             playerincominghealsbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
  105.             playerincominghealsbar:SetWidth(250) --this would need to change if resized playerframe
  106.             playerincominghealsbar:SetStatusBarColor(0, 0.7, 0, 1) --green for heals
  107.        
  108.         local playerabsorbbar = CreateFrame('StatusBar', nil, self.Health)
  109.             playerabsorbbar:SetPoint('TOP')
  110.             playerabsorbbar:SetPoint('BOTTOM')
  111.             playerabsorbbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
  112.             playerabsorbbar:SetWidth(250) --this would need to change if resized playerframe
  113.             playerabsorbbar:SetStatusBarColor(0, 0, 0.7, 1) --blue for absorbs
  114.        
  115.             self.HealPrediction = {
  116.                 playerincominghealsbar  = myBar,
  117.                 playerabsorbbar         = absorbBar,
  118.                 maxOverflow             = 1, --playerhealthtext is pretty close to outside of frame, don't want shitty looking overlap, plus we're generally not concerned about our health when we're at or near full
  119.                 frequentUpdates         = true
  120.             }
  121.         ----------------------
  122.         --Player Power Stuff--
  123.         ----------------------
  124.         local Power = CreateFrame('StatusBar', nil, self)
  125.             Power:SetPoint('BOTTOMRIGHT')
  126.             Power:SetPoint('BOTTOMLEFT')
  127.             Power:SetPoint('TOP', Health, 'BOTTOM', 0, -1)
  128.             Power:SetStatusBarTexture(TEXTURE)
  129.             Power.frequentUpdates = true
  130.             Power.colorClass = true
  131.             self.Power = Power
  132.            
  133.         local PowerBG = Power:CreateTexture(nil, 'BORDER')
  134.             PowerBG:SetAllPoints()
  135.             PowerBG:SetTexture(TEXTURE)
  136.             PowerBG.multiplier = 1/3
  137.             Power.bg = PowerBG
  138.        
  139.         local playerpowertextframe = CreateFrame('Button', 'PlayerPowerTextFrame', self)
  140.             playerpowertextframe:SetSize(40,10)
  141.             playerpowertextframe:SetPoint('BOTTOMLEFT', self, 'BOTTOMRIGHT', 5, 0)
  142.             playerpowertextframe:EnableMouse(false)
  143.             playerpowertextframe:RegisterEvent('PLAYER_ENTERING_WORLD')
  144.             playerpowertextframe:RegisterUnitEvent('UNIT_POWER_FREQUENT', 'player', 'vehicle')
  145.             playerpowertextframe:RegisterUnitEvent('UNIT_ENTERED_VEHICLE', 'player')
  146.             playerpowertextframe:RegisterUnitEvent('UNIT_EXITED_VEHICLE', 'player')
  147.             playerpowertextframe:RegisterUnitEvent('UNIT_DISPLAYPOWER', 'player')
  148.  
  149.         local playerpowertext = playerpowertextframe:CreateFontString('PlayerPowerText', 'OVERLAY')
  150.             playerpowertext:SetAllPoints()
  151.             playerpowertext:SetFont(FONT, 10, 'OUTLINE')
  152.             playerpowertext:SetJustifyH('LEFT')
  153.  
  154.         local playerpowercurrent, playervehiclepowerstatus, pr, pg, pb
  155.         playerpowertextframe:SetScript('OnEvent', function(self, event, unit)
  156.             if (event == 'PLAYER_ENTERING_WORLD' and UnitInVehicle('player')) or event == 'UNIT_ENTERED_VEHICLE' then
  157.                 playervehiclepowerstatus = 'vehicle'
  158.                 playerpowertextframe:UnregisterEvent('UNIT_POWER_FREQUENT')
  159.                 playerpowertextframe:RegisterUnitEvent('UNIT_POWER_FREQUENT', 'vehicle')
  160.                 playerpowertype = select(2,UnitPowerType('vehicle'))
  161.             elseif event == 'PLAYER_ENTERING_WORLD' or event == 'UNIT_EXITED_VEHICLE' then
  162.                 playervehiclepowerstatus = 'player'
  163.                 playerpowertextframe:UnregisterEvent('UNIT_POWER_FREQUENT')
  164.                 playerpowertextframe:RegisterUnitEvent('UNIT_POWER_FREQUENT', 'player')
  165.                 playerpowertype = select(2,UnitPowerType('player'))
  166.             elseif event == 'UNIT_DISPLAYPOWER' then
  167.                 playerpowertype = select(2,UnitPowerType(playervehiclepowerstatus))
  168.             end
  169.            
  170.             playerpowercurrent = UnitPower(playervehiclepowerstatus)
  171.            
  172.             if playerpowertype and playerpowercurrent > 0 then
  173.                 if playerpowertype == 'MANA' then
  174.                     pr, pg, pb = 0, 100, 255
  175.                     if playerpowercurrent >= 1000000 then
  176.                         playerpowercurrent = format('%.1fm', playerpowercurrent / 1000000)
  177.                     elseif playerpowercurrent >= 1000 then
  178.                         playerpowercurrent = format('%.0fk', playerpowercurrent / 1000)
  179.                     end
  180.                 elseif playerpowertype == 'FOCUS' then
  181.                     pr, pg, pb = 255, 128, 65
  182.                 elseif playerpowertype == 'ENERGY' then
  183.                     pr, pg, pb = 255, 255, 0
  184.                 elseif playerpowertype == 'RUNIC_POWER' then
  185.                     pr, pg, pb = 0, 209, 255
  186.                 else
  187.                     pr, pg, pb = 255, 0, 0
  188.                 end
  189.                 playerpowertext:SetFormattedText('|cff%02x%02x%02x%s', pr, pg, pb, playerpowercurrent)
  190.             else
  191.                 playerpowertext:SetText('')
  192.             end
  193.         end)
  194.         --------------------
  195.         --Player Raid Icon--
  196.         --------------------
  197.         local RaidIcon = Health:CreateTexture(nil, 'OVERLAY')
  198.             RaidIcon:SetPoint('TOP', self, 0, 8)
  199.             RaidIcon:SetSize(16, 16)
  200.             self.RaidIcon = RaidIcon
  201.         -------------------------
  202.         --Leader/Assist Texture--
  203.         -------------------------
  204.         local leaderassistframe = CreateFrame('Button', 'PlayerLeaderAssistFrame', self)
  205.             leaderassistframe:SetSize(3,8)
  206.             leaderassistframe:SetPoint('TOPLEFT', self, 'TOPLEFT', 2, 0)
  207.             leaderassistframe:RegisterEvent('GROUP_ROSTER_UPDATE')
  208.             leaderassistframe:RegisterEvent('PARTY_LEADER_CHANGED')
  209.             leaderassistframe:RegisterEvent('PLAYER_ENTERING_WORLD')
  210.            
  211.         local leaderassisttexture = leaderassistframe:CreateTexture('PlayerLeaderAssistTexture', 'OVERLAY')
  212.             --leaderassisttexture:SetTexture('Interface\AddOns\oUF_Terenna\Status_Texture', 'OVERLAY')
  213.             leaderassisttexture = leaderassistframe:CreateTexture('Interface\AddOns\oUF_P3lim\F1_StatusBox_Bar', 'OVERLAY')
  214.             leaderassisttexture:SetTexture(1, 1, 0)
  215.             leaderassisttexture:SetAllPoints(true)
  216.            
  217.         leaderassistframe:SetScript('OnEvent', function(self, event, unit)
  218.             if UnitIsGroupLeader('player') or UnitIsRaidOfficer('player') then
  219.                 leaderassisttexture:Show()
  220.             else
  221.                 leaderassisttexture:Hide()
  222.             end
  223.         end)
  224.         -------------------------
  225.         --Player Combat Texture--
  226.         -------------------------
  227.         local playercombatframe = CreateFrame('Button', 'PlayerCombatFrame', self)
  228.             playercombatframe:SetSize(3,8)
  229.             playercombatframe:SetPoint('TOPLEFT', self, 'TOPLEFT', 7,0)
  230.             playercombatframe:RegisterEvent('PLAYER_ENTERING_WORLD')
  231.             playercombatframe:RegisterEvent('PLAYER_REGEN_DISABLED')
  232.             playercombatframe:RegisterEvent('PLAYER_REGEN_ENABLED')
  233.        
  234.         local playercombattexture = playercombatframe:CreateTexture('PlayerCombatTexture', 'OVERLAY')
  235.             --playercombattexture:SetTexture('Interface\AddOns\oUF_Terenna\Status_Texture', 'OVERLAY')
  236.             playercombattexture:SetTexture('Interface\AddOns\oUF_P3lim\F1_StatusBox_Bar', 'OVERLAY')
  237.             playercombattexture:SetTexture(1,0,0)
  238.             playercombattexture:SetAllPoints(true)
  239.             playercombattexture:Hide()
  240.        
  241.         playercombatframe:SetScript('OnEvent', function(self, event, unit)
  242.             if event == 'PLAYER_REGEN_DISABLED' then
  243.                 playercombattexture:Show()
  244.             elseif event == 'PLAYER_REGEN_ENABLED' then
  245.                 playercombattexture:Hide()
  246.             elseif (event == 'PLAYER_ENTERING_WORLD' and UnitAffectingCombat('player')) then
  247.                 playercombattexture:Show()
  248.             end
  249.         end)
  250.         --------------------------
  251.         --Player Resting Texture--
  252.         --------------------------
  253.         local playerrestingframe = CreateFrame('Button', 'PlayerRestingFrame', self)
  254.             playerrestingframe:SetSize(3,8)
  255.             playerrestingframe:SetPoint('TOPLEFT', self, 'TOPLEFT', 12, 0)
  256.             playerrestingframe:RegisterEvent('PLAYER_ENTERING_WORLD')
  257.             playerrestingframe:RegisterEvent('PLAYER_UPDATE_RESTING')
  258.    
  259.         local playerrestingtexture = playerrestingframe:CreateTexture('PlayerRestingTexture', 'OVERLAY')
  260.             --playerrestingtexture:SetTexture('Interface\AddOns\oUF_Terenna\Status_Texture', 'OVERLAY')
  261.             playerrestingtexture:SetTexture('Interface\AddOns\oUF_P3lim\F1_StatusBox_Bar', 'OVERLAY')
  262.             playerrestingtexture:SetTexture(0.41, 0.8, 0.94)
  263.             playerrestingtexture:SetAllPoints(true)
  264.        
  265.         playerrestingframe:SetScript('OnEvent', function(self, event, unit)
  266.             if IsResting() then
  267.                 playerrestingtexture:Show()
  268.             else
  269.                 playerrestingtexture:Hide()
  270.             end
  271.         end)
  272.         -------------------
  273.         --Player Buff Bar--
  274.         -------------------
  275.         local BuffBars = CreateFrame('Frame', 'PlayerBuffBarFrame', self)
  276.             BuffBars:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 0, 17)
  277.             BuffBars:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', -20, 17)
  278.             BuffBars.fontFile = FONT
  279.             self.BuffBars = BuffBars
  280.             BuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, casterUnit, _, _, spellID, _, _, _, _, _)
  281.                 if casterUnit == 'vehicle' or
  282.                        spellID == 2823      --deadly poison
  283.                     or spellID == 108211    --leeching poison
  284.                     or spellID == 3408      --crippling poison
  285.                     or spellID == 8679      --wound poison
  286.                     or spellID == 5171      --slice and dice
  287.                     or spellID == 84745     --shallow insight
  288.                     or spellID == 84746     --moderate insight
  289.                     or spellID == 84747     --deep insight
  290.                     or spellID == 1784      --stealth
  291.                     or spellID == 115191    --subterfuge stealth
  292.                     or spellID == 13877     --blade flurry
  293.                     or spellID == 13750     --adrenaline rush
  294.                     or spellID == 1966      --feint
  295.                     or spellID == 73651     --recuperate
  296.                     or spellID == 31224     --cloak of shadows
  297.                     or spellID == 80353     --time warp
  298.                     or spellID == 90355     --ancient hysteria
  299.                     or spellID == 2983      --sprint
  300.                     or spellID == 137573    --burst of speed
  301.                     or spellID == 54861     --nitro boosts
  302.                     or spellID == 36554     --shadowstep speed buff
  303.                     or spellID == 5277      --evasion
  304.                     or spellID == 74001     --combat readiness
  305.                     or spellID == 74002     --combat insight
  306.                     or spellID == 114018    --shroud of concealment
  307.                     or spellID == 32182     --heroism
  308.                     or spellID == 146555    --drums of rage
  309.                     or spellID == 32645     --envenom
  310.                     or spellID == 31665     --master of subtlety
  311.                     or spellID == 115192    --subterfuge
  312.                     or spellID == 51713 then--shadowdance
  313.                     return true
  314.                 else
  315.                     return false
  316.                 end
  317.             end
  318.         ---------------------
  319.         --Player Debuff Bar--
  320.         ---------------------
  321.         local DebuffBars = CreateFrame("Frame", 'PlayerDebuffBarFrame', self)
  322.             DebuffBars:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -100)
  323.             DebuffBars:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', -20, -100)
  324.             DebuffBars.growDown = true
  325.             DebuffBars.dispelTypeColors = true
  326.             DebuffBars.fontFile = FONT
  327.             self.DebuffBars = DebuffBars
  328.             DebuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, _, _)
  329.                 if spellID ~= 95223 then
  330.                     return true
  331.                 end
  332.             end
  333.     end,
  334.     target = function(self)
  335.         self:SetSize(250, 32)
  336.         self:SetBackdrop(BACKDROP)
  337.         self:SetBackdropColor(0, 0, 0)
  338.         -----------------------
  339.         --Target Health Stuff--
  340.         -----------------------
  341.         local Health = CreateFrame('StatusBar', nil, self)
  342.             Health:SetHeight(29)
  343.             Health:SetPoint('TOPLEFT')
  344.             Health:SetPoint('TOPRIGHT')
  345.             Health:SetStatusBarTexture(TEXTURE)
  346.             Health.frequentUpdates = true
  347.             Health.colorTapping = true
  348.             Health.colorDisconnected = true
  349.             Health.colorHealth = true
  350.             self.Health = Health
  351.             self.colors.health[1], self.colors.health[2], self.colors.health[3] = 0.2, 0.2, 0.2
  352.    
  353.         local HealthBG = Health:CreateTexture(nil, 'BORDER')
  354.             HealthBG:SetAllPoints()
  355.             HealthBG:SetTexture(.55, .1, .1)
  356.             self.HealthBG = HealthBG
  357.        
  358.         local targethealthtextframe = CreateFrame('Button', 'TargetHealthTextFrame', self)
  359.             targethealthtextframe:SetSize(350, 10)
  360.             targethealthtextframe:SetPoint('TOP', self, 'TOP')
  361.             targethealthtextframe:EnableMouse(false)
  362.             targethealthtextframe:RegisterEvent('PLAYER_TARGET_CHANGED')
  363.             targethealthtextframe:RegisterUnitEvent('UNIT_HEALTH', 'target')
  364.             targethealthtextframe:RegisterUnitEvent('UNIT_CONNECTION', 'target')
  365.        
  366.         local targethealthtext = targethealthtextframe:CreateFontString('TargetHealthText', 'OVERLAY')
  367.             targethealthtext:SetSize(50, 10)
  368.             targethealthtext:SetPoint('LEFT', 'TargetHealthTextFrame', 'LEFT', -5, -10)
  369.             targethealthtext:SetFont(FONT, 10, 'OUTLINE')
  370.             targethealthtext:SetJustifyH('RIGHT')
  371.            
  372.         local targethealthpercenttext = targethealthtextframe:CreateFontString('TargetHealthPercentText', 'OVERLAY')
  373.             targethealthpercenttext:SetSize(50, 10)
  374.             targethealthpercenttext:SetPoint('RIGHT', 'TargetHealthTextFrame', 'RIGHT', 5, -10)
  375.             targethealthpercenttext:SetFont(FONT, 10, 'OUTLINE')
  376.             targethealthpercenttext:SetJustifyH('LEFT')
  377.                
  378.         local targethealthcurrent, targethealthmax, r, g
  379.         targethealthtextframe:SetScript('OnEvent', function(self, event, unit)
  380.             if event == 'UNIT_CONNECTION' and not UnitIsConnected('target') then
  381.                 return targethealthframetext:SetFormattedText('|cffb40000D/C'), targethealthpercenttext:SetText('')
  382.             elseif UnitIsGhost('target') then
  383.                 return targethealthtext:SetText('|cffb40000Ghost'), targethealthpercenttext:SetText('')
  384.             elseif UnitIsDead('target') then
  385.                 return targethealthtext:SetText('|cffb40000Dead'), targethealthpercenttext:SetText('')
  386.             else
  387.                 targethealthcurrent, targethealthmax = UnitHealth('target'), UnitHealthMax('target')
  388.             end
  389.            
  390.             if targethealthcurrent < targethealthmax * .35 then
  391.                 r, g = 180, 0
  392.             else
  393.                 r, g = 0, 180
  394.             end
  395.            
  396.             local a = round(100*(targethealthcurrent/targethealthmax))
  397.             if targethealthcurrent >= 1000000 then
  398.                 targethealthcurrent = format('%.1fm', targethealthcurrent / 1000000)
  399.             elseif targethealthcurrent >= 1000 then
  400.                 targethealthcurrent = format('%.0fk', targethealthcurrent / 1000)
  401.             end
  402.            
  403.             targethealthtext:SetFormattedText('|cff%02x%02x%02x%s', r, g, 0, targethealthcurrent)
  404.             targethealthpercenttext:SetFormattedText('|cff%02x%02x%02x%s'..'%%', r, g, 0, a)
  405.         end)
  406.         -------------------------------------
  407.         --Target Incoming Heals/Absorbs Bar--
  408.         -------------------------------------
  409.         local targetincominghealsbar = CreateFrame('StatusBar', nil, self.Health)
  410.             targetincominghealsbar:SetPoint('TOP')
  411.             targetincominghealsbar:SetPoint('BOTTOM')
  412.             targetincominghealsbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
  413.             targetincominghealsbar:SetWidth(250) --has to change if target width changes
  414.             targetincominghealsbar:SetStatusBarColor(0, 0.7, 0, 1)
  415.        
  416.         local targetabsorbbar = CreateFrame('StatusBar', nil, self.Health)
  417.             targetabsorbbar:SetPoint('TOP')
  418.             targetabsorbbar:SetPoint('BOTTOM')
  419.             targetabsorbbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
  420.             targetabsorbbar:SetWidth(250) --has to change if target width changes
  421.             targetabsorbbar:SetStatusBarColor(0, 0, 0.7, 1)
  422.        
  423.             self.HealPrediction = {
  424.                 playerincominghealsbar  = myBar,
  425.                 playerabsorbbar         = absorbBar,
  426.                 maxOverflow             = 1,
  427.                 frequentUpdates         = true
  428.             }
  429.         ----------------------
  430.         --Target Power Stuff--
  431.         ----------------------
  432.         local Power = CreateFrame('StatusBar', nil, self)
  433.             Power:SetPoint('BOTTOMRIGHT')
  434.             Power:SetPoint('BOTTOMLEFT')
  435.             Power:SetPoint('TOP', Health, 'BOTTOM', 0, -1)
  436.             Power:SetStatusBarTexture(TEXTURE)
  437.             Power.frequentUpdates   = true
  438.             Power.colorClass        = true
  439.             Power.colorClassNPC     = true
  440.             Power.colorClassPet     = true
  441.             self.Power = Power
  442.            
  443.         local PowerBG = Power:CreateTexture(nil, 'BORDER')
  444.             PowerBG:SetAllPoints()
  445.             PowerBG:SetTexture(TEXTURE)
  446.             PowerBG.multiplier = 1/3
  447.             Power.bg = PowerBG
  448.        
  449.         local targetpowerframe = CreateFrame('Button', 'TargetPowerTextFrame', self)
  450.             targetpowerframe:SetSize(40,10)
  451.             targetpowerframe:SetPoint('BOTTOMRIGHT', self, 'BOTTOMLEFT', -5, 0)
  452.             targetpowerframe:EnableMouse(false)
  453.             targetpowerframe:RegisterEvent('PLAYER_TARGET_CHANGED')
  454.             targetpowerframe:RegisterUnitEvent('UNIT_POWER_FREQUENT', 'target')
  455.             targetpowerframe:RegisterUnitEvent('UNIT_DISPLAYPOWER', 'target')
  456.  
  457.         local targetpowertext = targetpowerframe:CreateFontString('TargetPowerText', 'OVERLAY')
  458.             targetpowertext:SetAllPoints()
  459.             targetpowertext:SetFont(FONT, 10, 'OUTLINE')
  460.             targetpowertext:SetJustifyH('RIGHT')
  461.  
  462.         local targetpowercurrent, pr, pg, pb
  463.         targetpowerframe:SetScript('OnEvent', function(self, event, unit)
  464.             if event == 'UNIT_DISPLAYPOWER' or event == 'PLAYER_TARGET_CHANGED' then   
  465.                 targetpowertype = select(2,UnitPowerType('target'))
  466.             end
  467.            
  468.             targetpowercurrent = UnitPower('target')
  469.            
  470.             if targetpowertype and targetpowercurrent > 0 then
  471.                 if targetpowertype == 'MANA' then
  472.                     pr, pg, pb = 0, 100, 255
  473.                     if targetpowercurrent >= 1000000 then
  474.                         targetpowercurrent = format('%.1fm', targetpowercurrent / 1000000)
  475.                     elseif targetpowercurrent >= 1000 then
  476.                         targetpowercurrent = format('%.0fk', targetpowercurrent / 1000)
  477.                     end
  478.                 elseif targetpowertype == 'FOCUS' then
  479.                     pr, pg, pb = 255, 128, 65
  480.                 elseif targetpowertype == 'ENERGY' then
  481.                     pr, pg, pb = 255, 255, 0
  482.                 elseif targetpowertype == 'RUNIC_POWER' then
  483.                     pr, pg, pb = 0, 209, 255
  484.                 else
  485.                     pr, pg, pb = 255, 0, 0
  486.                 end
  487.                 targetpowertext:SetFormattedText('|cff%02x%02x%02x%s', pr, pg, pb, targetpowercurrent)
  488.             else
  489.                 targetpowertext:SetText('')
  490.             end
  491.         end)
  492.         --------------------------
  493.         --Target Name/Level Text--
  494.         --------------------------
  495.         local targetnameleveltextframe = CreateFrame('Button', 'TargetNameLevelTextFrame', self)
  496.             targetnameleveltextframe:SetSize(200, 10)
  497.             targetnameleveltextframe:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 0, -5)
  498.             targetnameleveltextframe:EnableMouse(false)
  499.             targetnameleveltextframe:RegisterEvent('PLAYER_TARGET_CHANGED')
  500.             targetnameleveltextframe:RegisterUnitEvent('UNIT_LEVEL', 'target')
  501.             targetnameleveltextframe:RegisterUnitEvent('UNIT_NAME_UPDATE', 'target')
  502.            
  503.         local targetnameleveltext = targetnameleveltextframe:CreateFontString('TargetNameLevelText', 'OVERLAY')
  504.             targetnameleveltext:SetAllPoints()
  505.             targetnameleveltext:SetFont(FONT, 10, 'OUTLINE')
  506.             targetnameleveltext:SetJustifyH('RIGHT')
  507.        
  508.         targetnameleveltextframe:SetScript('OnEvent', function(self, event, unit)
  509.             local name, level =  UnitName('target'), UnitLevel('target')
  510.             local levelmax = GetMaxPlayerLevel()
  511.             local levelcolor = {}
  512.             local class, classfn = UnitClass('target')
  513.             local colorname = RAID_CLASS_COLORS[classfn]
  514.             if not name then
  515.                 targetnameleveltext:SetText('')
  516.             elseif not colorname then
  517.                 colorname = 255, 0, 0
  518.             else
  519.                 if level <= 0 then
  520.                     level = '??'
  521.                     levelcolor.r, levelcolor.g, levelcolor.b = 1, 1, 1
  522.                 elseif level == levelmax then
  523.                     levelcolor.r, levelcolor.g, levelcolor.b = 1, 1, 1
  524.                 else
  525.                     levelcolor = GetQuestDifficultyColor(level)
  526.                 end
  527.                 targetnameleveltext:SetFormattedText('|cff%02x%02x%02x%s '..'|cff%02x%02x%02x%s', 255*levelcolor.r, 255*levelcolor.g, 255*levelcolor.b, level, 255*colorname.r, 255*colorname.g, 255*colorname.b, name)
  528.             end
  529.         end)
  530.         --------------------
  531.         --Target Raid Icon--
  532.         --------------------
  533.         local RaidIcon = Health:CreateTexture(nil, 'OVERLAY')
  534.             RaidIcon:SetPoint('CENTER', self, 'TOP')
  535.             RaidIcon:SetSize(16, 16)
  536.             self.RaidIcon = RaidIcon
  537.         ------------------------
  538.         --Target Quest Texture--
  539.         ------------------------
  540.         local targetquesttextureframe = CreateFrame('Button', 'TargetQuestTextureFrame', self)
  541.             targetquesttextureframe:SetSize(10,10)
  542.             targetquesttextureframe:SetPoint('CENTER', self, 'CENTER')
  543.             targetquesttextureframe:EnableMouse(false)
  544.             targetquesttextureframe:RegisterEvent('PLAYER_TARGET_CHANGED')
  545.            
  546.         local targetquesttexture = targetquesttextureframe:CreateFontString('TargetQuestTexture', 'OVERLAY')
  547.             targetquesttexture:SetAllPoints()
  548.             targetquesttexture:SetFont(FONT, 20, 'OUTLINE')
  549.             targetquesttexture:SetJustifyH('CENTER')
  550.            
  551.         targetquesttextureframe:SetScript('OnEvent', function(self, event, unit)
  552.             if UnitIsQuestBoss('target') then
  553.                 targetquesttexture:SetFormattedText('|cff%02x%02x%02x!', 255, 255, 0)
  554.             else
  555.                 targetquesttexture:SetText('')
  556.             end
  557.         end)
  558.         -----------------------
  559.         --Target Rare Texture--
  560.         -----------------------
  561.         local targetraretextureframe = CreateFrame('Button', 'TargetRareTextureFrame', self)
  562.             targetraretextureframe:SetSize(3,8)
  563.             targetraretextureframe:SetPoint('TOPLEFT', self, 'TOPLEFT', 7, 0)
  564.             targetraretextureframe:EnableMouse(false)
  565.             targetraretextureframe:RegisterEvent('PLAYER_TARGET_CHANGED')
  566.             targetraretextureframe:RegisterUnitEvent('UNIT_CLASSIFICATION_CHANGED', 'target')
  567.            
  568.         local targetraretexture = targetraretextureframe:CreateTexture('TargetRareTexture', 'OVERLAY')
  569.             targetraretexture:SetTexture('Interface\AddOns\oUF_P3lim\F1_StatusBox_Bar', 'OVERLAY')
  570.             targetraretexture:SetTexture(.75, .75, .75)
  571.             targetraretexture:SetAllPoints()
  572.            
  573.         targetraretextureframe:SetScript('OnEvent', function(self, event, unit)
  574.             local classification = UnitClassification('target')
  575.             if classification == 'rare' or classification == 'rareelite' then
  576.                 targetraretexture:Show()
  577.             else
  578.                 targetraretexture:Hide()
  579.             end
  580.         end)
  581.         ------------------------
  582.         --Target Elite Texture--
  583.         ------------------------
  584.         local targetelitetextureframe = CreateFrame('Button', 'TargetEliteTextureFrame', self)
  585.             targetelitetextureframe:SetSize(3,8)
  586.             targetelitetextureframe:SetPoint('TOPLEFT', self, 'TOPLEFT', 2, 0)
  587.             targetelitetextureframe:EnableMouse(false)
  588.             targetelitetextureframe:RegisterEvent('PLAYER_TARGET_CHANGED')
  589.             targetelitetextureframe:RegisterUnitEvent('UNIT_CLASSIFICATION_CHANGED', 'target')
  590.            
  591.         local targetelitetexture = targetelitetextureframe:CreateTexture('TargetEliteStatusTexture', 'OVERLAY')
  592.             targetelitetexture:SetTexture('Interface\AddOns\oUF_P3lim\F1_StatusBox_Bar', 'OVERLAY')
  593.             targetelitetexture:SetTexture(.8, .63, .21)
  594.             targetelitetexture:SetAllPoints()
  595.            
  596.         targetelitetextureframe:SetScript('OnEvent', function(self, event, unit)
  597.             local classification = UnitClassification('target')
  598.             if classification == 'elite' or classification == 'rareelite' then
  599.                 targetelitetexture:Show()
  600.             else
  601.                 targetelitetexture:Hide()
  602.             end
  603.         end)
  604.         -------------------
  605.         --Target Buff Bar--
  606.         -------------------
  607.         local BuffBars = CreateFrame('Frame', 'TargetBuffBarFrame', self)
  608.             BuffBars:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 20, 17)
  609.             BuffBars:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', 0, 17)
  610.             self.BuffBars = BuffBars
  611.             BuffBars.fontFile = FONT
  612.             BuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, _, _)
  613.                 if spellID == 97341 or      --Guild Champion
  614.                     spellID == 93339 or     --Champion
  615.                     spellID == 93828 or     --Silvermoon Champion
  616.                     spellID == 93341 or     --Hyjal Champion
  617.                     spellID == 93347 or     --Therazane Champion
  618.                     spellID == 97340 or     --Guild Champion
  619.                     spellID == 93811 or     --Exodar Champion
  620.                     spellID == 93816 or     --Gilnean Champion
  621.                     spellID == 72968 or     --Precious's Ribbon
  622.                     spellID == 93806 or     --Darnassus Champion
  623.                     spellID == 93368 or     --Wildhammer Champion
  624.                     spellID == 93337 or     --Ramkahen Champion
  625.                     spellID == 126434 or    --Tushui Champion
  626.                     spellID == 57819 or     --Argent Chamption
  627.                     spellID == 57822 or     --Wyrmrest Champion
  628.                     spellID == 93821 or     --Gnomergan Champion
  629.                     spellID == 142234 or    --Brawling Champion (toot toot)
  630.                     spellID == 142239 or    --Brawling Champion (gorgeous)
  631.                     spellID == 142242 or    --Brawling Champion (south seas)
  632.                     spellID == 142243 or    --Brawling Champion (splat)
  633.                     spellID == 142244 or    --Brawling Champion (bruce)
  634.                     spellID == 142246 or    --Brawling Champion (rockpaperscissors)
  635.                     spellID == 142247 or    --Brawling Champion (blingtrong)
  636.                     spellID == 143625 or    --Brawling Champion (rank 10)
  637.                     spellID == 93805 or     --Ironforge Champion
  638.                     spellID == 25780 or     --Righteous Fury
  639.                     spellID == 17619 or     --Alchemist Stone
  640.                     spellID == 93795        --Stormwind Champion
  641.                 then
  642.                     return false
  643.                 else
  644.                     return true
  645.                 end
  646.             end
  647.         ---------------------
  648.         --Target Debuff Bar--
  649.         ---------------------
  650.         local DebuffBars = CreateFrame("Frame", 'TargetDebuffBarFrame', self)
  651.             DebuffBars:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 20, -50)
  652.             DebuffBars:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 0, -50)
  653.             DebuffBars.growDown = true
  654.             DebuffBars.dispelTypeColors = false
  655.             DebuffBars.fontFile = FONT
  656.             self.DebuffBars = DebuffBars
  657.             DebuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, casterUnit, _, _, spellID, _, _, _, _, _)
  658.                 if casterUnit == 'vehicle' or casterUnit == 'player' then
  659.                     if  spellID == 2818     or  --deadly poison
  660.                         spellID == 112961   or  --leeching poison
  661.                         spellID == 159238 then  --shattered bleed
  662.                         return false
  663.                     else
  664.                         return true
  665.                     end
  666.                 end
  667.             end
  668.     end,
  669.     focus = function(self)
  670.         self:SetSize(85, 32)
  671.         self:SetBackdrop(BACKDROP)
  672.         self:SetBackdropColor(0, 0, 0)
  673.         ----------------------
  674.         --Focus Health Stuff--
  675.         ----------------------
  676.         local Health = CreateFrame('StatusBar', nil, self)
  677.             Health:SetAllPoints()
  678.             Health:SetStatusBarTexture(TEXTURE)
  679.             Health:SetStatusBarColor(0.2, 0.2, 0.2)
  680.             Health.frequentUpdates = true
  681.             self.Health = Health
  682.    
  683.         local HealthBG = Health:CreateTexture(nil, 'BORDER')
  684.             HealthBG:SetAllPoints()
  685.             HealthBG:SetTexture(.55, .1, .1)
  686.             self.HealthBG = HealthBG
  687.        
  688.         local focushealthpercenttextframe = CreateFrame('Button', 'FocusHealthPercentTextFrame', self)
  689.             focushealthpercenttextframe:SetSize(50, 10)
  690.             focushealthpercenttextframe:SetPoint('RIGHT', self, 'LEFT')
  691.             focushealthpercenttextframe:EnableMouse(false)
  692.             focushealthpercenttextframe:RegisterEvent('PLAYER_FOCUS_CHANGED')
  693.             focushealthpercenttextframe:RegisterUnitEvent('UNIT_HEALTH', 'focus')
  694.        
  695.         local focushealthpercenttext = focushealthpercenttextframe:CreateFontString('FocusHealthPercentText', 'OVERLAY')
  696.             focushealthpercenttext:SetAllPoints()
  697.             focushealthpercenttext:SetPoint('RIGHT', self, 'LEFT', -5, 0)
  698.             focushealthpercenttext:SetFont(FONT, 10, 'OUTLINE')
  699.             focushealthpercenttext:SetJustifyH('RIGHT')
  700.                
  701.         local focushealthcurrent, focushealthmax, r, g
  702.         focushealthpercenttextframe:SetScript('OnEvent', function(self, event, unit)
  703.             if UnitIsDead('focus') then
  704.                 return focushealthpercenttext:SetText('|cffb40000Dead')
  705.             else
  706.                 focushealthcurrent, focushealthmax = UnitHealth('focus'), UnitHealthMax('focus')
  707.             end
  708.            
  709.             if focushealthcurrent < focushealthmax*.35 then
  710.                 r, g = 180, 0
  711.             else
  712.                 r, g = 0, 180
  713.             end
  714.            
  715.             local a = round(100*(focushealthcurrent/focushealthmax))
  716.             focushealthpercenttext:SetFormattedText('|cff%02x%02x%02x%s'..'%%', r, g, 0, a)
  717.         end)
  718.         --------------------
  719.         --Focus Name Stuff--
  720.         --------------------
  721.         local focusnametextframe = CreateFrame('Button', 'FocusNameTextFrame', self)
  722.             focusnametextframe:SetAllPoints()
  723.             focusnametextframe:EnableMouse(false)
  724.             focusnametextframe:RegisterEvent('PLAYER_FOCUS_CHANGED')
  725.             focusnametextframe:RegisterEvent('UNIT_NAME_UPDATE', 'focus')
  726.            
  727.         local focusnametext = focusnametextframe:CreateFontString('FocusNameText', 'OVERLAY')
  728.             focusnametext:SetAllPoints()
  729.             focusnametext:SetFont(FONT, 10, 'OUTLINE')
  730.        
  731.         focusnametextframe:SetScript('OnEvent', function(self, event, unit)
  732.             local name =  UnitName('focus')
  733.             local class, classfn = UnitClass('focus')
  734.             local colorname = RAID_CLASS_COLORS[classfn]
  735.            
  736.             if not name then
  737.                 focusnametext:SetText('')
  738.             elseif not colorname then
  739.                 colorname = 255, 0, 0
  740.             else
  741.                 name = string.sub(name, 1, 13)
  742.                 focusnametext:SetFormattedText('|cff%02x%02x%02x%s', 255*colorname.r, 255*colorname.g, 255*colorname.b, name)
  743.             end
  744.         end)
  745.         -------------------
  746.         --Focus Raid Icon--
  747.         -------------------
  748.         local RaidIcon = Health:CreateTexture(nil, 'OVERLAY')
  749.             RaidIcon:SetPoint('CENTER', self, 'TOP')
  750.             RaidIcon:SetSize(16, 16)
  751.             self.RaidIcon = RaidIcon
  752.         -------------------
  753.         --Focus Buff Bars--
  754.         -------------------
  755.         local BuffBars = CreateFrame('Frame', 'FocusBuffBarFrame', self)
  756.             BuffBars:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 0, 17)
  757.             BuffBars:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', 0, 17)
  758.             self.BuffBars = BuffBars
  759.             BuffBars.fontFile = FONT
  760.             BuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, _, isStealable, _, _, _, _, _, _, _)
  761.                 if isStealable then
  762.                     return true
  763.                 end
  764.             end
  765.         --------------------
  766.         --Focus Debuff Bar--
  767.         --------------------
  768.         local DebuffBars = CreateFrame("Frame", 'FocusDebuffBarFrame', self)
  769.             DebuffBars:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -30)
  770.             DebuffBars:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 0, -30)
  771.             DebuffBars.growDown = true
  772.             DebuffBars.dispelTypeColors = true
  773.             DebuffBars.fontFile = FONT
  774.             self.DebuffBars = DebuffBars
  775.             DebuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, casterUnit, _, _, spellID, _, _, _, _, _)
  776.                 if (casterUnit == 'player' and
  777.                     spellID == 2094 or      --blind
  778.                     spellID == 1833 or      --cheap shot
  779.                     spellID == 2818 or      --deadly poison
  780.                     spellID == 1330 or      --garrote silence
  781.                     spellID == 1776 or      --gouge
  782.                     spellID == 408 or       --kidney shot
  783.                     spellID == 1943 or      --rupture
  784.                     spellID == 6770)        --sap
  785.                     or casterUnit == 'vehicle'
  786.                 then
  787.                     return true
  788.                 else
  789.                     return false
  790.                 end
  791.             end
  792.     end,
  793.     targettarget = function(self)
  794.         self:SetSize(85, 32)
  795.         self:SetBackdrop(BACKDROP)
  796.         self:SetBackdropColor(0, 0, 0)
  797.         ---------------------------------
  798.         --Target of Target Health Stuff--
  799.         ---------------------------------
  800.         local Health = CreateFrame('StatusBar', nil, self)
  801.             Health:SetAllPoints()
  802.             Health:SetStatusBarTexture(TEXTURE)
  803.             Health:SetStatusBarColor(0.2, 0.2, 0.2)
  804.             Health.frequentUpdates = true
  805.             self.Health = Health
  806.    
  807.         local HealthBG = Health:CreateTexture(nil, 'BORDER')
  808.             HealthBG:SetAllPoints()
  809.             HealthBG:SetTexture(.55, .1, .1)
  810.             self.HealthBG = HealthBG
  811.         -------------------------------
  812.         --Target of Target Name Stuff--
  813.         -------------------------------
  814.         local ttnametextframe = CreateFrame('Button', 'TTNameTextFrame', self)
  815.             ttnametextframe:SetAllPoints()
  816.             ttnametextframe:EnableMouse(false)
  817.             ttnametextframe:RegisterEvent('PLAYER_TARGET_CHANGED')
  818.             ttnametextframe:RegisterEvent('UNIT_TARGET', 'targettarget')
  819.            
  820.         local ttnametext = ttnametextframe:CreateFontString('TTNameText', 'OVERLAY')
  821.             ttnametext:SetAllPoints()
  822.             ttnametext:SetFont(FONT, 10, 'OUTLINE')
  823.        
  824.         ttnametextframe:SetScript('OnEvent', function(self, event, unit)
  825.             local name =  UnitName('targettarget')
  826.             local class, classfn = UnitClass('targettarget')
  827.             local colorname = RAID_CLASS_COLORS[classfn]
  828.            
  829.             if not name then
  830.                 ttnametext:SetText('')
  831.             elseif not colorname then
  832.                 colorname = 255, 0, 0
  833.             else
  834.                 name = string.sub(name, 1, 13)
  835.                 ttnametext:SetFormattedText('|cff%02x%02x%02x%s', 255*colorname.r, 255*colorname.g, 255*colorname.b, name)
  836.             end
  837.         end)
  838.     end,
  839.     pet = function(self)
  840.     end,
  841.     party = function(self)
  842.         self:SetSize(150, 60)
  843.         self:SetBackdrop(BACKDROP)
  844.         self:SetBackdropColor(0, 0, 0)
  845.         ----------------------
  846.         --Party Health Stuff--
  847.         ----------------------
  848.         Health = CreateFrame('StatusBar', nil, self)
  849.             Health:SetHeight(55)
  850.             Health:SetPoint('TOPLEFT')
  851.             Health:SetPoint('TOPRIGHT')
  852.             Health:SetStatusBarTexture(TEXTURE)
  853.             Health:SetStatusBarColor(0.2, 0.2, 0.2)
  854.             Health.frequentUpdates = true
  855.             Health.colorDisconnected = true
  856.             Health.colorClass = true
  857.            
  858.         local HealthBG = Health:CreateTexture(nil, 'BORDER')
  859.             HealthBG:SetAllPoints()
  860.             HealthBG:SetTexture(.55, .1, .1)
  861.             self.HealthBG = HealthBG
  862.            
  863.         self.Range = {
  864.             insideAlpha = 1,
  865.             outsideAlpha = 0.40
  866.         }
  867.         ------------------------------------   
  868.         --Party Incoming Heals/Absorbs Bar--
  869.         ------------------------------------
  870.         local partyincominghealsbar = CreateFrame('StatusBar', nil, self.Health)
  871.             partyincominghealsbar:SetPoint('TOP')
  872.             partyincominghealsbar:SetPoint('BOTTOM')
  873.             partyincominghealsbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
  874.             partyincominghealsbar:SetWidth(150) --has to change if party width changes
  875.             partyincominghealsbar:SetStatusBarColor(0, 0.7, 0, 1)
  876.        
  877.         local partyabsorbbar = CreateFrame('StatusBar', nil, self.Health)
  878.             partyabsorbbar:SetPoint('TOP')
  879.             partyabsorbbar:SetPoint('BOTTOM')
  880.             partyabsorbbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
  881.             partyabsorbbar:SetWidth(150) --has to change if party width changes
  882.             partyabsorbbar:SetStatusBarColor(0, 0, 0.7, 1)
  883.        
  884.             self.HealPrediction = {
  885.                 playerincominghealsbar  = myBar,
  886.                 playerabsorbbar         = absorbBar,
  887.                 maxOverflow             = 1,
  888.                 frequentUpdates         = true
  889.             }
  890.         -------------------
  891.         --Party Power Bar--
  892.         -------------------
  893.         local Power = CreateFrame('StatusBar', nil, self)
  894.             Power:SetPoint('BOTTOMRIGHT')
  895.             Power:SetPoint('BOTTOMLEFT')
  896.             Power:SetPoint('TOP', Health, 'BOTTOM', 0, -1)
  897.             Power:SetStatusBarTexture(TEXTURE)
  898.             Power.frequentUpdates   = true
  899.             Power.colorPower        = true
  900.             self.Power = Power
  901.            
  902.         local PowerBG = Power:CreateTexture(nil, 'BORDER')
  903.             PowerBG:SetAllPoints()
  904.             PowerBG:SetTexture(TEXTURE)
  905.             PowerBG.multiplier = 1/3
  906.             Power.bg = PowerBG
  907.         -------------------
  908.         --Party Name Text--
  909.         -------------------
  910.         local partynametextframe = CreateFrame('Button', 'PartyNameTextFrame', self)
  911.             partynametextframe:SetSize(150, 10)
  912.             partynametextframe:SetPoint('CENTER', self, 'CENTER', 0, 3)
  913.             partynametextframe:EnableMouse(false)
  914.             partynametextframe:RegisterUnitEvent('UNIT_NAME_UPDATE', unit)
  915.            
  916.         local partynametext = partynametextframe:CreateFontString('PartyNameText', 'OVERLAY')
  917.             partynametext:SetAllPoints()
  918.             partynametext:SetFont(FONT, 10, 'OUTLINE')
  919.            
  920.         local name, class, classfn
  921.         partynametextframe:SetScript('OnEvent', function(self, event, unit)
  922.             name =  UnitName(unit)
  923.             class, classfn = UnitClass(unit)
  924.             local colorname = RAID_CLASS_COLORS[classfn]
  925.             if not name then
  926.                 partynameleveltext:SetText('')
  927.             elseif not colorname then
  928.                 colorname = 255, 0, 0
  929.             else
  930.                 name = string.sub(name, 1, 20)
  931.                 partynameleveltext:SetFormattedText('|cff%02x%02x%02x%s', 255*colorname.r, 255*colorname.g, 255*colorname.b, name)
  932.             end
  933.         end)
  934.         -------------------
  935.         --Party Raid Icon--
  936.         -------------------
  937.         local RaidIcon = Health:CreateTexture(nil, 'OVERLAY')
  938.             RaidIcon:SetPoint('TOPLEFT', self, 'TOPLEFT', 3, -3)
  939.             RaidIcon:SetSize(16, 16)
  940.             self.RaidIcon = RaidIcon
  941.         --------------------------
  942.         --Party Ready Check Icon--
  943.         --------------------------
  944.         local ReadyCheck = self.Health:CreateTexture(nil, 'OVERLAY')
  945.             ReadyCheck:SetPoint('TOPRIGHT', self, 'TOPRIGHT', -3, -3)
  946.             ReadyCheck:SetSize(14, 14)
  947.             self.ReadyCheck = ReadyCheck
  948.         -----------------
  949.         --Party Role Icon
  950.         -----------------
  951.         local RoleIcon = self:CreateTexture(nil, 'OVERLAY')
  952.             RoleIcon:SetPoint('LEFT', self, 'RIGHT', 3, 0)
  953.             RoleIcon:SetSize(14, 14)
  954.             self.LFDRole = RoleIcon
  955.     end,
  956.     raid = function(self)
  957.     end,
  958.     boss = function(self)
  959.     end
  960. }
  961.  
  962. oUF:RegisterStyle('oUF_Terenna_Player', UnitSpecific.player)
  963. oUF:SetActiveStyle('oUF_Terenna_Player')
  964. oUF:Spawn('player'):SetPoint('CENTER', -345, -36)
  965.  
  966. oUF:RegisterStyle('oUF_Terenna_Target', UnitSpecific.target)
  967. oUF:SetActiveStyle('oUF_Terenna_Target')
  968. oUF:Spawn('target'):SetPoint('CENTER', 345, -36)
  969.  
  970. oUF:RegisterStyle('oUF_Terenna_Focus', UnitSpecific.focus)
  971. oUF:SetActiveStyle('oUF_Terenna_Focus')
  972. oUF:Spawn('focus'):SetPoint('CENTER', -560, -36)
  973.  
  974. oUF:RegisterStyle('oUF_Terenna_TargetTarget', UnitSpecific.targettarget)
  975. oUF:SetActiveStyle('oUF_Terenna_TargetTarget')
  976. oUF:Spawn('targettarget'):SetPoint('CENTER', 560, -36)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement