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 PlayerBuffWhiteList = {
- [2823] = true, --deadly poison
- [108211] = true, --leeching poison
- [3408] = true, --crippling poison
- [8679] = true, --wound poison
- [5171] = true, --slice and dice
- [84745] = true, --shallow insight
- [84746] = true, --moderate insight
- [84747] = true, --deep insight
- [1784] = true, --stealth
- [115191] = true, --subterfuge stealth
- [13877] = true, --blade flurry
- [13750] = true, --adrenaline rush
- [1966] = true, --feint
- [73651] = true, --recuperate
- [31224] = true, --cloak of shadows
- [80353] = true, --time warp
- [90355] = true, --ancient hysteria
- [2983] = true, --sprint
- [137573] = true, --burst of speed
- [54861] = true, --nitro boosts
- [36554] = true, --shadowstep speed buff
- [5277] = true, --evasion
- [74001] = true, --combat readiness
- [74002] = true, --combat insight
- [114018] = true, --shroud of concealment
- [32182] = true, --heroism
- [146555] = true, --drums of rage
- [32645] = true, --envenom
- [31665] = true, --master of subtlety
- [115192] = true, --subterfuge
- [51713] = true --shadowdance
- }
- local Shared = function(self, unit)
- -----------------------
- --Create Parent Frame--
- -----------------------
- self:RegisterForClicks('AnyUp')
- self:SetBackdrop(BACKDROP)
- self:SetBackdropColor(0, 0, 0)
- --party, raid, and boss will be taken care of in spawn I believe
- if unit == 'player' or unit == 'target' then
- self:SetSize(250, 32)
- elseif unit == 'focus' or unit == 'pet' or unit == 'targettarget' then
- self:SetSize(85, 32)
- end
- ----------------------
- --Create Health Bars--
- ----------------------
- local Health = CreateFrame('StatusBar', nil, self)
- 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
- ----------------------
- --Create Absorb Bars--
- ----------------------
- if unit == 'player' or unit == 'target' or unit == 'party' then
- local myBar = CreateFrame('StatusBar', nil, self.Health)
- myBar:SetPoint('TOP')
- myBar:SetPoint('BOTTOM')
- myBar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
- myBar:SetWidth(self:GetWidth())
- myBar:SetStatusBarColor(0, 0.7, 0, 1) --green for heals
- local absorbBar = CreateFrame('StatusBar', nil, self.Health)
- absorbBar:SetPoint('TOP')
- absorbBar:SetPoint('BOTTOM')
- absorbBar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
- absorbBar:SetWidth(self:GetWidth())
- absorbBar:SetStatusBarColor(0, 0, 0.7, 1) --blue for absorbs
- self.HealPrediction = {
- myBar = myBar,
- absorbBar = absorbBar,
- maxOverflow = 1,
- frequentUpdates = true
- }
- end
- ---------------------
- --Create Power Bars--
- ---------------------
- if unit == 'player' or unit == 'target' or unit == 'party' then
- 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 = 0.5
- Power.bg = PowerBG
- end
- --------------------
- --Create Raid Icon--
- --------------------
- local RaidIcon = self.Health:CreateTexture(nil, 'OVERLAY')
- RaidIcon:SetPoint('TOP', self, 'TOP', 0, 8)
- RaidIcon:SetSize(16, 16)
- self.RaidIcon = RaidIcon
- if unit ~= 'party' and unit ~= 'raid' then
- RaidIcon:SetPoint('TOP', self, 'TOP', 0, 8)
- else
- RaidIcon:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', 2, 2)
- end
- ------------------------
- --Create (De)Buff Bars--
- ------------------------
- if unit == 'player' or unit == 'target' or unit == 'focus' then
- local BuffBars = CreateFrame('Frame', nil, self)
- BuffBars.fontFile = FONT
- self.BuffBars = BuffBars
- local DebuffBars = CreateFrame("Frame", nil , self)
- DebuffBars.growDown = true
- DebuffBars.fontFile = FONT
- self.DebuffBars = DebuffBars
- end
- end
- local UnitSpecific = {
- player = function(self, ...)
- Shared(self, ...)
- self.Health:SetPoint('BOTTOM', 0, 3)
- local HealthText = self.Health:CreateFontString(nil, 'OVERLAY')
- HealthText:SetPoint('LEFT', self, 'RIGHT', 5, 3)
- HealthText:SetFont(FONT, 10, 'OUTLINE')
- self:Tag(HealthText, '[Terenna:healthtext]')
- local HealthPercentText = self.Health:CreateFontString(nil, 'OVERLAY')
- HealthPercentText:SetPoint('RIGHT', self, 'LEFT', -5, 3)
- HealthPercentText:SetFont(FONT, 10, 'OUTLINE')
- self:Tag(HealthPercentText, '[Terenna:healthpercenttext]')
- local PowerText = self.Power:CreateFontString(nil, 'OVERLAY')
- PowerText:SetPoint('LEFT', self, 'RIGHT', 5, -10)
- PowerText:SetFont(FONT, 10, 'OUTLINE')
- self:Tag(PowerText, '[Terenna:powertext]')
- local Assistant = self.Health:CreateTexture(nil, 'OVERLAY')
- Assistant:SetSize(3, 8)
- Assistant:SetPoint('TOPLEFT', self, 'TOPLEFT', 2, 0)
- self.Assistant = Assistant
- local Combat = self.Health:CreateTexture(nil, 'OVERLAY')
- Combat:SetSize(3, 8)
- Combat:SetPoint('TOPLEFT', self, 'TOPLEFT', 7, 0)
- self.Combat = Combat
- local Resting = self.Health:CreateTexture(nil, 'OVERLAY')
- Resting:SetSize(3, 8)
- Resting:SetPoint('TOPLEFT', self, 'TOPLEFT', 12, 0)
- self.Resting = Resting
- --------------------
- --Player Buff Bars--
- --------------------
- self.BuffBars:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 0, 17)
- self.BuffBars:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', -20, 17)
- self.BuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, casterUnit, _, _, spellID)
- if casterUnit == 'vehicle' or PlayerBuffWhiteList[spellID] then
- return true
- else
- return false
- end
- end
- ----------------------
- --Player Debuff Bars--
- ----------------------
- self.DebuffBars:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -100)
- self.DebuffBars:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', -20, -100)
- self.DebuffBars.dispelTypeColors = true
- self.DebuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, _, _, _, spellID)
- if spellID ~= 95223 then
- return true
- end
- end
- end,
- target = function(self, ...)
- Shared(self, ...)
- self.Range = {
- insideAlpha = 1,
- outsideAlpha = 0.4
- }
- self.Health:SetPoint('BOTTOM', 0, 3)
- self.Health.colorTapping = true
- self.Health.colorDisconnected = true
- self.Health.colorHealth = true
- self.colors.health[1], self.colors.health[2], self.colors.health[3] = 0.2, 0.2, 0.2
- self.Power.colorClassNPC = true
- self.Power.colorClassPet = true
- local QuestIcon = self.Health:CreateFontString(nil, 'OVERLAY')
- QuestIcon:SetPoint('CENTER', self, 'TOP')
- QuestIcon:SetFont(FONT, 20, 'OUTLINE')
- QuestIcon:SetTextColor(1, 1, 0)
- self:Tag(QuestIcon, '[Terenna:questicon]')
- local HealthText = self.Health:CreateFontString(nil, 'OVERLAY')
- HealthText:SetPoint('RIGHT', self, 'LEFT', -5, 3)
- HealthText:SetFont(FONT, 10, 'OUTLINE')
- self:Tag(HealthText, '[Terenna:targethealthtext]')
- local HealthPercentText = self.Health:CreateFontString(nil, 'OVERLAY')
- HealthPercentText:SetPoint('LEFT', self, 'RIGHT', 5, 3)
- HealthPercentText:SetFont(FONT, 10, 'OUTLINE')
- self:Tag(HealthPercentText, '[Terenna:targethealthpercenttext]')
- local PowerText = self.Power:CreateFontString(nil, 'OVERLAY')
- PowerText:SetPoint('RIGHT', self, 'LEFT', -5, -10)
- PowerText:SetFont(FONT, 10, 'OUTLINE')
- self:Tag(PowerText, '[Terenna:powertext]')
- local NameText = self:CreateFontString(nil, 'OVERLAY')
- NameText:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 0, -5)
- NameText:SetFont(FONT, 10, 'OUTLINE')
- self:Tag(NameText, '[Terenna:name]')
- 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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement