Originally Posted by syncrow
For All player based debuffs we need
Lua Code:
filter = "HARMFUL|PLAYER"
|
I tried to show all (harmful) spells from the player, but didn't work
- When I tried Hemorrhage, nameplateShowPersonal always seemed to be false
Is it maybe because it's a talent?
https://gfycat.com/DeterminedDarkCarpenterant
Lua Code:
hooksecurefunc(NamePlateDriverFrame, "OnUnitAuraUpdate", function(self, unit)
local filter;
if UnitIsUnit("player", unit) then
filter = "HELPFUL|INCLUDE_NAME_PLATE_ONLY";
else
local reaction = UnitReaction("player", unit);
if reaction and reaction <= 4 then
-- Reaction 4 is neutral and less than 4 becomes increasingly more hostile
filter = "HARMFUL|PLAYER";
else
filter = "NONE";
end
end
local nameplate = C_NamePlate.GetNamePlateForUnit(unit);
if (nameplate) then
nameplate.UnitFrame.BuffFrame:UpdateBuffs(nameplate.namePlateUnitToken, filter);
end
-- debug
local name, rank, texture, count, debuffType, duration, expirationTime, caster, _, nameplateShowPersonal, spellId, _, _, _, nameplateShowAll = UnitAura(nameplate.namePlateUnitToken, 1, filter)
if nameplateShowPersonal ~= nil then -- still want boolean false
print(nameplate.namePlateUnitToken, filter, name, caster, nameplateShowAll, nameplateShowPersonal, (nameplateShowPersonal and (caster == "player" or caster == "pet" or caster == "vehicle")))
end
end)
NamePlateDriverMixin:OnUnitAuraUpdate
NameplateBuffContainerMixin:UpdateBuffs