Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Supported Units:
- Player
- Pet
- Target
- Target Of Target
- Focus
- Party/Raid
- Supported Plugins:
- oUF_CombatFeedback
- oUF_DebuffHighlight
- oUF_Experience
- oUF_MoveableFrames
- oUF_Smooth
- oUF_SpellRange
- oUF_Swing
- oUF_Smooth
- oUF_TotemBar
- oUF_ReadyCheck
- oUF_RuneBar
- Features:
- Aggro Highlighting on Raid Frames
- Castbar For Player, Target, Focus And Pet.
- Leader, MasterLooter, Raid PvP Combat Resting Icons.
- Options To Remove Portraits, Debuffs, Buffs, PvPIcon Castbars etc.
- ]]
- local _, class = UnitClass('player')
- local texture = 'Interface\\AddOns\\oUF_Aftermathh\\media\\Cabaret.tga'
- local border = 'Interface\\AddOns\\oUF_Aftermathh\\media\\border.tga'
- local font = 'Interface\\AddOns\\oUF_Aftermathh\\media\\font.ttf'
- local fontsize = 15
- local height, width = 27, 270
- local buffsize = 26
- -- Buffs/Debuffs
- local Debuffs = true
- local Buffs = true
- local PlayerOnlyDebuffs = true
- local DebuffType = true
- local CooldownCount = true
- -- General Stuff
- local PvPIcon = true
- local Portraits = true
- local SpellRange = false
- -- SwingBar
- local SwingMeele = true
- local SwingRange = false
- local SwingClassColors = true
- -- Castbar
- local CastBars = true
- local Safezone = true
- local Latency = true
- local ClassColor = false
- RuneFrame:Hide()
- local backdrop = {
- bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=],
- insets = {top = -1, left = -1, bottom = -1, right = -1},
- }
- local colors = setmetatable({
- power = setmetatable({
- ['MANA'] = {.31,.45,.63},
- ['RAGE'] = {.69,.31,.31},
- ['FOCUS'] = {.71,.43,.27},
- ['ENERGY'] = {.65,.63,.35},
- }, {__index = oUF.colors.power}),
- }, {__index = oUF.colors})
- local menu = function(self)
- local unit = self.unit:sub(1, -2)
- local cunit = self.unit:gsub('(.)', string.upper, 1)
- if(unit == 'party' or unit == 'partypet') then
- ToggleDropDownMenu(1, nil, _G['PartyMemberFrame'..self.id..'DropDown'], 'cursor', 0, 0)
- elseif(_G[cunit..'FrameDropDown']) then
- ToggleDropDownMenu(1, nil, _G[cunit..'FrameDropDown'], 'cursor', 0, 0)
- end
- end
- local function UpdateChannelStart(self, event, unit, name, rank, text)
- if (self.Latency) then
- self.Latency:ClearAllPoints()
- self.Latency:SetPoint('LEFT', self, 'BOTTOMLEFT', 1, -1)
- local _, _, ms = GetNetStats()
- self.Latency:SetFormattedText('%dms', ms)
- end
- if (self.SafeZone) then
- self.SafeZone:SetDrawLayer('ARTWORK')
- self.SafeZone:SetPoint('TOPLEFT', self)
- self.SafeZone:SetPoint('BOTTOMLEFT', self)
- end
- end
- local function UpdateCastStart(self, event, unit, name, rank, text, castid)
- if (self.Latency) then
- self.Latency:ClearAllPoints()
- self.Latency:SetPoint('RIGHT', self, 'BOTTOMRIGHT', -1, 1)
- local _, _, ms = GetNetStats()
- self.Latency:SetFormattedText('%dms', ms)
- end
- if (self.SafeZone) then
- self.SafeZone:SetDrawLayer('BORDER')
- self.SafeZone:SetPoint('TOPRIGHT', self)
- self.SafeZone:SetPoint('BOTTOMRIGHT', self)
- end
- end
- local updateRIcon = function(self, event)
- local index = GetRaidTargetIndex(self.unit)
- if(index) then
- self.RIcon:SetText(ICON_LIST[index]..'22|t')
- else
- self.RIcon:SetText()
- end
- end
- oUF.TagEvents['AfterRaidName'] = 'UNIT_NAME_UPDATE'
- oUF.Tags['AfterRaidName'] = function(unit)
- local Name = string.sub(UnitName(unit), 1, 4)
- return Name
- end
- local function ShortenValue(value)
- if(value >= 1e6) then
- return ('%.2fm'):format(value / 1e6):gsub('%.?0+([km])$', '%1')
- elseif(value >= 1e4) then
- return ('%.1fk'):format(value / 1e3):gsub('%.?0+([km])$', '%1')
- else
- return value
- end
- end
- oUF.Tags['Afterhealth'] = function(unit)
- local min, max = UnitHealth(unit), UnitHealthMax(unit)
- local status = not UnitIsConnected(unit) and 'Offline' or UnitIsGhost(unit) and 'Ghost' or UnitIsDead(unit) and 'Dead'
- if(status) then
- return status
- elseif(unit == 'target' and UnitCanAttack('player', unit)) then
- return ('%s | %d %%'):format(ShortenValue(min), min / max * 100)
- elseif(unit == 'player' and min ~= max) then
- return ('%d | %d%%'):format(min - max, min / max * 100)
- elseif(min ~= max) then
- return ('%s | %s'):format(ShortenValue(min), ShortenValue(max))
- else
- return max
- end
- end
- oUF.TagEvents['Afterhealth'] = 'UNIT_HEALTH UNIT_MAXHEALTH'
- oUF.Tags['Afterpower'] = function(unit)
- local power = UnitPower(unit)
- if(power > 0 and not UnitIsDeadOrGhost(unit)) then
- return power
- end
- end
- oUF.TagEvents['Afterpower'] = oUF.TagEvents.missingpp
- local function UpdateDruidPower(self)
- local bar = self.DruidPower
- local num, str = UnitPowerType('player')
- local min = UnitPower('player', (num ~= 0) and 0 or 3)
- local max = UnitPowerMax('player', (num ~= 0) and 0 or 3)
- bar:SetMinMaxValues(0, max)
- if(min ~= max) then
- bar:SetValue(min)
- bar:SetAlpha(1)
- if(num ~= 0) then
- bar:SetStatusBarColor(unpack(colors.power['MANA']))
- bar.Text:SetFormattedText('%d | %d%%', min, math.floor(min / max * 100))
- else
- bar:SetStatusBarColor(unpack(colors.power['ENERGY']))
- bar.Text:SetText()
- end
- else
- bar:SetAlpha(0)
- bar.Text:SetText()
- end
- end
- local auraIcon = function(icons, button)
- if(DebuffType) then
- icons.showDebuffType = true
- end
- if(CooldownCount) then
- button.cd.noCooldownCount = true
- end
- button.icon:SetTexCoord(0.03, 0.97, 0.03, 0.97)
- button.overlay:SetTexture(border)
- button.overlay:SetTexCoord(0, 1, 0, 1)
- button.overlay:ClearAllPoints()
- button.overlay:SetPoint('TOPRIGHT', button, 1.35, 1.35)
- button.overlay:SetPoint('BOTTOMLEFT', button, -1.35, -1.35)
- button.overlay.Hide = function(self) self:SetVertexColor(0.35, 0.35, 0.35, 1) end
- button.cd:SetReverse()
- button.cd:ClearAllPoints()
- button.cd:SetPoint('TOPRIGHT', button.icon, 'TOPRIGHT', -1, -1)
- button.cd:SetPoint('BOTTOMLEFT', button.icon, 'BOTTOMLEFT', 1, 1)
- button.count:SetFont('Interface\\Add0ns\\oUF_Aftermathh\\media\\font.tff', 14, 'OUTLINE')
- button.count:ClearAllPoints()
- button.count:SetPoint('BOTTOMRIGHT', 1, 1)
- if (not button.background) then
- button.background = button:CreateTexture(nil, 'BACKGROUND')
- button.background:SetPoint('TOPLEFT', button.icon, 'TOPLEFT', -4, 4)
- button.background:SetPoint('BOTTOMRIGHT', button.icon, 'BOTTOMRIGHT', 4, -4)
- button.background:SetTexture('Interface\\AddOns\\oUF_Aftermathh\\media\\borderBackground')
- button.background:SetVertexColor(0, 0, 0, 1)
- end
- end
- local func = function(self, unit)
- self.colors = colors
- self.menu = menu
- self.ignoreHealComm = true
- self.DebuffHighlightBackdrop = false
- self.DebuffHighlightFilter = true
- self:EnableMouse(true)
- self:SetScript('OnEnter', UnitFrame_OnEnter)
- self:SetScript('OnLeave', UnitFrame_OnLeave)
- self:RegisterForClicks'anyup'
- self:SetAttribute('*type2', 'menu')
- CreateBorder(self, 12, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4)
- local hp = CreateFrame'StatusBar'
- if(unit == 'targettarget')then
- hp:SetHeight(height*.85)
- else
- hp:SetHeight(height*.85)
- end
- hp:SetStatusBarTexture(texture)
- hp.Smooth = true
- hp:SetStatusBarColor(.25, .25, .25)
- hp.frequentUpdates = true
- hp:SetParent(self)
- hp:SetPoint'TOP'
- hp:SetPoint'LEFT'
- hp:SetPoint'RIGHT'
- local hpbg = hp:CreateTexture(nil, 'BORDER')
- hpbg:SetAllPoints(hp)
- hpbg:SetTexture(0, 0, 0, 0.9)
- self:SetBackdrop(backdrop)
- self:SetBackdropColor(0, 0, 0, 0.9)
- local hpp = hp:CreateFontString(nil, 'OVERLAY')
- hpp:SetFont(font, fontsize, 'OUTLINE')
- hpp:SetPoint('RIGHT',hp, -2, 0)
- self:Tag(hpp, '[raidcolor][Afterhealth]')
- if unit == 'player' then
- hpp:SetPoint('RIGHT',hp, -2, 0)
- elseif unit == 'target' then
- hpp:SetPoint('RIGHT',hp, -2, 0)
- elseif unit == 'focus' or unit == 'pet' or unit == 'targettarget' or unit == 'focustarget' or unit == 'party' then
- hpp:SetPoint('BOTTOMLEFT', self, 'BOTTOMRIGHT', 500000000, -500000000)
- end
- hp.bg = hpbg
- hp.value = hpp
- self.Health = hp
- self.OverrideUpdateHealth = updateHealth
- if not(unit == 'targettarget') then
- local pp = CreateFrame'StatusBar'
- pp:SetHeight(height*.11)
- pp:SetStatusBarTexture(texture)
- pp.frequentUpdates = true
- pp.colorTapping = true
- pp.colorHappiness = true
- pp.colorClass = true
- pp.colorReaction = true
- pp.Smooth = true
- pp:SetParent(self)
- pp:SetPoint('BOTTOM')
- pp:SetPoint('LEFT', .2, 0)
- pp:SetPoint('RIGHT', -.2, 0)
- local ppbg = pp:CreateTexture(nil, 'BORDER')
- ppbg:SetAllPoints(pp)
- ppbg:SetTexture(texture)
- ppbg.multiplier = .3
- local ppp = pp:CreateFontString(nil, 'OVERLAY')
- ppp:SetFont(font, fontsize, 'OUTLINE')
- ppp:SetPoint('LEFT',hpp,'RIGHT', -265, 0)
- self:Tag(ppp, '[raidcolor][Afterpower]')
- pp.value = ppp
- pp.bg = ppbg
- self.Power = pp
- self.PostUpdatePower = updatePower
- else
- local pp = CreateFrame'StatusBar'
- pp:SetHeight(height*.11)
- pp:SetStatusBarTexture(texture)
- pp.frequentUpdates = true
- pp.colorTapping = true
- pp.colorHappiness = true
- pp.colorClass = true
- pp.colorReaction = true
- pp.Smooth = true
- pp:SetParent(self)
- pp:SetPoint('BOTTOM')
- pp:SetPoint('LEFT', .2, 0)
- pp:SetPoint('RIGHT', -.2, 0)
- local ppbg = pp:CreateTexture(nil, 'BORDER')
- ppbg:SetAllPoints(pp)
- ppbg:SetTexture(texture)
- local ppp = pp:CreateFontString(nil, 'OVERLAY')
- ppp:SetFont(font, fontsize)
- ppp:SetPoint('RIGHT',hpp,'LEFT', 50000, 0)
- self:Tag(ppp, '[raidcolor][Afterpower]')
- pp.value = ppp
- pp.bg = ppbg
- self.Power = pp
- self.PostUpdatePower = updatePower
- end
- if(CastBars)then
- if(unit == 'player' or unit == 'focus' or unit == 'target' or unit == 'pet') then
- self.Castbar = CreateFrame('StatusBar', nil, self)
- self.Castbar:SetStatusBarTexture(texture)
- self.Castbar:SetScale(1.139)
- self.Castbar:SetStatusBarColor(.25, .25, .25)
- CreateBorder(self.Castbar, 11, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3)
- self.Castbar.Bg = self.Castbar:CreateTexture(nil, 'BACKGROUND')
- self.Castbar.Bg:SetAllPoints(self.Castbar)
- self.Castbar.Bg:SetTexture(texture)
- self.Castbar.Bg:SetVertexColor(0, 0, 0, 0.6)
- if(unit == 'player')then
- local playerColor = RAID_CLASS_COLORS[select(2, UnitClass('player'))]
- if(ClassColor)then
- self.Castbar:SetStatusBarColor(playerColor.r, playerColor.g, playerColor.b)
- end
- self.Castbar:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 327, -55)
- self.Castbar:SetHeight(25)
- self.Castbar:SetWidth(309)
- self.Castbar:SetParent(UIParent)
- if(Safezone)then
- self.Castbar.SafeZone = self.Castbar:CreateTexture(nil, 'BORDER')
- self.Castbar.SafeZone:SetTexture('Interface\\Buttons\\WHITE8x8')
- self.Castbar.SafeZone:SetVertexColor(1, 0.5, 0, 1)
- end
- if(Latency)then
- self.Castbar.Latency = self:CreateFontString(nil, 'ARTWORK')
- self.Castbar.Latency:SetFont(font, 12, 'OUTLINE')
- self.Castbar.Latency:SetParent(self.Castbar)
- self.Castbar.Latency:SetDrawLayer('OVERLAY')
- self.Castbar.Latency:SetVertexColor(0.6, 0.6, 0.6)
- self.Castbar.Latency:SetAlpha(1)
- end
- self.Castbar.PostCastStart = UpdateCastStart
- self.Castbar.PostChannelStart = UpdateChannelStart
- end
- self.Castbar.CustomDelayText = function(self, duration)
- self.Time:SetFormattedText('(|cffff0000-%.1f|r) %.1f | %.1f', self.delay, duration, self.max)
- end
- self.Castbar.CustomTimeText = function(self, duration)
- self.Time:SetFormattedText('%.1f | %.1f', duration, self.max)
- end
- self.Castbar.Time = self:CreateFontString(nil, 'ARTWORK')
- self.Castbar.Time:SetFont(font, 13, 'OUTLINE')
- self.Castbar.Time:SetPoint('RIGHT', self.Castbar, 'RIGHT', -7, 0)
- self.Castbar.Time:SetHeight(10)
- self.Castbar.Time:SetJustifyH('RIGHT')
- self.Castbar.Time:SetParent(self.Castbar)
- self.Castbar.Text = self:CreateFontString(nil, 'ARTWORK')
- self.Castbar.Text:SetFont(font, 13, 'OUTLINE')
- self.Castbar.Text:SetPoint('LEFT', self.Castbar, 4, 0)
- self.Castbar.Text:SetPoint('RIGHT', self.Castbar.Time, 'LEFT', -7, 0)
- self.Castbar.Text:SetHeight(10)
- self.Castbar.Text:SetJustifyH('LEFT')
- self.Castbar.Text:SetParent(self.Castbar)
- if (unit == 'focus') then
- self.Castbar:SetPoint('CENTER', UIParent, 'CENTER', -10, -10)
- self.Castbar:SetWidth(260)
- self.Castbar:SetHeight(25)
- self.Castbar:SetStatusBarColor(.25, .25, .25)
- self.Castbar.Icon = self.Castbar:CreateTexture(nil, "ARTWORK")
- self.Castbar.Icon:SetHeight(44)
- self.Castbar.Icon:SetWidth(44)
- self.Castbar.Icon:SetPoint("LEFT", -52, 7)
- self.IconOverlay = self.Castbar:CreateTexture(nil, "OVERLAY")
- self.IconOverlay:SetPoint("TOPLEFT", self.Castbar.Icon, "TOPLEFT")
- self.IconOverlay:SetPoint("BOTTOMRIGHT", self.Castbar.Icon, "BOTTOMRIGHT")
- self.IconOverlay:SetTexture(border)
- self.IconOverlay:SetVertexColor(0.35, 0.35, 0.35, 1)
- self.Castbar.IconBack = self.Castbar:CreateTexture(nil, "BACKGROUND")
- self.Castbar.IconBack:SetPoint("TOPLEFT",self.Castbar.Icon,"TOPLEFT",-6,6)
- self.Castbar.IconBack:SetPoint("BOTTOMRIGHT",self.Castbar.Icon,"BOTTOMRIGHT",6,-6)
- self.Castbar.IconBack:SetTexture("Interface\\AddOns\\oUF_Aftermathh\\media\\borderBackground")
- self.Castbar.IconBack:SetVertexColor(0, 0, 0, 1)
- elseif (unit == 'target') then
- self.Castbar:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 141, 97)
- self.Castbar:SetWidth(230)
- self.Castbar:SetHeight(26)
- self.Castbar:SetStatusBarColor(.25, .25, .25)
- self.Castbar:SetParent(self)
- elseif (unit == 'pet') then
- self.Castbar:SetStatusBarColor(.25, .25, .25)
- self.Castbar:SetParent(self)
- self.Castbar:SetHeight(22)
- self.Castbar:SetWidth(200)
- self.Castbar:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', -12, 56)
- end
- end
- end
- for _, bar in pairs({
- 'MirrorTimer1',
- 'MirrorTimer2',
- 'MirrorTimer3',
- }) do
- for i, region in pairs({_G[bar]:GetRegions()}) do
- if (region.GetTexture and region:GetTexture() == 'SolidTexture') then
- region:Hide()
- end
- end
- CreateBorder(_G[bar], 11, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3)
- _G[bar..'Border']:Hide()
- _G[bar]:SetParent(UIParent)
- _G[bar]:SetScale(1.132)
- _G[bar]:SetHeight(20)
- _G[bar]:SetWidth(280)
- _G[bar..'Background'] = _G[bar]:CreateTexture(bar..'Background', 'BACKGROUND', _G[bar])
- _G[bar..'Background']:SetTexture('Interface\\Buttons\\WHITE8x8')
- _G[bar..'Background']:SetAllPoints(bar)
- _G[bar..'Background']:SetVertexColor(0, 0, 0, 0.5)
- _G[bar..'Text']:SetFont(CastingBarFrameText:GetFont(), 13)
- _G[bar..'Text']:ClearAllPoints()
- _G[bar..'Text']:SetPoint('CENTER', MirrorTimer1StatusBar, 0, 1)
- _G[bar..'StatusBar']:SetAllPoints(_G[bar])
- end
- if(unit == 'player' or unit == 'party') then
- local leader = hp:CreateTexture(nil, 'OVERLAY')
- leader:SetHeight(15)
- leader:SetWidth(15)
- leader:SetPoint('BOTTOMLEFT', hp, 'TOPLEFT', -5, -2)
- leader:SetTexture('Interface\\GroupFrame\\UI-Group-LeaderIcon')
- self.Leader = leader
- local masterlooter = hp:CreateTexture(nil, 'OVERLAY')
- masterlooter:SetHeight(15)
- masterlooter:SetWidth(15)
- masterlooter:SetPoint('LEFT', leader, 'RIGHT')
- self.MasterLooter = masterlooter
- end
- if(Portraits) then
- local portrait = CreateFrame('PlayerModel', nil, self)
- portrait:SetBackdrop(backdrop)
- portrait:SetBackdropColor(0, 0, 0, .9)
- portrait:SetScript('OnShow', function(self) self:SetCamera(0) end)
- portrait:SetWidth(height*3)
- portrait:SetHeight(height*2)
- portrait.type = '3D'
- self.Portrait = portrait
- CreateBorder(portrait, 12, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3)
- if(unit == 'player') then
- portrait:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', -92, -26)
- elseif(unit == 'target') then
- portrait:SetPoint('BOTTOMLEFT', self, 'BOTTOMRIGHT', 11, -26)
- elseif(unit == 'focus' or unit == 'pet' or unit == 'party') then
- portrait:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', -92, -26)
- end
- end
- if(PvPIcon) then
- local pvp = hp:CreateTexture(nil, 'OVERLAY')
- pvp:SetPoint('BOTTOMRIGHT', hp, 'TOPRIGHT', 18, -45)
- pvp:SetHeight(28)
- pvp:SetWidth(28)
- self.PvP = pvp
- end
- if(unit == 'player' and UnitLevel('player') ~= MAX_PLAYER_LEVEL) then
- self.Resting = self.Power:CreateTexture(nil, 'OVERLAY')
- self.Resting:SetHeight(18)
- self.Resting:SetWidth(20)
- self.Resting:SetPoint('BOTTOMLEFT', -8.5, -8.5)
- self.Resting:SetTexture('Interface\\CharacterFrame\\UI-StateIcon')
- self.Resting:SetTexCoord(0,0.5,0,0.421875)
- end
- if(unit == 'player') then
- local Combat = hp:CreateTexture(nil, 'OVERLAY')
- Combat:SetSize(21, 21)
- Combat:SetPoint('BOTTOMLEFT', hp, -10, -10)
- self.Combat = Combat
- end
- local ricon = hp:CreateFontString(nil, 'OVERLAY')
- ricon:SetFontObject(GameFontNormalSmall)
- ricon:SetTextColor(1, 1, 1)
- ricon:SetPoint('CENTER', hp, 0, 12)
- ricon:SetHeight(24)
- ricon:SetWidth(24)
- self.RIcon = ricon
- self:RegisterEvent('RAID_TARGET_UPDATE', updateRIcon)
- table.insert(self.__elements, updateRIcon)
- if(unit == 'target') then
- local cpoints = self:CreateFontString(nil, 'OVERLAY')
- cpoints:SetFont(font, 26, 'OUTLINE')
- cpoints:SetPoint('RIGHT', self, 'LEFT', -10, 0)
- cpoints:SetJustifyH('RIGHT')
- self:Tag(cpoints, '[cpoints]')
- end
- if(unit == 'player' or unit == 'target' or unit =='focus' or unit == 'pet' or unit == 'targetarget' or unit == 'focustarget' or unit == 'party') then
- local cbft = hp:CreateFontString(nil, 'OVERLAY')
- cbft:SetPoint('CENTER', self)
- cbft:SetFont(font, 21, 'OUTLINE')
- self.CombatFeedbackText = cbft
- self.CombatFeedbackText.maxAlpha = 1
- end
- if(unit~='player')then
- local name = hp:CreateFontString(nil, 'OVERLAY')
- if(unit == 'targettarget' or unit == 'focus' or unit == 'pet' or unit =='focustarget' or unit == 'party') then
- name:SetPoint('CENTER')
- name:SetWidth(150)
- else
- name:SetPoint('LEFT', hp, 'LEFT', -2, 27)
- name:SetJustifyH'LEFT'
- name:SetWidth(300)
- end
- name:SetFont(font, fontsize, 'OUTLINE')
- name:SetTextColor(1, 1, 1)
- name:SetHeight(fontsize)
- self.Info = name
- if(unit == 'target')then
- self:Tag(self.Info,'[difficulty][level][shortclassification] [raidcolor][name]')
- else
- self:Tag(self.Info,'[raidcolor][name]')
- end
- end
- if(Buffs) then
- local buffs = CreateFrame('Frame', nil, self)
- buffs:SetHeight(width)
- buffs:SetWidth(width)
- buffs.PostCreateIcon = auraIcon
- if(unit == 'pet' or unit == 'focus' or unit == 'target' or unit == 'party') then
- buffs.initialAnchor = 'TOPLEFT'
- buffs['growth-y'] = 'RIGHT'
- buffs['growth-x'] = 'DOWN'
- buffs:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', -3, -8)
- buffs.size = 28
- buffs.spacing = 3
- end
- if(unit == 'focus' or unit == 'pet') then
- buffs.num = 6
- elseif(unit=='target') then
- buffs.num = 9
- else
- buffs.num = 6
- end
- self.Buffs = buffs
- end
- if(Debuffs) then
- local debuffs = CreateFrame('Frame', nil, self)
- debuffs:SetHeight(width)
- debuffs:SetWidth(width)
- debuffs.PostCreateIcon = auraIcon
- if(unit == 'pet'or unit == 'focus' or unit == 'party') then
- debuffs:SetPoint('LEFT', self, 'RIGHT', 8, 0)
- debuffs['growth-x'] = 'RIGHT'
- debuffs.initialAnchor = 'LEFT'
- elseif(unit == 'player' or unit == 'targettarget') then
- debuffs:SetPoint('LEFT', self, 'RIGHT', 20, 5)
- debuffs['growth-x'] = 'RIGHT'
- debuffs.initialAnchor = 'LEFT'
- else
- debuffs:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', -4, 27)
- debuffs['growth-y'] = 'UP'
- debuffs.initialAnchor = 'BOTTOMLEFT'
- if(PlayerOnlyDebuffs)then
- debuffs.onlyShowPlayer = true
- end
- end
- debuffs.size = 32
- debuffs.spacing = 3
- if(unit == 'targettarget' or unit == 'player') then
- debuffs.num = 0
- elseif(unit=='target') then
- debuffs.num = 7
- else
- debuffs.num = 5
- end
- self.Debuffs = debuffs
- end
- if(unit == 'player') then
- if(IsAddOnLoaded('oUF_Swing')) then
- self.Swing = CreateFrame('StatusBar', nil, self)
- self.Swing:SetPoint('TOP', self, 'BOTTOM', 335, -65)
- self.Swing:SetStatusBarTexture(texture)
- self.Swing:SetStatusBarColor(1, 0.7, 0)
- self.Swing:SetHeight(15)
- self.Swing:SetWidth(width)
- self.Swing:SetBackdrop(backdrop)
- self.Swing:SetBackdropColor(0, 0, 0)
- local playerColor = RAID_CLASS_COLORS[select(2, UnitClass('player'))]
- if(SwingClassColors)then
- self.Swing:SetStatusBarColor(playerColor.r, playerColor.g, playerColor.b)
- end
- CreateBorder(self.Swing, 12, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3)
- self.Swing.Text = self.Swing:CreateFontString(nil, 'OVERLAY')
- self.Swing.Text:SetFont(font, 24, 'OUTLINE')
- self.Swing.Text:SetPoint('CENTER', self.Swing)
- self.Swing.bg = self.Swing:CreateTexture(nil, 'BORDER')
- self.Swing.bg:SetAllPoints(self.Swing)
- self.Swing.bg:SetTexture(0, 0, 0, 0.1)
- if(SwingMeele)then
- self.Swing.disableMelee = false
- end
- if(SwingRange)then
- self.Swing.disableRanged = false
- end
- end
- if(IsAddOnLoaded('oUF_RuneBar') and class == 'DEATHKNIGHT') then
- self.RuneBar = {}
- for i = 1, 6 do
- self.RuneBar[i] = CreateFrame('StatusBar', nil, self)
- if(i == 1) then
- self.RuneBar[i]:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -8)
- else
- self.RuneBar[i]:SetPoint('TOPLEFT', self.RuneBar[i-1], 'TOPRIGHT', 5, 0)
- end
- self.RuneBar[i]:SetStatusBarTexture(texture)
- self.RuneBar[i]:SetHeight(10)
- self.RuneBar[i]:SetWidth(250/6 - 0.85)
- self.RuneBar[i]:SetBackdrop(backdrop)
- self.RuneBar[i]:SetBackdropColor(0, 0, 0)
- self.RuneBar[i]:SetMinMaxValues(0, 1)
- CreateBorder(self.RuneBar[i], 12, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3)
- self.RuneBar[i].bg = self.RuneBar[i]:CreateTexture(nil, 'BORDER')
- self.RuneBar[i].bg:SetAllPoints(self.RuneBar[i])
- self.RuneBar[i].bg:SetTexture(0.1, 0.1, 0.1)
- end
- end
- if IsAddOnLoaded('oUF_TotemBar') and class == 'SHAMAN' then
- self.TotemBar = {}
- self.TotemBar.Destroy = true
- for i = 1, 4 do
- self.TotemBar[i] = CreateFrame('StatusBar', nil, self)
- self.TotemBar[i]:SetHeight(12)
- self.TotemBar[i]:SetWidth(265/4 - 5)
- if (i == 1) then
- self.TotemBar[i]:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', -1, -9)
- else
- self.TotemBar[i]:SetPoint('RIGHT', self.TotemBar[i-1], 'LEFT', -8, 0)
- end
- CreateBorder(self.TotemBar[i], 12, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3)
- self.TotemBar[i]:SetStatusBarTexture(texture)
- self.TotemBar[i]:SetBackdrop(backdrop)
- self.TotemBar[i]:SetBackdropColor(0,0,0,6)
- self.TotemBar[i]:SetMinMaxValues(0, 1)
- self.TotemBar[i].bg = self.TotemBar[i]:CreateTexture(nil, 'BORDER')
- self.TotemBar[i].bg:SetAllPoints(self.TotemBar[i])
- self.TotemBar[i].bg:SetTexture(texture)
- self.TotemBar[i].bg.multiplier = 0.3
- end
- end
- if(IsAddOnLoaded('oUF_Experience')) then
- self.Experience = CreateFrame('StatusBar', nil, self)
- self.Experience:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -13)
- self.Experience:SetStatusBarTexture(texture)
- self.Experience:SetStatusBarColor(0,.7,1)
- self.Experience:SetHeight(15)
- self.Experience:SetWidth((unit == 'pet') and 150 or width)
- self.Experience:SetBackdrop(backdrop)
- self.Experience:SetBackdropColor(0, 0, 0, .5)
- self.Experience.Tooltip = true
- CreateBorder(self.Experience, 12, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3)
- self.Experience.Text = self.Experience:CreateFontString(nil, 'OVERLAY')
- self.Experience.Text:SetFont(font, fontsize, 'OUTLINE')
- self.Experience.Text:SetPoint('CENTER', self.Experience)
- self.Experience.bg = self.Experience:CreateTexture(nil, 'BORDER')
- self.Experience.bg:SetAllPoints(self.Experience)
- self.Experience.bg:SetTexture(0, 0, 0, .5)
- end
- if(class == 'DRUID') then
- self.DruidPower = CreateFrame('StatusBar', nil, self)
- self.DruidPower:SetPoint('BOTTOM', self.Power, 'TOP')
- self.DruidPower:SetStatusBarTexture(texture)
- self.DruidPower:SetHeight(1)
- self.DruidPower:SetWidth(width)
- self.DruidPower:SetAlpha(0)
- self.DruidPower.Text = self.DruidPower:CreateFontString(nil, 'OVERLAY')
- self.DruidPower.Text:SetFont(font, fontsize, 'OUTLINE')
- self.DruidPower.Text:SetPoint('CENTER', self.DruidPower)
- self.DruidPower.Text:SetTextColor(unpack(colors.power['MANA']))
- self:RegisterEvent('UNIT_MANA', UpdateDruidPower)
- self:RegisterEvent('UNIT_ENERGY', UpdateDruidPower)
- self:RegisterEvent('PLAYER_LOGIN', UpdateDruidPower)
- end
- end
- if(unit == 'player' or unit == 'target' or unit =='focus' or unit == 'pet' or unit == 'targetarget' or unit == 'focustarget') then
- self.Range = {
- insideAlpha = 1,
- outsideAlpha = 0.3,
- }
- self.SpellRange = true
- self.SpellRange = {
- insideAlpha = 1,
- outsideAlpha = 0.3,
- }
- end
- if(unit == 'targettarget' or unit == 'focus' or unit == 'pet' or unit == 'focustarget' or unit == 'party') then
- self:SetAttribute('initial-height', height)
- self:SetAttribute('initial-width', 150)
- else
- self:SetAttribute('initial-height', height)
- self:SetAttribute('initial-width', width)
- end
- self.disallowVehicleSwap = true
- return self
- end
- local function menu(self)
- if(self.unit:match('party')) then
- ToggleDropDownMenu(1, nil, _G['PartyMemberFrame'..self.id..'DropDown'], 'cursor')
- else
- FriendsDropDown.unit = self.unit
- FriendsDropDown.id = self.id
- FriendsDropDown.initialize = RaidFrameDropDown_Initialize
- ToggleDropDownMenu(1, nil, FriendsDropDown, 'cursor')
- end
- end
- local function UpdateThreat(self, _, unit)
- if (self.unit ~= unit) then
- return
- end
- if (self.Aggro) then
- local threat = UnitThreatSituation(self.unit)
- if (threat == 3) then
- self.Aggro:SetText('|cFFFF0000AGGRO')
- self.Health:SetBackdropColor(0.9, 0, 0)
- else
- self.Aggro:SetText('')
- self.Health:SetBackdropColor(0, 0, 0)
- end
- end
- end
- local function raidlayout(self, unit)
- self.menu = menu
- self:RegisterForClicks('AnyUp')
- self:SetScript('OnEnter', UnitFrame_OnEnter)
- self:SetScript('OnLeave', UnitFrame_OnLeave)
- self:SetAttribute('*type2', 'menu')
- self:SetAttribute('initial-height', 38)
- self:SetAttribute('initial-width', 42)
- CreateBorder(self, 11, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4)
- self:SetBackdrop({bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=], insets = {top = -1.5, left = -1.5, bottom = -1.5, right = -1.5}})
- self:SetBackdropColor(0, 0, 0, 0.8)
- self.DebuffHighlightBackdrop = true
- self.DebuffHighlightFilter = true
- self.Health = CreateFrame('StatusBar', nil, self)
- self.Health:SetStatusBarTexture(bartexture)
- self.Health:SetParent(self)
- self.Health:SetAllPoints(self)
- self.Health.colorClass = true
- self.Health.Smooth = true
- self.Health:SetOrientation('HORIZONTAL')
- self.Health:SetOrientation('VERTICAL')
- self.Health.bg = self.Health:CreateTexture(nil, 'BORDER')
- self.Health.bg:SetAllPoints(self.Health)
- self.Health.bg:SetTexture(bartexture)
- self.Health.bg:SetAlpha(0.4)
- self.Name = self.Health:CreateFontString(nil, 'OVERLAY')
- self.Name:SetPoint('TOP', 0, -12)
- self.Name:SetFont(font, 11, 'OUTLINE')
- self:Tag(self.Name, '|cffffffff[AfterRaidName]|r')
- self.MasterLooter = self.Health:CreateTexture('$parentMasterLooterIcon', 'OVERLAY', self)
- self.MasterLooter:SetHeight(12)
- self.MasterLooter:SetWidth(12)
- self.MasterLooter:SetPoint('RIGHT', self.Health, 'TOPRIGHT', 2, 2)
- self.Leader = self.Health:CreateTexture('$parentLeaderIcon', 'OVERLAY', self)
- self.Leader:SetHeight(14)
- self.Leader:SetWidth(14)
- self.Leader:SetPoint('LEFT', self.Health, 'TOPLEFT', -5, 2)
- self.RaidIcon = self.Health:CreateTexture(nil, 'OVERLAY')
- self.RaidIcon:SetHeight(17)
- self.RaidIcon:SetWidth(17)
- self.RaidIcon:SetPoint('CENTER', self, 'TOP')
- self.RaidIcon:SetTexture('Interface\\TargetingFrame\\UI-RaidTargetingIcons')
- self.ReadyCheck = self.Health:CreateTexture(nil, 'OVERLAY')
- self.ReadyCheck:SetPoint('TOPRIGHT', self.Health, -7, -7)
- self.ReadyCheck:SetPoint('BOTTOMLEFT', self.Health, 7, 7)
- self.ReadyCheck.delayTime = 4
- self.ReadyCheck.fadeTime = 1
- self.Aggro = self.Health:CreateFontString(nil, 'OVERLAY')
- self.Aggro:SetPoint('CENTER', self.Health, 'BOTTOM')
- self.Aggro:SetFont(font, 11, 'OUTLINE')
- table.insert(self.__elements, UpdateThreat)
- self:RegisterEvent('PLAYER_TARGET_CHANGED', UpdateThreat)
- self:RegisterEvent('UNIT_THREAT_LIST_UPDATE', UpdateThreat)
- self:RegisterEvent('UNIT_THREAT_SITUATION_UPDATE', UpdateThreat)
- self.Range = {
- insideAlpha = 1,
- outsideAlpha = 0.3,
- }
- self.SpellRange = {
- insideAlpha = 1,
- outsideAlpha = 0.3,
- }
- return self
- end
- oUF:RegisterStyle('AftermathhRaid', raidlayout)
- oUF:SetActiveStyle('AftermathhRaid')
- local raid = oUF:SpawnHeader(nil, nil, 'raid,solo',
- 'showPlayer', true,
- 'showSolo', false,
- 'showRaid', true,
- 'xoffset', 12,
- 'yOffset', -5,
- 'point', 'LEFT',
- 'groupFilter', '1,2,3,4,5,6,7,8',
- 'groupingOrder', '1,2,3,4,5,6,7,8',
- 'groupBy', 'GROUP',
- 'maxColumns', 12,
- 'unitsPerColumn', 5,
- 'columnSpacing', 12,
- 'columnAnchorPoint', 'TOP'
- )
- raid:SetPoint('TOPLEFT', UIParent, 10, -8)
- oUF:RegisterStyle('Aftermathh', func)
- oUF:SetActiveStyle('Aftermathh')
- local party = oUF:SpawnHeader(nil, nil, 'party',
- 'showPlayer', false,
- 'showParty', true,
- 'xoffset', 12,
- 'yOffset', -52
- )
- party:SetPoint('TOPLEFT', UIParent, 99, -14)
- party:SetScale(0.90)
- local player = oUF:Spawn('player')
- player:SetPoint('BOTTOMLEFT', UIParent, 196, 182)
- local target = oUF:Spawn('target')
- target:SetPoint('BOTTOMRIGHT', UIParent, -237, 184)
- local tot = oUF:Spawn('targettarget')
- tot:SetPoint('RIGHT', UIParent, -75, -189)
- local pet = oUF:Spawn('pet')
- pet:SetPoint('LEFT', UIParent, 105, -156)
- pet:SetScale(0.90)
- local focus = oUF:Spawn('focus')
- focus:SetPoint('LEFT', UIParent, 108, -45)
- focus:SetScale(0.90)
- local focustarget = oUF:Spawn('focustarget')
- focustarget:SetPoint('LEFT', UIParent, 17, -3)
- focustarget:SetScale(0.90)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement