BigDebuffs

BigDebuffs

20M Downloads

Request: Buff White- and Blacklist - and example for priests

GPIforGit opened this issue ยท 0 comments

commented

I play a priest, in raid I want to see every
Power Word: Fortitude / Prayer of Fortitude
Divine Spirit / Prayer of Spirit
Shadow Protection / Prayer of Shadow Protection
not only the ones, I had casted. But when in combat, i never need this information
Because only one Priest can cast "renew" and powerword: shild on one player, I want always see all of them.

I modified the code a litte bit:
I added at the beginning of BigDebuffs.lua this code:

local MyAllwaysShowOutCombat={1243,1244,1245,2791,10937,10938, 21562,21564, --Power Word: Fortitude / Prayer of Fortitude
	14752,14818,14819,27841, 27681, -- Divine Spirit / Prayer of Spirit
	976,10957,10958, 27683,-- Shadow Protection / Prayer of Shadow Protection
	}
local MyNeverShowCombat={1243,1244,1245,2791,10937,10938, 21562,21564, --Power Word: Fortitude / Prayer of Fortitude
	14752,14818,14819,27841, 27681, -- Divine Spirit / Prayer of Spirit
	976,10957,10958, 27683,-- Shadow Protection / Prayer of Shadow Protection
	}
local MyAllwaysShow={
	139,6074,6075,6076,6077,6078,10927,10928,10929,25315, --renew
	17,592,600,3747,6065,6066,10898,10899,10900,10901, -- powerword: shild
	}
	
	
local function MyCompactUnitFrame_UtilShouldDisplayBuff(unit, index, filter)
-- copied from CompactUnitFrame.lua from blizzard
	local name, icon, count, debuffType, duration, expirationTime, unitCaster, canStealOrPurge, _, spellId, canApplyAura = UnitBuff(unit, index, filter);
--new
	if UnitAffectingCombat("player") then
		if tContains(MyNeverShowCombat,spellId) then
			return false
		end
		if tContains(MyAllwaysShow,spellId) then
			return true
		end
	else 
		if tContains(MyAllwaysShowOutCombat,spellId) or tContains(MyAllwaysShow,spellId) then
			return true
		end
	end
--endnew		
	
	local hasCustom, alwaysShowMine, showForMySpec = SpellGetVisibilityInfo(spellId, UnitAffectingCombat("player") and "RAID_INCOMBAT" or "RAID_OUTOFCOMBAT");

	if ( hasCustom ) then
		return showForMySpec or (alwaysShowMine and (unitCaster == "player" or unitCaster == "pet" or unitCaster == "vehicle"));
	else
		return (unitCaster == "player" or unitCaster == "pet" or unitCaster == "vehicle") and canApplyAura and not SpellIsSelfBuff(spellId);
	end
end

And replace the two CompactUnitFrame_UtilShouldDisplayBuff in BigDebuffs.lua with MyCompactUnitFrame_UtilShouldDisplayBuff

of course for other classes (mages, druids) need other buffs, this is only a "hotfix" for the priest-class