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 incominghealsbar = CreateFrame('StatusBar', nil, self.Health)
- incominghealsbar:SetPoint('TOP')
- incominghealsbar:SetPoint('BOTTOM')
- incominghealsbar:SetPoint('LEFT', self.Health:GetStatusBarTexture(), 'RIGHT')
- incominghealsbar:SetWidth(self:GetWidth())
- incominghealsbar: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 = {
- incominghealsbar = 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 = 1/3
- 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:SetHeight(29)
- 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]')
- -------------------------
- --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 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
- }
- oUF:RegisterStyle('Terenna', Shared)
- oUF:RegisterStyle('oUF_Terenna_Player', UnitSpecific.player)
- oUF:SetActiveStyle('oUF_Terenna_Player')
- oUF:Spawn('player'):SetPoint('CENTER', -345, -36)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement