Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --oUF_Terenna
- local _, ns = ...
- local oUF = ns.oUF or oUF
- --local FONT = [=[Interface\AddOns\oUF_Terenna\Font.ttf]=]
- local FONT = [=[Interface\AddOns\oUF_P3lim\pixel.ttf]=]
- local TEXTURE = [=[Interface\ChatFrame\ChatFrameBackground]=]
- local BACKDROP = {
- bgFile = TEXTURE,
- insets = {top = -1, bottom = -1, left = -1, right = -1}
- }
- local function round(val, decimal)
- if (decimal) then
- return math.floor((val*10^decimal) + 0.5) / (10^decimal)
- else
- return math.floor(val + 0.5)
- end
- end
- local UnitSpecific = {
- player = function(self)
- self:SetSize(250, 32)
- self:SetBackdrop(BACKDROP)
- self:SetBackdropColor(0, 0, 0)
- -----------------------
- --Player Health Stuff--
- -----------------------
- local Health = CreateFrame('StatusBar', nil, self)
- Health:SetHeight(29)
- Health:SetPoint('TOPLEFT')
- Health:SetPoint('TOPRIGHT')
- Health:SetStatusBarTexture(TEXTURE)
- Health:SetStatusBarColor(0.2, 0.2, 0.2)
- Health.frequentUpdates = true
- self.Health = Health
- local HealthBG = Health:CreateTexture(nil, 'BORDER')
- HealthBG:SetAllPoints()
- HealthBG:SetTexture(.55, .1, .1)
- self.HealthBG = HealthBG
- local playerhealthtextframe = CreateFrame('Button', 'PlayerHealthTextFrame', self)
- playerhealthtextframe:SetSize(350, 10)
- playerhealthtextframe:SetPoint('TOP', self, 'TOP')
- playerhealthtextframe:EnableMouse(false)
- playerhealthtextframe:RegisterEvent('PLAYER_ENTERING_WORLD')
- playerhealthtextframe:RegisterUnitEvent('UNIT_HEALTH', 'player', 'vehicle')
- playerhealthtextframe:RegisterUnitEvent('UNIT_ENTERED_VEHICLE', 'player')
- playerhealthtextframe:RegisterUnitEvent('UNIT_EXITED_VEHICLE', 'player')
- local playerhealthtext = playerhealthtextframe:CreateFontString('PlayerHealthText', 'OVERLAY')
- playerhealthtext:SetSize(50, 10)
- playerhealthtext:SetPoint('RIGHT', 'PlayerHealthTextFrame', 'RIGHT', 5, -10)
- playerhealthtext:SetFont(FONT, 10, 'OUTLINE')
- playerhealthtext:SetJustifyH('LEFT')
- local playerhealthpercenttext = playerhealthtextframe:CreateFontString('PlayerHealthPercentText', 'OVERLAY')
- playerhealthpercenttext:SetSize(50, 10)
- playerhealthpercenttext:SetPoint('LEFT', 'PlayerHealthTextFrame', 'LEFT', -5, -10)
- playerhealthpercenttext:SetFont(FONT, 10, 'OUTLINE')
- playerhealthpercenttext:SetJustifyH('RIGHT')
- local playerhealthcurrent, playerhealthmax, r, g, playervehiclestatus
- playerhealthtextframe:SetScript('OnEvent', function(self, event, unit)
- if UnitIsGhost('player') then
- return playerhealthtext:SetText('|cffb40000Ghost'), playerhealthpercenttext:SetText('')
- elseif UnitIsDead('player') then
- return playerhealthtext:SetText('|cffb40000Dead'), playerhealthpercenttext:SetText('')
- elseif (event == 'PLAYER_ENTERING_WORLD' and UnitInVehicle('player')) or event == 'UNIT_ENTERED_VEHICLE' then
- playervehiclestatus = 'vehicle'
- playerhealthtextframe:UnregisterEvent('UNIT_HEALTH')
- playerhealthtextframe:RegisterUnitEvent('UNIT_HEALTH', 'vehicle')
- elseif event == 'PLAYER_ENTERING_WORLD' or event == 'UNIT_EXITED_VEHICLE' then
- playervehiclestatus = 'player'
- playerhealthtextframe:UnregisterEvent('UNIT_HEALTH')
- playerhealthtextframe:RegisterUnitEvent('UNIT_HEALTH', 'player')
- end
- playerhealthcurrent, playerhealthmax = UnitHealth(playervehiclestatus), UnitHealthMax(playervehiclestatus)
- if playerhealthcurrent < playerhealthmax then
- r, g = 180, 0
- else
- r, g = 0, 180
- end
- local a = round(100*(playerhealthcurrent/playerhealthmax))
- if playerhealthcurrent >= 1000000 then
- playerhealthcurrent = format('%.1fm', playerhealthcurrent/1000000)
- elseif playerhealthcurrent >= 1000 then
- playerhealthcurrent = format('%.0fk', playerhealthcurrent/1000)
- end
- playerhealthtext:SetFormattedText('|cff%02x%02x%02x%s', r, g, 0, playerhealthcurrent)
- playerhealthpercenttext:SetFormattedText('|cff%02x%02x%02x%s'..'%%', r, g, 0, a)
- end)
- -------------------------------------
- --Player Incoming Heals/Absorbs Bar--
- -------------------------------------
- local playerincominghealsbar = CreateFrame('StatusBar', nil, self.Health)
- playerincominghealsbar:SetPoint('TOP')
- playerincominghealsbar:SetPoint('BOTTOM')
- playerincominghealsbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
- playerincominghealsbar:SetWidth(250) --this would need to change if resized playerframe
- playerincominghealsbar:SetStatusBarColor(0, 0.7, 0, 1) --green for heals
- local playerabsorbbar = CreateFrame('StatusBar', nil, self.Health)
- playerabsorbbar:SetPoint('TOP')
- playerabsorbbar:SetPoint('BOTTOM')
- playerabsorbbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
- playerabsorbbar:SetWidth(250) --this would need to change if resized playerframe
- playerabsorbbar:SetStatusBarColor(0, 0, 0.7, 1) --blue for absorbs
- self.HealPrediction = {
- playerincominghealsbar = myBar,
- playerabsorbbar = absorbBar,
- 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
- frequentUpdates = true
- }
- ----------------------
- --Player Power Stuff--
- ----------------------
- local Power = CreateFrame('StatusBar', nil, self)
- Power:SetPoint('BOTTOMRIGHT')
- Power:SetPoint('BOTTOMLEFT')
- Power:SetPoint('TOP', Health, 'BOTTOM', 0, -1)
- Power:SetStatusBarTexture(TEXTURE)
- Power.frequentUpdates = true
- Power.colorClass = true
- self.Power = Power
- local PowerBG = Power:CreateTexture(nil, 'BORDER')
- PowerBG:SetAllPoints()
- PowerBG:SetTexture(TEXTURE)
- PowerBG.multiplier = 1/3
- Power.bg = PowerBG
- local playerpowertextframe = CreateFrame('Button', 'PlayerPowerTextFrame', self)
- playerpowertextframe:SetSize(40,10)
- playerpowertextframe:SetPoint('BOTTOMLEFT', self, 'BOTTOMRIGHT', 5, 0)
- playerpowertextframe:EnableMouse(false)
- playerpowertextframe:RegisterEvent('PLAYER_ENTERING_WORLD')
- playerpowertextframe:RegisterUnitEvent('UNIT_POWER_FREQUENT', 'player', 'vehicle')
- playerpowertextframe:RegisterUnitEvent('UNIT_ENTERED_VEHICLE', 'player')
- playerpowertextframe:RegisterUnitEvent('UNIT_EXITED_VEHICLE', 'player')
- playerpowertextframe:RegisterUnitEvent('UNIT_DISPLAYPOWER', 'player')
- local playerpowertext = playerpowertextframe:CreateFontString('PlayerPowerText', 'OVERLAY')
- playerpowertext:SetAllPoints()
- playerpowertext:SetFont(FONT, 10, 'OUTLINE')
- playerpowertext:SetJustifyH('LEFT')
- local playerpowercurrent, playervehiclepowerstatus, pr, pg, pb
- playerpowertextframe:SetScript('OnEvent', function(self, event, unit)
- if (event == 'PLAYER_ENTERING_WORLD' and UnitInVehicle('player')) or event == 'UNIT_ENTERED_VEHICLE' then
- playervehiclepowerstatus = 'vehicle'
- playerpowertextframe:UnregisterEvent('UNIT_POWER_FREQUENT')
- playerpowertextframe:RegisterUnitEvent('UNIT_POWER_FREQUENT', 'vehicle')
- playerpowertype = select(2,UnitPowerType('vehicle'))
- elseif event == 'PLAYER_ENTERING_WORLD' or event == 'UNIT_EXITED_VEHICLE' then
- playervehiclepowerstatus = 'player'
- playerpowertextframe:UnregisterEvent('UNIT_POWER_FREQUENT')
- playerpowertextframe:RegisterUnitEvent('UNIT_POWER_FREQUENT', 'player')
- playerpowertype = select(2,UnitPowerType('player'))
- elseif event == 'UNIT_DISPLAYPOWER' then
- playerpowertype = select(2,UnitPowerType(playervehiclepowerstatus))
- end
- playerpowercurrent = UnitPower(playervehiclepowerstatus)
- if playerpowertype and playerpowercurrent > 0 then
- if playerpowertype == 'MANA' then
- pr, pg, pb = 0, 100, 255
- if playerpowercurrent >= 1000000 then
- playerpowercurrent = format('%.1fm', playerpowercurrent / 1000000)
- elseif playerpowercurrent >= 1000 then
- playerpowercurrent = format('%.0fk', playerpowercurrent / 1000)
- end
- elseif playerpowertype == 'FOCUS' then
- pr, pg, pb = 255, 128, 65
- elseif playerpowertype == 'ENERGY' then
- pr, pg, pb = 255, 255, 0
- elseif playerpowertype == 'RUNIC_POWER' then
- pr, pg, pb = 0, 209, 255
- else
- pr, pg, pb = 255, 0, 0
- end
- playerpowertext:SetFormattedText('|cff%02x%02x%02x%s', pr, pg, pb, playerpowercurrent)
- else
- playerpowertext:SetText('')
- end
- end)
- --------------------
- --Player Raid Icon--
- --------------------
- local RaidIcon = Health:CreateTexture(nil, 'OVERLAY')
- RaidIcon:SetPoint('TOP', self, 0, 8)
- RaidIcon:SetSize(16, 16)
- self.RaidIcon = RaidIcon
- -------------------------
- --Leader/Assist Texture--
- -------------------------
- local leaderassistframe = CreateFrame('Button', 'PlayerLeaderAssistFrame', self)
- leaderassistframe:SetSize(3,8)
- leaderassistframe:SetPoint('TOPLEFT', self, 'TOPLEFT', 2, 0)
- leaderassistframe:RegisterEvent('GROUP_ROSTER_UPDATE')
- leaderassistframe:RegisterEvent('PARTY_LEADER_CHANGED')
- leaderassistframe:RegisterEvent('PLAYER_ENTERING_WORLD')
- local leaderassisttexture = leaderassistframe:CreateTexture('PlayerLeaderAssistTexture', 'OVERLAY')
- --leaderassisttexture:SetTexture('Interface\AddOns\oUF_Terenna\Status_Texture', 'OVERLAY')
- leaderassisttexture = leaderassistframe:CreateTexture('Interface\AddOns\oUF_P3lim\F1_StatusBox_Bar', 'OVERLAY')
- leaderassisttexture:SetTexture(1, 1, 0)
- leaderassisttexture:SetAllPoints(true)
- leaderassistframe:SetScript('OnEvent', function(self, event, unit)
- if UnitIsGroupLeader('player') or UnitIsRaidOfficer('player') then
- leaderassisttexture:Show()
- else
- leaderassisttexture:Hide()
- end
- end)
- -------------------------
- --Player Combat Texture--
- -------------------------
- local playercombatframe = CreateFrame('Button', 'PlayerCombatFrame', self)
- playercombatframe:SetSize(3,8)
- playercombatframe:SetPoint('TOPLEFT', self, 'TOPLEFT', 7,0)
- playercombatframe:RegisterEvent('PLAYER_ENTERING_WORLD')
- playercombatframe:RegisterEvent('PLAYER_REGEN_DISABLED')
- playercombatframe:RegisterEvent('PLAYER_REGEN_ENABLED')
- local playercombattexture = playercombatframe:CreateTexture('PlayerCombatTexture', 'OVERLAY')
- --playercombattexture:SetTexture('Interface\AddOns\oUF_Terenna\Status_Texture', 'OVERLAY')
- playercombattexture:SetTexture('Interface\AddOns\oUF_P3lim\F1_StatusBox_Bar', 'OVERLAY')
- playercombattexture:SetTexture(1,0,0)
- playercombattexture:SetAllPoints(true)
- playercombattexture:Hide()
- playercombatframe:SetScript('OnEvent', function(self, event, unit)
- if event == 'PLAYER_REGEN_DISABLED' then
- playercombattexture:Show()
- elseif event == 'PLAYER_REGEN_ENABLED' then
- playercombattexture:Hide()
- elseif (event == 'PLAYER_ENTERING_WORLD' and UnitAffectingCombat('player')) then
- playercombattexture:Show()
- end
- end)
- --------------------------
- --Player Resting Texture--
- --------------------------
- local playerrestingframe = CreateFrame('Button', 'PlayerRestingFrame', self)
- playerrestingframe:SetSize(3,8)
- playerrestingframe:SetPoint('TOPLEFT', self, 'TOPLEFT', 12, 0)
- playerrestingframe:RegisterEvent('PLAYER_ENTERING_WORLD')
- playerrestingframe:RegisterEvent('PLAYER_UPDATE_RESTING')
- local playerrestingtexture = playerrestingframe:CreateTexture('PlayerRestingTexture', 'OVERLAY')
- --playerrestingtexture:SetTexture('Interface\AddOns\oUF_Terenna\Status_Texture', 'OVERLAY')
- playerrestingtexture:SetTexture('Interface\AddOns\oUF_P3lim\F1_StatusBox_Bar', 'OVERLAY')
- playerrestingtexture:SetTexture(0.41, 0.8, 0.94)
- playerrestingtexture:SetAllPoints(true)
- playerrestingframe:SetScript('OnEvent', function(self, event, unit)
- if IsResting() then
- playerrestingtexture:Show()
- else
- playerrestingtexture:Hide()
- end
- end)
- -------------------
- --Player Buff Bar--
- -------------------
- local BuffBars = CreateFrame('Frame', 'PlayerBuffBarFrame', self)
- BuffBars:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 0, 17)
- BuffBars:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', -20, 17)
- BuffBars.fontFile = FONT
- self.BuffBars = BuffBars
- BuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, casterUnit, _, _, spellID, _, _, _, _, _)
- if casterUnit == 'vehicle' or
- spellID == 2823 --deadly poison
- or spellID == 108211 --leeching poison
- or spellID == 3408 --crippling poison
- or spellID == 8679 --wound poison
- or spellID == 5171 --slice and dice
- or spellID == 84745 --shallow insight
- or spellID == 84746 --moderate insight
- or spellID == 84747 --deep insight
- or spellID == 1784 --stealth
- or spellID == 115191 --subterfuge stealth
- or spellID == 13877 --blade flurry
- or spellID == 13750 --adrenaline rush
- or spellID == 1966 --feint
- or spellID == 73651 --recuperate
- or spellID == 31224 --cloak of shadows
- or spellID == 80353 --time warp
- or spellID == 90355 --ancient hysteria
- or spellID == 2983 --sprint
- or spellID == 137573 --burst of speed
- or spellID == 54861 --nitro boosts
- or spellID == 36554 --shadowstep speed buff
- or spellID == 5277 --evasion
- or spellID == 74001 --combat readiness
- or spellID == 74002 --combat insight
- or spellID == 114018 --shroud of concealment
- or spellID == 32182 --heroism
- or spellID == 146555 --drums of rage
- or spellID == 32645 --envenom
- or spellID == 31665 --master of subtlety
- or spellID == 115192 --subterfuge
- or spellID == 51713 then--shadowdance
- return true
- else
- return false
- end
- end
- ---------------------
- --Player Debuff Bar--
- ---------------------
- local DebuffBars = CreateFrame("Frame", 'PlayerDebuffBarFrame', self)
- DebuffBars:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -100)
- DebuffBars:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', -20, -100)
- DebuffBars.growDown = true
- DebuffBars.dispelTypeColors = true
- DebuffBars.fontFile = FONT
- self.DebuffBars = DebuffBars
- DebuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, _, _)
- if spellID ~= 95223 then
- return true
- end
- end
- end,
- target = function(self)
- self:SetSize(250, 32)
- self:SetBackdrop(BACKDROP)
- self:SetBackdropColor(0, 0, 0)
- -----------------------
- --Target Health Stuff--
- -----------------------
- local Health = CreateFrame('StatusBar', nil, self)
- Health:SetHeight(29)
- Health:SetPoint('TOPLEFT')
- Health:SetPoint('TOPRIGHT')
- Health:SetStatusBarTexture(TEXTURE)
- Health.frequentUpdates = true
- Health.colorTapping = true
- Health.colorDisconnected = true
- Health.colorHealth = true
- self.Health = Health
- self.colors.health[1], self.colors.health[2], self.colors.health[3] = 0.2, 0.2, 0.2
- local HealthBG = Health:CreateTexture(nil, 'BORDER')
- HealthBG:SetAllPoints()
- HealthBG:SetTexture(.55, .1, .1)
- self.HealthBG = HealthBG
- local targethealthtextframe = CreateFrame('Button', 'TargetHealthTextFrame', self)
- targethealthtextframe:SetSize(350, 10)
- targethealthtextframe:SetPoint('TOP', self, 'TOP')
- targethealthtextframe:EnableMouse(false)
- targethealthtextframe:RegisterEvent('PLAYER_TARGET_CHANGED')
- targethealthtextframe:RegisterUnitEvent('UNIT_HEALTH', 'target')
- targethealthtextframe:RegisterUnitEvent('UNIT_CONNECTION', 'target')
- local targethealthtext = targethealthtextframe:CreateFontString('TargetHealthText', 'OVERLAY')
- targethealthtext:SetSize(50, 10)
- targethealthtext:SetPoint('LEFT', 'TargetHealthTextFrame', 'LEFT', -5, -10)
- targethealthtext:SetFont(FONT, 10, 'OUTLINE')
- targethealthtext:SetJustifyH('RIGHT')
- local targethealthpercenttext = targethealthtextframe:CreateFontString('TargetHealthPercentText', 'OVERLAY')
- targethealthpercenttext:SetSize(50, 10)
- targethealthpercenttext:SetPoint('RIGHT', 'TargetHealthTextFrame', 'RIGHT', 5, -10)
- targethealthpercenttext:SetFont(FONT, 10, 'OUTLINE')
- targethealthpercenttext:SetJustifyH('LEFT')
- local targethealthcurrent, targethealthmax, r, g
- targethealthtextframe:SetScript('OnEvent', function(self, event, unit)
- if event == 'UNIT_CONNECTION' and not UnitIsConnected('target') then
- return targethealthframetext:SetFormattedText('|cffb40000D/C'), targethealthpercenttext:SetText('')
- elseif UnitIsGhost('target') then
- return targethealthtext:SetText('|cffb40000Ghost'), targethealthpercenttext:SetText('')
- elseif UnitIsDead('target') then
- return targethealthtext:SetText('|cffb40000Dead'), targethealthpercenttext:SetText('')
- else
- targethealthcurrent, targethealthmax = UnitHealth('target'), UnitHealthMax('target')
- end
- if targethealthcurrent < targethealthmax * .35 then
- r, g = 180, 0
- else
- r, g = 0, 180
- end
- local a = round(100*(targethealthcurrent/targethealthmax))
- if targethealthcurrent >= 1000000 then
- targethealthcurrent = format('%.1fm', targethealthcurrent / 1000000)
- elseif targethealthcurrent >= 1000 then
- targethealthcurrent = format('%.0fk', targethealthcurrent / 1000)
- end
- targethealthtext:SetFormattedText('|cff%02x%02x%02x%s', r, g, 0, targethealthcurrent)
- targethealthpercenttext:SetFormattedText('|cff%02x%02x%02x%s'..'%%', r, g, 0, a)
- end)
- -------------------------------------
- --Target Incoming Heals/Absorbs Bar--
- -------------------------------------
- local targetincominghealsbar = CreateFrame('StatusBar', nil, self.Health)
- targetincominghealsbar:SetPoint('TOP')
- targetincominghealsbar:SetPoint('BOTTOM')
- targetincominghealsbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
- targetincominghealsbar:SetWidth(250) --has to change if target width changes
- targetincominghealsbar:SetStatusBarColor(0, 0.7, 0, 1)
- local targetabsorbbar = CreateFrame('StatusBar', nil, self.Health)
- targetabsorbbar:SetPoint('TOP')
- targetabsorbbar:SetPoint('BOTTOM')
- targetabsorbbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
- targetabsorbbar:SetWidth(250) --has to change if target width changes
- targetabsorbbar:SetStatusBarColor(0, 0, 0.7, 1)
- self.HealPrediction = {
- playerincominghealsbar = myBar,
- playerabsorbbar = absorbBar,
- maxOverflow = 1,
- frequentUpdates = true
- }
- ----------------------
- --Target Power Stuff--
- ----------------------
- local Power = CreateFrame('StatusBar', nil, self)
- Power:SetPoint('BOTTOMRIGHT')
- Power:SetPoint('BOTTOMLEFT')
- Power:SetPoint('TOP', Health, 'BOTTOM', 0, -1)
- Power:SetStatusBarTexture(TEXTURE)
- Power.frequentUpdates = true
- Power.colorClass = true
- Power.colorClassNPC = true
- Power.colorClassPet = true
- self.Power = Power
- local PowerBG = Power:CreateTexture(nil, 'BORDER')
- PowerBG:SetAllPoints()
- PowerBG:SetTexture(TEXTURE)
- PowerBG.multiplier = 1/3
- Power.bg = PowerBG
- local targetpowerframe = CreateFrame('Button', 'TargetPowerTextFrame', self)
- targetpowerframe:SetSize(40,10)
- targetpowerframe:SetPoint('BOTTOMRIGHT', self, 'BOTTOMLEFT', -5, 0)
- targetpowerframe:EnableMouse(false)
- targetpowerframe:RegisterEvent('PLAYER_TARGET_CHANGED')
- targetpowerframe:RegisterUnitEvent('UNIT_POWER_FREQUENT', 'target')
- targetpowerframe:RegisterUnitEvent('UNIT_DISPLAYPOWER', 'target')
- local targetpowertext = targetpowerframe:CreateFontString('TargetPowerText', 'OVERLAY')
- targetpowertext:SetAllPoints()
- targetpowertext:SetFont(FONT, 10, 'OUTLINE')
- targetpowertext:SetJustifyH('RIGHT')
- local targetpowercurrent, pr, pg, pb
- targetpowerframe:SetScript('OnEvent', function(self, event, unit)
- if event == 'UNIT_DISPLAYPOWER' or event == 'PLAYER_TARGET_CHANGED' then
- targetpowertype = select(2,UnitPowerType('target'))
- end
- targetpowercurrent = UnitPower('target')
- if targetpowertype and targetpowercurrent > 0 then
- if targetpowertype == 'MANA' then
- pr, pg, pb = 0, 100, 255
- if targetpowercurrent >= 1000000 then
- targetpowercurrent = format('%.1fm', targetpowercurrent / 1000000)
- elseif targetpowercurrent >= 1000 then
- targetpowercurrent = format('%.0fk', targetpowercurrent / 1000)
- end
- elseif targetpowertype == 'FOCUS' then
- pr, pg, pb = 255, 128, 65
- elseif targetpowertype == 'ENERGY' then
- pr, pg, pb = 255, 255, 0
- elseif targetpowertype == 'RUNIC_POWER' then
- pr, pg, pb = 0, 209, 255
- else
- pr, pg, pb = 255, 0, 0
- end
- targetpowertext:SetFormattedText('|cff%02x%02x%02x%s', pr, pg, pb, targetpowercurrent)
- else
- targetpowertext:SetText('')
- end
- end)
- --------------------------
- --Target Name/Level Text--
- --------------------------
- local targetnameleveltextframe = CreateFrame('Button', 'TargetNameLevelTextFrame', self)
- targetnameleveltextframe:SetSize(200, 10)
- targetnameleveltextframe:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 0, -5)
- targetnameleveltextframe:EnableMouse(false)
- targetnameleveltextframe:RegisterEvent('PLAYER_TARGET_CHANGED')
- targetnameleveltextframe:RegisterUnitEvent('UNIT_LEVEL', 'target')
- targetnameleveltextframe:RegisterUnitEvent('UNIT_NAME_UPDATE', 'target')
- local targetnameleveltext = targetnameleveltextframe:CreateFontString('TargetNameLevelText', 'OVERLAY')
- targetnameleveltext:SetAllPoints()
- targetnameleveltext:SetFont(FONT, 10, 'OUTLINE')
- targetnameleveltext:SetJustifyH('RIGHT')
- targetnameleveltextframe:SetScript('OnEvent', function(self, event, unit)
- local name, level = UnitName('target'), UnitLevel('target')
- local levelmax = GetMaxPlayerLevel()
- local levelcolor = {}
- local class, classfn = UnitClass('target')
- local colorname = RAID_CLASS_COLORS[classfn]
- if not name then
- targetnameleveltext:SetText('')
- elseif not colorname then
- colorname = 255, 0, 0
- else
- if level <= 0 then
- level = '??'
- levelcolor.r, levelcolor.g, levelcolor.b = 1, 1, 1
- elseif level == levelmax then
- levelcolor.r, levelcolor.g, levelcolor.b = 1, 1, 1
- else
- levelcolor = GetQuestDifficultyColor(level)
- end
- 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)
- end
- end)
- --------------------
- --Target Raid Icon--
- --------------------
- local RaidIcon = Health:CreateTexture(nil, 'OVERLAY')
- RaidIcon:SetPoint('CENTER', self, 'TOP')
- RaidIcon:SetSize(16, 16)
- self.RaidIcon = RaidIcon
- ------------------------
- --Target Quest Texture--
- ------------------------
- local targetquesttextureframe = CreateFrame('Button', 'TargetQuestTextureFrame', self)
- targetquesttextureframe:SetSize(10,10)
- targetquesttextureframe:SetPoint('CENTER', self, 'CENTER')
- targetquesttextureframe:EnableMouse(false)
- targetquesttextureframe:RegisterEvent('PLAYER_TARGET_CHANGED')
- local targetquesttexture = targetquesttextureframe:CreateFontString('TargetQuestTexture', 'OVERLAY')
- targetquesttexture:SetAllPoints()
- targetquesttexture:SetFont(FONT, 20, 'OUTLINE')
- targetquesttexture:SetJustifyH('CENTER')
- targetquesttextureframe:SetScript('OnEvent', function(self, event, unit)
- if UnitIsQuestBoss('target') then
- targetquesttexture:SetFormattedText('|cff%02x%02x%02x!', 255, 255, 0)
- else
- targetquesttexture:SetText('')
- end
- end)
- -----------------------
- --Target Rare Texture--
- -----------------------
- local targetraretextureframe = CreateFrame('Button', 'TargetRareTextureFrame', self)
- targetraretextureframe:SetSize(3,8)
- targetraretextureframe:SetPoint('TOPLEFT', self, 'TOPLEFT', 7, 0)
- targetraretextureframe:EnableMouse(false)
- targetraretextureframe:RegisterEvent('PLAYER_TARGET_CHANGED')
- targetraretextureframe:RegisterUnitEvent('UNIT_CLASSIFICATION_CHANGED', 'target')
- local targetraretexture = targetraretextureframe:CreateTexture('TargetRareTexture', 'OVERLAY')
- targetraretexture:SetTexture('Interface\AddOns\oUF_P3lim\F1_StatusBox_Bar', 'OVERLAY')
- targetraretexture:SetTexture(.75, .75, .75)
- targetraretexture:SetAllPoints()
- targetraretextureframe:SetScript('OnEvent', function(self, event, unit)
- local classification = UnitClassification('target')
- if classification == 'rare' or classification == 'rareelite' then
- targetraretexture:Show()
- else
- targetraretexture:Hide()
- end
- end)
- ------------------------
- --Target Elite Texture--
- ------------------------
- local targetelitetextureframe = CreateFrame('Button', 'TargetEliteTextureFrame', self)
- targetelitetextureframe:SetSize(3,8)
- targetelitetextureframe:SetPoint('TOPLEFT', self, 'TOPLEFT', 2, 0)
- targetelitetextureframe:EnableMouse(false)
- targetelitetextureframe:RegisterEvent('PLAYER_TARGET_CHANGED')
- targetelitetextureframe:RegisterUnitEvent('UNIT_CLASSIFICATION_CHANGED', 'target')
- local targetelitetexture = targetelitetextureframe:CreateTexture('TargetEliteStatusTexture', 'OVERLAY')
- targetelitetexture:SetTexture('Interface\AddOns\oUF_P3lim\F1_StatusBox_Bar', 'OVERLAY')
- targetelitetexture:SetTexture(.8, .63, .21)
- targetelitetexture:SetAllPoints()
- targetelitetextureframe:SetScript('OnEvent', function(self, event, unit)
- local classification = UnitClassification('target')
- if classification == 'elite' or classification == 'rareelite' then
- targetelitetexture:Show()
- else
- targetelitetexture:Hide()
- end
- end)
- -------------------
- --Target Buff Bar--
- -------------------
- local BuffBars = CreateFrame('Frame', 'TargetBuffBarFrame', self)
- BuffBars:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 20, 17)
- BuffBars:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', 0, 17)
- self.BuffBars = BuffBars
- BuffBars.fontFile = FONT
- BuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, _, _)
- if spellID == 97341 or --Guild Champion
- spellID == 93339 or --Champion
- spellID == 93828 or --Silvermoon Champion
- spellID == 93341 or --Hyjal Champion
- spellID == 93347 or --Therazane Champion
- spellID == 97340 or --Guild Champion
- spellID == 93811 or --Exodar Champion
- spellID == 93816 or --Gilnean Champion
- spellID == 72968 or --Precious's Ribbon
- spellID == 93806 or --Darnassus Champion
- spellID == 93368 or --Wildhammer Champion
- spellID == 93337 or --Ramkahen Champion
- spellID == 126434 or --Tushui Champion
- spellID == 57819 or --Argent Chamption
- spellID == 57822 or --Wyrmrest Champion
- spellID == 93821 or --Gnomergan Champion
- spellID == 142234 or --Brawling Champion (toot toot)
- spellID == 142239 or --Brawling Champion (gorgeous)
- spellID == 142242 or --Brawling Champion (south seas)
- spellID == 142243 or --Brawling Champion (splat)
- spellID == 142244 or --Brawling Champion (bruce)
- spellID == 142246 or --Brawling Champion (rockpaperscissors)
- spellID == 142247 or --Brawling Champion (blingtrong)
- spellID == 143625 or --Brawling Champion (rank 10)
- spellID == 93805 or --Ironforge Champion
- spellID == 25780 or --Righteous Fury
- spellID == 17619 or --Alchemist Stone
- spellID == 93795 --Stormwind Champion
- then
- return false
- else
- return true
- end
- end
- ---------------------
- --Target Debuff Bar--
- ---------------------
- local DebuffBars = CreateFrame("Frame", 'TargetDebuffBarFrame', self)
- DebuffBars:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 20, -50)
- DebuffBars:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 0, -50)
- DebuffBars.growDown = true
- DebuffBars.dispelTypeColors = false
- DebuffBars.fontFile = FONT
- self.DebuffBars = DebuffBars
- DebuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, casterUnit, _, _, spellID, _, _, _, _, _)
- if casterUnit == 'vehicle' or casterUnit == 'player' then
- if spellID == 2818 or --deadly poison
- spellID == 112961 or --leeching poison
- spellID == 159238 then --shattered bleed
- return false
- else
- return true
- end
- end
- end
- end,
- focus = function(self)
- self:SetSize(85, 32)
- self:SetBackdrop(BACKDROP)
- self:SetBackdropColor(0, 0, 0)
- ----------------------
- --Focus Health Stuff--
- ----------------------
- local Health = CreateFrame('StatusBar', nil, self)
- Health:SetAllPoints()
- Health:SetStatusBarTexture(TEXTURE)
- Health:SetStatusBarColor(0.2, 0.2, 0.2)
- Health.frequentUpdates = true
- self.Health = Health
- local HealthBG = Health:CreateTexture(nil, 'BORDER')
- HealthBG:SetAllPoints()
- HealthBG:SetTexture(.55, .1, .1)
- self.HealthBG = HealthBG
- local focushealthpercenttextframe = CreateFrame('Button', 'FocusHealthPercentTextFrame', self)
- focushealthpercenttextframe:SetSize(50, 10)
- focushealthpercenttextframe:SetPoint('RIGHT', self, 'LEFT')
- focushealthpercenttextframe:EnableMouse(false)
- focushealthpercenttextframe:RegisterEvent('PLAYER_FOCUS_CHANGED')
- focushealthpercenttextframe:RegisterUnitEvent('UNIT_HEALTH', 'focus')
- local focushealthpercenttext = focushealthpercenttextframe:CreateFontString('FocusHealthPercentText', 'OVERLAY')
- focushealthpercenttext:SetAllPoints()
- focushealthpercenttext:SetPoint('RIGHT', self, 'LEFT', -5, 0)
- focushealthpercenttext:SetFont(FONT, 10, 'OUTLINE')
- focushealthpercenttext:SetJustifyH('RIGHT')
- local focushealthcurrent, focushealthmax, r, g
- focushealthpercenttextframe:SetScript('OnEvent', function(self, event, unit)
- if UnitIsDead('focus') then
- return focushealthpercenttext:SetText('|cffb40000Dead')
- else
- focushealthcurrent, focushealthmax = UnitHealth('focus'), UnitHealthMax('focus')
- end
- if focushealthcurrent < focushealthmax*.35 then
- r, g = 180, 0
- else
- r, g = 0, 180
- end
- local a = round(100*(focushealthcurrent/focushealthmax))
- focushealthpercenttext:SetFormattedText('|cff%02x%02x%02x%s'..'%%', r, g, 0, a)
- end)
- --------------------
- --Focus Name Stuff--
- --------------------
- local focusnametextframe = CreateFrame('Button', 'FocusNameTextFrame', self)
- focusnametextframe:SetAllPoints()
- focusnametextframe:EnableMouse(false)
- focusnametextframe:RegisterEvent('PLAYER_FOCUS_CHANGED')
- focusnametextframe:RegisterEvent('UNIT_NAME_UPDATE', 'focus')
- local focusnametext = focusnametextframe:CreateFontString('FocusNameText', 'OVERLAY')
- focusnametext:SetAllPoints()
- focusnametext:SetFont(FONT, 10, 'OUTLINE')
- focusnametextframe:SetScript('OnEvent', function(self, event, unit)
- local name = UnitName('focus')
- local class, classfn = UnitClass('focus')
- local colorname = RAID_CLASS_COLORS[classfn]
- if not name then
- focusnametext:SetText('')
- elseif not colorname then
- colorname = 255, 0, 0
- else
- name = string.sub(name, 1, 13)
- focusnametext:SetFormattedText('|cff%02x%02x%02x%s', 255*colorname.r, 255*colorname.g, 255*colorname.b, name)
- end
- end)
- -------------------
- --Focus Raid Icon--
- -------------------
- local RaidIcon = Health:CreateTexture(nil, 'OVERLAY')
- RaidIcon:SetPoint('CENTER', self, 'TOP')
- RaidIcon:SetSize(16, 16)
- self.RaidIcon = RaidIcon
- -------------------
- --Focus Buff Bars--
- -------------------
- local BuffBars = CreateFrame('Frame', 'FocusBuffBarFrame', self)
- BuffBars:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 0, 17)
- BuffBars:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', 0, 17)
- self.BuffBars = BuffBars
- BuffBars.fontFile = FONT
- BuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, _, isStealable, _, _, _, _, _, _, _)
- if isStealable then
- return true
- end
- end
- --------------------
- --Focus Debuff Bar--
- --------------------
- local DebuffBars = CreateFrame("Frame", 'FocusDebuffBarFrame', self)
- DebuffBars:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -30)
- DebuffBars:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 0, -30)
- DebuffBars.growDown = true
- DebuffBars.dispelTypeColors = true
- DebuffBars.fontFile = FONT
- self.DebuffBars = DebuffBars
- DebuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, casterUnit, _, _, spellID, _, _, _, _, _)
- if (casterUnit == 'player' and
- spellID == 2094 or --blind
- spellID == 1833 or --cheap shot
- spellID == 2818 or --deadly poison
- spellID == 1330 or --garrote silence
- spellID == 1776 or --gouge
- spellID == 408 or --kidney shot
- spellID == 1943 or --rupture
- spellID == 6770) --sap
- or casterUnit == 'vehicle'
- then
- return true
- else
- return false
- end
- end
- end,
- targettarget = function(self)
- self:SetSize(85, 32)
- self:SetBackdrop(BACKDROP)
- self:SetBackdropColor(0, 0, 0)
- ---------------------------------
- --Target of Target Health Stuff--
- ---------------------------------
- local Health = CreateFrame('StatusBar', nil, self)
- Health:SetAllPoints()
- Health:SetStatusBarTexture(TEXTURE)
- Health:SetStatusBarColor(0.2, 0.2, 0.2)
- Health.frequentUpdates = true
- self.Health = Health
- local HealthBG = Health:CreateTexture(nil, 'BORDER')
- HealthBG:SetAllPoints()
- HealthBG:SetTexture(.55, .1, .1)
- self.HealthBG = HealthBG
- -------------------------------
- --Target of Target Name Stuff--
- -------------------------------
- local ttnametextframe = CreateFrame('Button', 'TTNameTextFrame', self)
- ttnametextframe:SetAllPoints()
- ttnametextframe:EnableMouse(false)
- ttnametextframe:RegisterEvent('PLAYER_TARGET_CHANGED')
- ttnametextframe:RegisterEvent('UNIT_TARGET', 'targettarget')
- local ttnametext = ttnametextframe:CreateFontString('TTNameText', 'OVERLAY')
- ttnametext:SetAllPoints()
- ttnametext:SetFont(FONT, 10, 'OUTLINE')
- ttnametextframe:SetScript('OnEvent', function(self, event, unit)
- local name = UnitName('targettarget')
- local class, classfn = UnitClass('targettarget')
- local colorname = RAID_CLASS_COLORS[classfn]
- if not name then
- ttnametext:SetText('')
- elseif not colorname then
- colorname = 255, 0, 0
- else
- name = string.sub(name, 1, 13)
- ttnametext:SetFormattedText('|cff%02x%02x%02x%s', 255*colorname.r, 255*colorname.g, 255*colorname.b, name)
- end
- end)
- end,
- pet = function(self)
- end,
- party = function(self)
- self:SetSize(150, 60)
- self:SetBackdrop(BACKDROP)
- self:SetBackdropColor(0, 0, 0)
- ----------------------
- --Party Health Stuff--
- ----------------------
- Health = CreateFrame('StatusBar', nil, self)
- Health:SetHeight(55)
- Health:SetPoint('TOPLEFT')
- Health:SetPoint('TOPRIGHT')
- Health:SetStatusBarTexture(TEXTURE)
- Health:SetStatusBarColor(0.2, 0.2, 0.2)
- Health.frequentUpdates = true
- Health.colorDisconnected = true
- Health.colorClass = true
- local HealthBG = Health:CreateTexture(nil, 'BORDER')
- HealthBG:SetAllPoints()
- HealthBG:SetTexture(.55, .1, .1)
- self.HealthBG = HealthBG
- self.Range = {
- insideAlpha = 1,
- outsideAlpha = 0.40
- }
- ------------------------------------
- --Party Incoming Heals/Absorbs Bar--
- ------------------------------------
- local partyincominghealsbar = CreateFrame('StatusBar', nil, self.Health)
- partyincominghealsbar:SetPoint('TOP')
- partyincominghealsbar:SetPoint('BOTTOM')
- partyincominghealsbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
- partyincominghealsbar:SetWidth(150) --has to change if party width changes
- partyincominghealsbar:SetStatusBarColor(0, 0.7, 0, 1)
- local partyabsorbbar = CreateFrame('StatusBar', nil, self.Health)
- partyabsorbbar:SetPoint('TOP')
- partyabsorbbar:SetPoint('BOTTOM')
- partyabsorbbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
- partyabsorbbar:SetWidth(150) --has to change if party width changes
- partyabsorbbar:SetStatusBarColor(0, 0, 0.7, 1)
- self.HealPrediction = {
- playerincominghealsbar = myBar,
- playerabsorbbar = absorbBar,
- maxOverflow = 1,
- frequentUpdates = true
- }
- -------------------
- --Party Power Bar--
- -------------------
- local Power = CreateFrame('StatusBar', nil, self)
- Power:SetPoint('BOTTOMRIGHT')
- Power:SetPoint('BOTTOMLEFT')
- Power:SetPoint('TOP', Health, 'BOTTOM', 0, -1)
- Power:SetStatusBarTexture(TEXTURE)
- Power.frequentUpdates = true
- Power.colorPower = true
- self.Power = Power
- local PowerBG = Power:CreateTexture(nil, 'BORDER')
- PowerBG:SetAllPoints()
- PowerBG:SetTexture(TEXTURE)
- PowerBG.multiplier = 1/3
- Power.bg = PowerBG
- -------------------
- --Party Name Text--
- -------------------
- local partynametextframe = CreateFrame('Button', 'PartyNameTextFrame', self)
- partynametextframe:SetSize(150, 10)
- partynametextframe:SetPoint('CENTER', self, 'CENTER', 0, 3)
- partynametextframe:EnableMouse(false)
- partynametextframe:RegisterUnitEvent('UNIT_NAME_UPDATE', unit)
- local partynametext = partynametextframe:CreateFontString('PartyNameText', 'OVERLAY')
- partynametext:SetAllPoints()
- partynametext:SetFont(FONT, 10, 'OUTLINE')
- local name, class, classfn
- partynametextframe:SetScript('OnEvent', function(self, event, unit)
- name = UnitName(unit)
- class, classfn = UnitClass(unit)
- local colorname = RAID_CLASS_COLORS[classfn]
- if not name then
- partynameleveltext:SetText('')
- elseif not colorname then
- colorname = 255, 0, 0
- else
- name = string.sub(name, 1, 20)
- partynameleveltext:SetFormattedText('|cff%02x%02x%02x%s', 255*colorname.r, 255*colorname.g, 255*colorname.b, name)
- end
- end)
- -------------------
- --Party Raid Icon--
- -------------------
- local RaidIcon = Health:CreateTexture(nil, 'OVERLAY')
- RaidIcon:SetPoint('TOPLEFT', self, 'TOPLEFT', 3, -3)
- RaidIcon:SetSize(16, 16)
- self.RaidIcon = RaidIcon
- --------------------------
- --Party Ready Check Icon--
- --------------------------
- local ReadyCheck = self.Health:CreateTexture(nil, 'OVERLAY')
- ReadyCheck:SetPoint('TOPRIGHT', self, 'TOPRIGHT', -3, -3)
- ReadyCheck:SetSize(14, 14)
- self.ReadyCheck = ReadyCheck
- -----------------
- --Party Role Icon
- -----------------
- local RoleIcon = self:CreateTexture(nil, 'OVERLAY')
- RoleIcon:SetPoint('LEFT', self, 'RIGHT', 3, 0)
- RoleIcon:SetSize(14, 14)
- self.LFDRole = RoleIcon
- end,
- raid = function(self)
- end,
- boss = function(self)
- end
- }
- oUF:RegisterStyle('oUF_Terenna_Player', UnitSpecific.player)
- oUF:SetActiveStyle('oUF_Terenna_Player')
- oUF:Spawn('player'):SetPoint('CENTER', -345, -36)
- oUF:RegisterStyle('oUF_Terenna_Target', UnitSpecific.target)
- oUF:SetActiveStyle('oUF_Terenna_Target')
- oUF:Spawn('target'):SetPoint('CENTER', 345, -36)
- oUF:RegisterStyle('oUF_Terenna_Focus', UnitSpecific.focus)
- oUF:SetActiveStyle('oUF_Terenna_Focus')
- oUF:Spawn('focus'):SetPoint('CENTER', -560, -36)
- oUF:RegisterStyle('oUF_Terenna_TargetTarget', UnitSpecific.targettarget)
- oUF:SetActiveStyle('oUF_Terenna_TargetTarget')
- oUF:Spawn('targettarget'):SetPoint('CENTER', 560, -36)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement