View Single Post
11-20-12, 02:28 PM   #6
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
I only overflew the code for oUF_Mlight. What you linked in your post is apparently some custom aura element for tank buffs. There is another one for raid debuffs I suppose and the standard oUF auras element in core.lua. I suppose you don't need to change the first two and only want the alter the behavior of the default aura element.

In that case you'll want to change PostUpdateIcon like that:
Code:
local PostUpdateIcon = function(icons, unit, icon, index, offset)
	local name, _, _, _, _, duration, expirationTime, caster, _, _, SpellID = UnitAura(unit, index, icon.filter)

	if icon.isPlayer or UnitIsFriend("player", unit) or not icon.isDebuff or oUF_MlightDB.AuraFilterwhitelist[tostring(SpellID)] then
		icon.icon:SetDesaturated(false)
		if duration and duration > 0 then
			icon.remaining:Show()
		else
			icon.remaining:Hide()
		end
		icon.count:Show()
		
		local _, class = UnitClass(caster)
		if class then
			local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
			if color then
				icon.bd:SetBackdropBorderColor(color.r, color.g, color.b,1)
			end
		end
	else
		icon.icon:SetDesaturated(true) -- grey other's debuff casted on enemy.
		icon.overlay:Hide()
		icon.remaining:Hide()
		icon.count:Hide()
	end

	if duration then
		icon.bd:Show() -- if the aura is not a gap icon show it"s bd
	end

	icon.expires = expirationTime
	icon:SetScript("OnUpdate", CreateAuraTimer)
end
I haven't tested this and I don't know if it plays well with all the conditions for desaturation and hiding the backdrop.
  Reply With Quote