Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local _, ns = ...
- local oUF = ns.oUF or oUF
- 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:SetWidth(250)
- local ht = CreateFrame('Button', 'PlayerHealthTextFrame', self)
- ht:SetSize(50,10)
- ht:SetPoint('LEFT', self, 'RIGHT', 5, 2)
- ht:EnableMouse(false)
- ht:RegisterEvent('PLAYER_ENTERING_WORLD')
- ht:RegisterUnitEvent('UNIT_HEALTH', 'player', 'vehicle')
- ht:RegisterUnitEvent('UNIT_ENTERED_VEHICLE', 'player')
- ht:RegisterUnitEvent('UNIT_EXITED_VEHICLE', 'player')
- local htt = ht:CreateFontString('PlayerHealthText', 'OVERLAY')
- htt:SetAllPoints(true)
- htt:SetFont(FONT, 11, 'OUTLINE')
- htt:SetJustifyH('LEFT')
- local hcur1, hmax1, r1, g1
- ht:SetScript('OnEvent', function(self, event, unit)
- if UnitIsGhost('player') then
- return htt:SetText('|cffb40000Ghost')
- elseif UnitIsDead('player') then
- return htt:SetText('|cffb40000Dead')
- elseif (event == 'PLAYER_ENTERING_WORLD' and UnitInVehicle('player')) or event == 'UNIT_ENTERED_VEHICLE' then
- ht:UnregisterEvent('UNIT_HEALTH')
- ht:RegisterUnitEvent('UNIT_HEALTH', 'vehicle')
- hcur1, hmax1 = UnitHealth('vehicle'), UnitHealthMax('vehicle')
- elseif event == 'PLAYER_ENTERING_WORLD' or event == 'UNIT_EXITED_VEHICLE' then
- ht:UnregisterEvent('UNIT_HEALTH')
- ht:RegisterUnitEvent('UNIT_HEALTH', 'player')
- hcur1, hmax1 = UnitHealth('player'), UnitHealthMax('player')
- elseif (event == 'UNIT_HEALTH' and UnitInVehicle('player')) then
- hcur1, hmax1 = UnitHealth('vehicle'), UnitHealthMax('vehicle')
- elseif event == 'UNIT_HEALTH' then
- hcur1, hmax1 = UnitHealth('player'), UnitHealthMax('player')
- end
- if hcur1 < hmax1 then
- hr1, hg1 = 180, 0
- else
- hr1, hg1 = 0, 180
- end
- if hcur1 >= 1000000 then
- hcur1 = format('%.1fm', hcur1 / 1000000)
- elseif hcur1 >= 1000 then
- hcur1 = format('%.0fk', hcur1 / 1000)
- end
- htt:SetFormattedText('|cff%02x%02x%02x%s', hr1, hg1, 0, hcur1)
- end)
- local htp = CreateFrame('Button', 'PlayerHealthPercentageTextFrame', self)
- htp:SetSize(50,10)
- htp:SetPoint('RIGHT', self, 'LEFT', -5, 2)
- htp:EnableMouse(false)
- htp:RegisterEvent('PLAYER_ENTERING_WORLD')
- htp:RegisterUnitEvent('UNIT_HEALTH', 'player', 'vehicle')
- htp:RegisterUnitEvent('UNIT_ENTERED_VEHICLE', 'player')
- htp:RegisterUnitEvent('UNIT_EXITED_VEHICLE', 'player')
- local htpt = htp:CreateFontString('PlayerHealthPercentageText', 'OVERLAY')
- htpt:SetAllPoints(true)
- htpt:SetFont(FONT, 11, 'OUTLINE')
- htpt:SetJustifyH('RIGHT')
- htp:SetScript('OnEvent', function(self, event, unit)
- local hcur2, hmax2 = UnitHealth('player'), UnitHealthMax('player')
- local hr2, hg2
- if (event == 'PLAYER_ENTERING_WORLD' and UnitInVehicle('player')) or event == 'UNIT_ENTERED_VEHICLE' then
- htp:UnregisterEvent('UNIT_HEALTH')
- htp:RegisterUnitEvent('UNIT_HEALTH', 'vehicle')
- hcur2, hmax2 = UnitHealth('vehicle'), UnitHealthMax('vehicle')
- elseif event == 'PLAYER_ENTERING_WORLD' or event == 'UNIT_EXITED_VEHICLE' then
- htp:UnregisterEvent('UNIT_HEALTH')
- htp:RegisterUnitEvent('UNIT_HEALTH', 'player')
- hcur2, hmax2 = UnitHealth('player'), UnitHealthMax('player')
- elseif event == 'UNIT_HEALTH' and UnitInVehicle('player') then
- hcur2 = UnitHealth('vehicle')
- hmax2 = UnitHealthMax('vehicle')
- elseif event == 'UNIT_HEALTH' then
- hcur2 = UnitHealth('player')
- hmax2 = UnitHealthMax('player')
- end
- if hcur2/hmax2 < 0.35 then
- hr2, hg2 = 180, 0
- else
- hr2, hg2 = 0, 180
- end
- local a = round(100*(hcur2/hmax2))
- htpt:SetFormattedText('|cff%02x%02x%02x%s'..'%%', hr2, hg2, 0, a)
- end)
- local pt = CreateFrame('Button', 'PlayerPowerTextFrame', self)
- pt:SetSize(40,10)
- pt:SetPoint('BOTTOMLEFT', self, 'BOTTOMRIGHT', 5, 0)
- pt:EnableMouse(false)
- pt:RegisterEvent('PLAYER_ENTERING_WORLD')
- pt:RegisterUnitEvent('UNIT_POWER_FREQUENT', 'player', 'vehicle')
- pt:RegisterUnitEvent('UNIT_ENTERED_VEHICLE', 'player')
- pt:RegisterUnitEvent('UNIT_EXITED_VEHICLE', 'player')
- pt:RegisterUnitEvent('UNIT_MODEL_UPDATE', 'player')
- local ptt = pt:CreateFontString('PlayerPowerText', 'OVERLAY')
- ptt:SetAllPoints(true)
- ptt:SetFont(FONT, 11, 'OUTLINE')
- ptt:SetJustifyH('LEFT')
- local pcur
- local pr, pg, pb
- local playerpowertype = select(2,UnitPowerType('player'))
- pt:SetScript('OnEvent', function(self, event, unit)
- if event == 'UNIT_ENTERED_VEHICLE' or (event == 'PLAYER_ENTERING_WORLD' and UnitInVehicle('player')) then
- pt:UnregisterEvent('UNIT_POWER_FREQUENT')
- pt:RegisterUnitEvent('UNIT_POWER_FREQUENT', 'vehicle')
- playerpowertype = select(2,UnitPowerType('vehicle'))
- pcur = UnitPower('vehicle')
- elseif event == 'PLAYER_ENTERING_WORLD' or event == 'UNIT_EXITED_VEHICLE' then
- pt:UnregisterEvent('UNIT_POWER_FREQUENT')
- pt:RegisterUnitEvent('UNIT_POWER_FREQUENT', 'player')
- playerpowertype = select(2,UnitPowerType('player'))
- pcur = UnitPower('player')
- elseif event == 'UNIT_POWER_FREQUENT' and UnitInVehicle('player') then
- pcur = UnitPower('vehicle')
- elseif event == 'UNIT_POWER_FREQUENT' then
- pcur = UnitPower('player')
- elseif event == 'UNIT_MODEL_UPDATE' then
- local playerpowertype = select(2,UnitPowerType('player'))
- end
- if playerpowertype and pcur > 0 then
- if playerpowertype == 'MANA' then
- pr, pg, pb = 0, 100, 255
- if pcur >= 1000000 then
- format('%.1fm', pcur / 1000000)
- elseif pcur >= 1000 then
- pcur = format('%.0fk', pcur / 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
- ptt:SetFormattedText('|cff%02x%02x%02x%s', pr, pg, pb, pcur)
- else
- ptt:SetText('')
- end
- end)
- local BuffBars = CreateFrame('Frame', 'PlayerBuffBarFrame', self)
- BuffBars:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 0, 18)
- BuffBars:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', -20, 18)
- BuffBars.fontFile, BuffBars.fontOutline = FONT, 'OUTLINE'
- self.BuffBars = BuffBars
- BuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, casterUnit, _, _, spellID, _, _, _, _, _)
- if spellID == 2823 --deadly poison
- or spellID == 108211 --leeching poison
- or spellID == 5761 --mind-numbing poison
- or spellID == 3408 --crippling poison
- or spellID == 8679 --wound poison
- or spellID == 108215 --paralytic 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 == 121471 --shadow blades
- or spellID == 120032 --dancing steel
- or spellID == 105697 --virmen's bite
- or spellID == 126734 --gloves
- or spellID == 1966 --feint
- or spellID == 73651 --recuperate
- or spellID == 148903 --trinket
- or spellID == 146308 --trinket
- or spellID == 31224 --cloak of shadows
- or spellID == 114206 --skull banner
- or spellID == 120676 --stormlash totem
- 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 == 5277 --evasion
- or spellID == 74001 --combat readiness
- or spellID == 74002 --combat insight
- or spellID == 114842 --shadow walk
- or spellID == 114018 --shroud of concealment
- or spellID == 32182 --heroism
- or spellID == 146555 --drums of rage
- or spellID == 76089 --virmens bite
- or spellID == 129159 --blackguards buff
- or spellID == 32645 --envenom
- or spellID == 31665 --Master of subtlety
- or spellID == 126707 --pvp proc trinket
- or spellID == 126690 --onuse pvp trinket
- or spellID == 115192 --subterfuge
- or spellID == 51713 --shadowdance
- then
- return true
- elseif casterUnit == 'vehicle' then
- return true
- else
- return false
- end
- end
- local DebuffBars = CreateFrame("Frame", 'PlayerDebuffBarFrame', self)
- DebuffBars:SetPoint('TOPLEFT', 'rABS_MultiBarRight', 'BOTTOMLEFT', 0, 0)
- DebuffBars:SetPoint('TOPRIGHT', 'rABS_MultiBarRight', 'BOTTOMRIGHT', -20, 0)
- DebuffBars.growDown = true
- DebuffBars.dispelTypeColors = true
- DebuffBars.fontFile, DebuffBars.fontOutline = FONT, 'OUTLINE'
- self.DebuffBars = DebuffBars
- DebuffBars.customFilter = function(_, _, name, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _)
- if name ~= 'Recently Mass Resurrected' then
- return true
- end
- end
- local cf = CreateFrame('Button', 'PlayerCombatStatusFrame', self)
- cf:SetSize(3,8)
- cf:SetPoint('TOPLEFT', self, 'TOPLEFT', 7,0)
- cf:RegisterEvent('PLAYER_ENTERING_WORLD')
- cf:RegisterEvent('PLAYER_REGEN_DISABLED')
- cf:RegisterEvent('PLAYER_REGEN_ENABLED')
- local ct = cf:CreateTexture('PlayerCombatStatusTexture', 'OVERLAY')
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ct:SetTexture('Interface\AddOns\oUF_Skaarj\Media\F1_StatusBox_Bar')
- ct:SetTexture(1,0,0)
- ct:SetAllPoints(true)
- cf:SetScript('OnEvent', function(self, event, unit)
- if event == 'PLAYER_REGEN_DISABLED' then
- ct:Show()
- elseif event == 'PLAYER_REGEN_ENABLED' then
- ct:Hide()
- elseif event == 'PLAYER_ENTERING_WORLD' then
- if UnitAffectingCombat('player') then
- ct:Show()
- else
- ct:Hide()
- end
- end
- end)
- local rf = CreateFrame('Button', 'PlayerRestingStatusFrame', self)
- rf:SetSize(3,8)
- rf:SetPoint('TOPLEFT', self, 'TOPLEFT', 12, 0)
- rf:RegisterEvent('PLAYER_ENTERING_WORLD')
- rf:RegisterEvent('PLAYER_UPDATE_RESTING')
- local rt = rf:CreateTexture('PlayerRestingStatusTexture', 'OVERLAY')
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- rt:SetTexture('Interface\AddOns\oUF_Skaarj\Media\F1_StatusBox_Bar')
- rt:SetTexture(0.41, 0.8, 0.94)
- rt:SetAllPoints(true)
- rf:SetScript('OnEvent', function(self, event, unit)
- if IsResting() then
- rt:Show()
- else
- rt:Hide()
- end
- end)
- local laf = CreateFrame('Button', 'PlayerLeaderAssistFrame', self)
- laf:SetSize(3,8)
- laf:SetPoint('TOPLEFT', self, 'TOPLEFT', 2, 0)
- laf:RegisterEvent('GROUP_ROSTER_UPDATE')
- laf:RegisterEvent('PARTY_LEADER_CHANGED')
- laf:RegisterEvent('PLAYER_ENTERING_WORLD')
- local lat = laf:CreateTexture('PlayerLeaderAssistStatusTexture', 'OVERLAY')
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- lat:SetTexture('Interface\AddOns\oUF_Skaarj\Media\F1_StatusBox_Bar')
- lat:SetTexture(1, 1, 0)
- lat:SetAllPoints(true)
- laf:SetScript('OnEvent', function(self, event, unit)
- if UnitIsGroupLeader('player') or UnitIsRaidOfficer('player') then
- lat:Show()
- else
- lat:Hide()
- end
- end)
- end,
- target = function(self)
- self:SetWidth(250)
- local ht = CreateFrame('Button', 'TargetHealthTextFrame', self)
- ht:SetSize(50,10)
- ht:SetPoint('RIGHT', self, 'LEFT', -5, 2)
- ht:EnableMouse(false)
- ht:RegisterEvent('PLAYER_TARGET_CHANGED')
- ht:RegisterUnitEvent('UNIT_HEALTH', 'target')
- ht:RegisterUnitEvent('UNIT_CONNECTION', 'target')
- local htt = ht:CreateFontString('TargetHealthText', 'OVERLAY')
- htt:SetAllPoints(true)
- htt:SetFont(FONT, 11, 'OUTLINE')
- htt:SetJustifyH('RIGHT')
- ht:SetScript('OnEvent', function(self, event, unit)
- local hcur, hmax = UnitHealth('target'), UnitHealthMax('target')
- local r, g, l
- if not UnitIsConnected('target') then
- htt:SetFormattedText('|cff%02x%02x%02xD/C', 180, 0, 0)
- elseif UnitIsDead('target') then
- htt:SetFormattedText('|cff%02x%02x%02xDead', 180, 0, 0)
- elseif UnitIsGhost('target') then
- htt:SetFormattedText('|cff%02x%02x%02xGhost', 180, 0, 0)
- else
- if hcur < hmax then
- r, g = 180, 0
- else
- r, g = 0, 180
- end
- if hcur >= 1000000 then
- l = 'm'
- hcur = round(hcur/1000000, 1)
- elseif hcur >= 1000 then
- l = 'k'
- hcur = round(hcur/1000)
- else
- l = ''
- end
- htt:SetFormattedText('|cff%02x%02x%02x%s'..l, r, g, 0, hcur)
- end
- end)
- local pt = CreateFrame('Button', 'TargetPowerTextFrame', self)
- pt:SetSize(45,10)
- pt:SetPoint('BOTTOMRIGHT', self, 'BOTTOMLEFT', -5, 0)
- pt:EnableMouse(false)
- pt:RegisterEvent('PLAYER_TARGET_CHANGED')
- pt:RegisterUnitEvent('UNIT_POWER_FREQUENT', 'target')
- local ptt = pt:CreateFontString('TargetPowerText', 'OVERLAY')
- ptt:SetAllPoints(true)
- ptt:SetFont(FONT, 11, 'OUTLINE')
- ptt:SetJustifyH('RIGHT')
- pt:SetScript('OnEvent', function(self, event, unit)
- local a = select(2,UnitPowerType('target'))
- local pcur = UnitPower('target')
- if a and pcur > 0 then
- local r, g, b, l
- if a == 'MANA' then
- r, g, b = 0, 100, 255
- if pcur >= 1000000 then
- pcur = round(pcur/1000000, 1)
- l = 'm'
- elseif pcur >= 1000 then
- pcur = round(pcur/1000)
- l = 'k'
- else
- l = ''
- end
- elseif a == 'FOCUS' then
- r, g, b, l = 255, 128, 65, ''
- elseif a == 'ENERGY' then
- r, g, b, l = 255, 255, 0, ''
- elseif a == 'RUNIC_POWER' then
- r, g, b, l = 0, 209, 255, ''
- elseif a == 'POWER_TYPE_FEL_ENERGY' then
- r, g, b, l = 166, 161, 89, ''
- else
- r, g, b, l = 255, 0, 0, ''
- end
- ptt:SetFormattedText('|cff%02x%02x%02x%d'..l, r, g, b, pcur)
- else
- ptt:SetText('')
- end
- end)
- local htp = CreateFrame('Button', 'TargetHealthPercentageTextFrame', self)
- htp:SetSize(50,15)
- htp:SetPoint('LEFT', self, 'RIGHT', 5, 2)
- htp:EnableMouse(false)
- htp:RegisterEvent('PLAYER_TARGET_CHANGED')
- htp:RegisterUnitEvent('UNIT_HEALTH', 'target')
- local htpt = htp:CreateFontString('TargetHealthPercentageText', 'OVERLAY')
- htpt:SetAllPoints(true)
- htpt:SetFont(FONT, 11, 'OUTLINE')
- htpt:SetJustifyH('LEFT')
- htp:SetScript('OnEvent', function(self, event, unit)
- local hcur, hmax = UnitHealth('target'), UnitHealthMax('target')
- local r, g
- if hcur/hmax < 0.35 then
- r, g = 180, 0
- else
- r, g = 0, 180
- end
- local a = round(100*(hcur/hmax))
- htpt:SetFormattedText('|cff%02x%02x%02x%s'..'%%', r, g, 0, a)
- end)
- local BuffBars = CreateFrame('Frame', 'TargetBuffBarFrame', self)
- BuffBars:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 20, 18)
- BuffBars:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', 0, 18)
- self.BuffBars = BuffBars
- BuffBars.fontFile, BuffBars.fontOutline = FONT, 'OUTLINE'
- 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 == 130609 or --Valor of the Ancients
- spellID == 93806 or --Darnassus Champion
- spellID == 93368 or --Wildhammer Champion
- spellID == 93337 or --Ramkahen Champion
- spellID == 126434 or --Tushui Champion
- 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 == 161780 or --Gaze of the Black Prince
- spellID == 128943 or --Cyclonic Inspiration
- 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
- local DebuffBars = CreateFrame("Frame", 'TargetDebuffBarFrame', self)
- DebuffBars:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT", 0, -40)
- DebuffBars:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 20, -40)
- self.DebuffBars = DebuffBars
- DebuffBars.growDown = true
- DebuffBars.fontFile, DebuffBars.fontOutline = FONT, 'OUTLINE'
- DebuffBars.customFilter = function(_, _, _, _, _, _, _, _, _, casterUnit, _, _, spellID, _, _, _, _, _)
- if casterUnit == 'player' then
- if spellID == 2818 --deadly poison
- or spellID == 93068 --master poisoner
- or spellID == 112961 -- leeching poison
- then
- return false
- else
- return true
- end
- elseif casterUnit == 'vehicle' then
- return true
- else
- return false
- end
- end
- local nm = CreateFrame('Button', 'TargetNameTextFrame', self)
- nm:SetSize(200,10)
- nm:SetPoint('TOPRIGHT', self, 'BOTTOMRIGHT', 0, -5)
- nm:EnableMouse(false)
- nm:RegisterEvent('PLAYER_TARGET_CHANGED')
- nm:RegisterUnitEvent('UNIT_LEVEL', 'target')
- nm:RegisterUnitEvent('UNIT_NAME_UPDATE', 'target')
- local nmt = nm:CreateFontString('TargetNameText', 'OVERLAY')
- nmt:SetAllPoints(true)
- nmt:SetFont(FONT, 11, 'OUTLINE')
- nmt:SetJustifyH('RIGHT')
- nm: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
- nmt: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
- nmt: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)
- local cr = CreateFrame('Button', 'TargetRareFrame', self)
- cr:SetSize(3,8)
- cr:SetPoint('TOPLEFT', self, 'TOPLEFT', 7, 0)
- cr:EnableMouse(false)
- cr:RegisterEvent('PLAYER_TARGET_CHANGED')
- cr:RegisterUnitEvent('UNIT_CLASSIFICATION_CHANGED', 'target')
- local crt = cr:CreateTexture('TargetRareStatusTexture', 'OVERLAY')
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- crt:SetTexture('Interface\AddOns\oUF_Skaarj\Media\F1_StatusBox_Bar')
- crt:SetTexture(.75, .75, .75)
- crt:SetAllPoints(true)
- cr:SetScript('OnEvent', function(self, event, unit)
- local classification = UnitClassification('target')
- if classification == 'rare' or classification == 'rareelite' then
- crt:Show()
- else
- crt:Hide()
- end
- end)
- local ce = CreateFrame('Button', 'TargetEliteFrame', self)
- ce:SetSize(3,8)
- ce:SetPoint('TOPLEFT', self, 'TOPLEFT', 2, 0)
- ce:EnableMouse(false)
- ce:RegisterEvent('PLAYER_TARGET_CHANGED')
- ce:RegisterUnitEvent('UNIT_CLASSIFICATION_CHANGED', 'target')
- local cet = ce:CreateTexture('TargetEliteStatusTexture', 'OVERLAY')
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------
- cet:SetTexture('Interface\AddOns\oUF_Skaarj\Media\F1_StatusBox_Bar')
- cet:SetTexture(.8, .63, .21)
- cet:SetAllPoints(true)
- ce:SetScript('OnEvent', function(self, event, unit)
- local classification = UnitClassification('target')
- if classification == 'elite' or classification == 'rareelite' then
- cet:Show()
- else
- cet:Hide()
- end
- end)
- local qf = CreateFrame('Button', 'TargetQuestTextureFrame', self)
- qf:SetSize(10,10)
- qf:SetPoint('CENTER', self, 'TOP', 0, 0)
- qf:EnableMouse(false)
- qf:RegisterEvent('PLAYER_TARGET_CHANGED')
- local qft = qf:CreateFontString('TargetQuestTexture', 'OVERLAY')
- qft:SetAllPoints(true)
- qft:SetFont(FONT, 20, 'OUTLINEMONOCHROME')
- qft:SetJustifyH('CENTER')
- qf:SetScript('OnEvent', function(self, event, unit)
- if UnitIsQuestBoss('target') then
- qft:SetFormattedText('|cff%02x%02x%02x!', 255,255,0)
- else
- qft:SetText('')
- end
- end)
- end,
- party = function(self)
- local Name = self.Health:CreateFontString(nil, 'OVERLAY')
- Name:SetPoint('CENTER', 0, 0)
- Name:SetFont(FONT, 11, 'OUTLINEMONOCHROME')
- self:Tag(Name, '[raidcolor][name:short]')
- local ReadyCheck = self.Health:CreateTexture(nil, 'OVERLAY')
- ReadyCheck:SetPoint('TOPRIGHT', self, 'TOPRIGHT', -3, -3)
- ReadyCheck:SetSize(14, 14)
- self.ReadyCheck = ReadyCheck
- self.Health:SetAllPoints()
- end,
- boss = function(self)
- self:SetSize(126, 19)
- self.Health:SetAllPoints()
- self:Tag(self.HealthValue, '[p3lim:percent]')
- end,
- arena = function(self)
- self:SetSize(126, 19)
- self:Tag(self.HealthValue, '[p3lim:percent]')
- self.Health:SetHeight(17)
- end
- }
- UnitSpecific.raid = UnitSpecific.party
- local function Shared(self, unit)
- unit = unit:match('(boss)%d?$') or unit:match('(arena)%d?$') or unit
- self:RegisterForClicks('AnyUp')
- self:SetScript('OnEnter', UnitFrame_OnEnter)
- self:SetScript('OnLeave', UnitFrame_OnLeave)
- self:SetBackdrop(BACKDROP)
- self:SetBackdropColor(0, 0, 0)
- local Health = CreateFrame('StatusBar', nil, self)
- 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)
- if(unit == 'player' or unit == 'target' or unit == 'arena') 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
- self.Power = Power
- Power.colorClass = true
- Power.colorClassNPC = true
- Power.colorClassPet = true
- local PowerBG = Power:CreateTexture(nil, 'BORDER')
- PowerBG:SetAllPoints()
- PowerBG:SetTexture(TEXTURE)
- PowerBG.multiplier = 1/3
- Power.bg = PowerBG
- if(unit ~= 'arena') then
- self:SetHeight(34)
- Health:SetHeight(31)
- end
- local RaidIcon = Health:CreateTexture(nil, 'OVERLAY')
- RaidIcon:SetPoint('TOP', self, 0, 8)
- RaidIcon:SetSize(16, 16)
- self.RaidIcon = RaidIcon
- Health:SetPoint('TOPRIGHT')
- Health:SetPoint('TOPLEFT')
- end
- if(unit ~= 'player' and unit ~= 'party' and unit ~= 'raid') then
- local Name = Health:CreateFontString(nil, 'OVERLAY')
- Name:SetPoint('LEFT', 2, 0)
- Name:SetPoint('RIGHT', HealthValue, 'LEFT')
- Name:SetFont(FONT, 11, 'OUTLINE')
- Name:SetJustifyH('LEFT')
- self:Tag(Name, '[p3lim:color][name][ |cff0090ff>rare<|r]')
- end
- if(unit ~= 'party' and unit ~= 'raid' and unit ~= 'boss') then
- if(unit == 'focus' or unit == 'targettarget') then
- Health:SetAllPoints()
- self:SetSize(90, 31)
- local Name = Health:CreateFontString(nil, 'OVERLAY')
- Name:SetPoint('CENTER', 0, 0)
- Name:SetFont(FONT, 11, 'OUTLINE')
- self:Tag(Name, '[raidcolor][name:short]')
- end
- end
- if(UnitSpecific[unit]) then
- return UnitSpecific[unit](self)
- end
- end
- oUF:RegisterStyle('P3lim', Shared)
- oUF:Factory(function(self)
- self:SetActiveStyle('P3lim')
- self:Spawn('player'):SetPoint('CENTER', -345, -36)
- self:Spawn('focus'):SetPoint('TOPRIGHT', oUF_P3limPlayer, 'TOPLEFT', -40, 0)
- self:Spawn('target'):SetPoint('CENTER', 345, -36)
- self:Spawn('targettarget'):SetPoint('TOPLEFT', oUF_P3limTarget, 'TOPRIGHT', 40, 0)
- self:SpawnHeader('P3lim_Party', nil,
- 'custom [@raid6, exists] hide; [group:party] show; [group:raid] show; hide',
- 'showPlayer', true,
- 'showSolo', false,
- 'showParty', true,
- 'showRaid', false,
- 'point', 'TOP',
- 'yOffset', -3,
- 'xOffset', 0,
- 'oUF-initialConfigFunction', [[
- self:SetHeight(72)
- self:SetWidth(120)
- ]]):SetPoint('TOPRIGHT', 'rABS_MultiBarRight', 'BOTTOMLEFT', -5, -60)
- self:SpawnHeader('P3lim_Raid', nil,
- 'custom [@raid6,exists] show; hide',
- 'showPlayer', true,
- 'showSolo', false,
- 'showParty', false,
- 'showRaid', true,
- 'point', 'TOP',
- 'yOffset', -1,
- 'xOffset', 0,
- "columnSpacing", 2,
- "columnAnchorPoint", "LEFT",
- "groupFilter", "1,2,3,4,5,6,7,8",
- "groupBy", "GROUP",
- "groupingOrder", "1,2,3,4,5,6,7,8",
- "sortMethod", "INDEX",
- "maxColumns", 8,
- "unitsPerColumn", 5,
- 'oUF-initialConfigFunction', [[
- self:SetHeight(35)
- self:SetWidth(85)
- ]]):SetPoint('BOTTOM', UIParent, 'BOTTOM', 0, 1)
- --self:SpawnHeader(nil, nil, 'custom [group:party] show; [@raid3,exists] show; [@raid26,exists] hide; hide','showParty', true, 'showRaid', true, 'showPlayer', true, 'yOffset', -6,
- --'oUF-initialConfigFunction',
- -- [[self:SetHeight(16)
- --self:SetWidth(126)]]):SetPoint('TOP', Minimap, 'BOTTOM', 0, -10)
- for index = 1, 5 do
- local boss = self:Spawn('boss' .. index)
- local arena = self:Spawn('arena' .. index)
- if(index == 1) then
- boss:SetPoint('TOP', oUF_P3limRaid or Minimap, 'BOTTOM', 0, -20)
- arena:SetPoint('TOP', oUF_P3limRaid or Minimap, 'BOTTOM', 0, -20)
- else
- boss:SetPoint('TOP', _G['oUF_P3limBoss' .. index - 1], 'BOTTOM', 0, -6)
- arena:SetPoint('TOP', _G['oUF_P3limArena' .. index - 1], 'BOTTOM', 0, -6)
- end
- local blizz = _G['Boss' .. index .. 'TargetFrame']
- blizz:UnregisterAllEvents()
- blizz:Hide()
- end
- end)
- local preperationFrames = {}
- for index = 1, 5 do
- local Frame = CreateFrame('Frame', 'oUF_P3limArenaPreperation' .. index, UIParent)
- Frame:SetSize(126, 19)
- Frame:SetBackdrop(BACKDROP)
- Frame:SetBackdropColor(0, 0, 0)
- Frame:Hide()
- local Health = Frame:CreateTexture(nil, 'BACKGROUND')
- Health:SetPoint('TOPRIGHT')
- Health:SetPoint('TOPLEFT')
- Health:SetHeight(17)
- Health:SetTexture(1/6, 1/6, 2/7)
- local Power = Frame:CreateTexture(nil, 'BACKGROUND')
- Power:SetPoint('BOTTOMRIGHT')
- Power:SetPoint('BOTTOMLEFT')
- Power:SetPoint('TOP', Health, 'BOTTOM', 0, -1)
- Frame.Power = Power
- local Spec = Frame:CreateFontString(nil, 'OVERLAY')
- Spec:SetPoint('LEFT', Health, 2, 0)
- Spec:SetFont(FONT, 11, 'OUTLINE')
- Spec:SetJustifyH('LEFT')
- Frame.Spec = Spec
- preperationFrames[index] = Frame
- end
- local PreperationHandler = CreateFrame('Frame')
- PreperationHandler:RegisterEvent('PLAYER_LOGIN')
- PreperationHandler:RegisterEvent('ARENA_OPPONENT_UPDATE')
- PreperationHandler:RegisterEvent('ARENA_PREP_OPPONENT_SPECIALIZATIONS')
- PreperationHandler:SetScript('OnEvent', function(self, event)
- if(event == 'PLAYER_LOGIN') then
- for index = 1, 5 do
- if(index == 1) then
- preperationFrames[index]:SetPoint('TOP', oUF_P3limRaid or Minimap, 'BOTTOM', 0, -20)
- else
- preperationFrames[index]:SetPoint('TOP', preperationFrames[index - 1], 'BOTTOM', 0, -6)
- end
- end
- elseif(event == 'ARENA_OPPONENT_UPDATE') then
- for index = 1, 5 do
- preperationFrames[index]:Hide()
- end
- else
- for index = 1, GetNumArenaOpponentSpecs() do
- local Frame = preperationFrames[index]
- local specID = GetArenaOpponentSpec(index)
- if(specID and specID > 0) then
- local _, name, _, _, _, _, class = GetSpecializationInfoByID(specID)
- local r, g, b, colorStr = RAID_CLASS_COLORS[class]
- Frame.Spec:SetFormattedText('|c%s%s|r', colorStr, name)
- Frame.Power:SetTexture(r, g, b)
- else
- Frame.Spec:SetText('Unknown')
- Frame.Power:SetTexture(1, 1, 1)
- end
- Frame:Show()
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement