I've created a function for my raid frames (which also functions as party frames) which only shows dispellable debuffs, otherwise hide's the icon. However since I have show player (me) on in the raid frames that frame in the raid shows every debuff as the if unit=='player' setting has different goals (shows every debuff).
How can I modify the check for 'player' to NOT modify the myself in the raid frames?
lua Code:
-- debuff highlight
local CanDispel = {
PRIEST = { Magic = true, Disease = false, },
SHAMAN = { Poison = true, Disease = true, },
PALADIN = { Magic = true, Poison = true, Disease = true, },
MAGE = { Curse = true, },
DRUID = { Curse = true, Poison = true, }
}
local dispellist = CanDispel[playerClass] or {}
-- update icon
local PostUpdateIcon
do
local playerUnits = {
player = true,
pet = true,
vehicle = true,
}
PostUpdateIcon = function(icons, unit, icon, index, offset, filter, isDebuff)
local name, _, _, _, dtype, duration, expirationTime, unitCaster, _ = UnitAura(unit, index, icon.filter)
local texture = icon.icon
-- icon timers
if unit == "target" or unit == "focus" then
icon.time:Show()
icon.timeLeft = expirationTime
icon:SetScript("OnUpdate", CreateAuraTimer)
else
if duration and duration > 0 then
icon.time:Show()
icon.timeLeft = expirationTime
icon:SetScript("OnUpdate", CreateAuraTimer)
else
icon:SetScript("OnUpdate", CreateAuraTimer)
icon.time:Hide()
if unit == 'player' then
icon:Hide()
end
end
end
-- Debuff coloring
if unit == "target" or unit == "focus" then
if (playerUnits[icon.owner]) then
if icon.debuff then
local color = DebuffTypeColor[dtype] or {r=0,g=0,b=0}
icon.bd:SetBackdropBorderColor(color.r*0.9, color.g*0.9, color.b*0.9)
end
texture:SetDesaturated(false)
else
if icon.debuff then
icon.bd:SetBackdropBorderColor(unpack(cfg.brdcolor))
texture:SetDesaturated(true)
end
end
else
if ((unit=='player') or unit == 'pet' or unit == 'targettarget') then
if icon.debuff then
local color = DebuffTypeColor[dtype] or {r=1,g=0,b=0}
icon.bd:SetBackdropBorderColor(color.r*0.9, color.g*0.9, color.b*0.9)
texture:SetDesaturated(false)
end
else
if dispellist[dtype] and icon.debuff then
local color = DebuffTypeColor[dtype] or {r=0,g=0,b=0}
icon.bd:SetBackdropBorderColor(color.r*0.9, color.g*0.9, color.b*0.9)
texture:SetDesaturated(false)
icon:SetFrameStrata("HIGH")
icon.bd:SetFrameStrata("MEDIUM")
else
icon:Hide()
end
end
end
icon.first = true
end
end
Spawn raid code for reference if needed:
lua Code:
if cfg.RaidFrames then
self:SetActiveStyle"Shakes - Raid"
--local raid = self:SpawnHeader('oUF_Raid', nil, 'raid10',
local raid = self:SpawnHeader('oUF_Raid', nil, 'party,raid,solo',
'showRaid', true,
'showParty', true,
'showPlayer', true,
'xOffset', 5,
--'yOffset', -3,
'groupFilter', '1,2,3,4,5,6,7,8',
'groupingOrder', '1,2,3,4,5,6,7,8',
'groupBy', 'GROUP',
'maxColumns', 8,
'unitsPerColumn', 5,
'columnSpacing', 1,
'point', 'LEFT',
'columnAnchorPoint', "TOP",
'oUF-initialConfigFunction', ([[
self:SetWidth(%d)
self:SetHeight(%d)
]]):format(cfg.widthR, cfg.heightR + 8 + cfg.PPyOffset-1))
local raidanchor
local spec = GetPrimaryTalentTree()
if ((unitClass == "DRUID" and spec == 3) or (unitClass == "PRIEST" and spec < 3) or (unitClass == "SHAMAN" and spec == 3) or (unitClass == "PALADIN" and spec == 1)) then
raidanchor = oUF_ShakesTarget
else
raidanchor = oUF_ShakesPlayer
end
local RWatcher = CreateFrame("Frame")
RWatcher:RegisterEvent("RAID_ROSTER_UPDATE")
RWatcher:RegisterEvent("PARTY_CONVERTED_TO_RAID")
RWatcher:RegisterEvent("PARTY_MEMBERS_CHANGED")
RWatcher:RegisterEvent("PLAYER_ENTERING_WORLD")
RWatcher:SetScript("OnEvent", function(self,event,...)
if GetNumRaidMembers() <= 25 then
raid:SetPoint("TOPLEFT", raidanchor, "BOTTOMLEFT", 0, -5)
else
raid:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 20, -20)
end
end)
end