Thread Tools Display Modes
05-31-23, 11:10 PM   #1
fearkite
A Defias Bandit
Join Date: Aug 2009
Posts: 3
Simple addon to disable default blizzard personal bar debuffs

Hey all!

I've been struggling with making this addon. I'm a complete noob at this, not even sure how to approach it, honestly.

Here is my attempt thus far to disable default blizzard personal bar debuffs:

Code:
local f=CreateFrame("frame")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
hooksecurefunc("CompactUnitFrame_UpdateAuras", function(frame)
    if frame.optionTable.colorNameBySelection then
        if UnitGUID(frame.unit) == UnitGUID("player") then
            frame.BuffFrame:Hide()
        else
            frame.BuffFrame:Show()
        end
    end
end)
Any help would be very much appreciated!

Thanks heaps <3
  Reply With Quote
06-06-23, 02:14 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
NamePlates use a custom buff handler, NameplateBuffContainerMixin:UpdateBuffs().

Lua Code:
  1. hooksecurefunc(NameplateBuffContainerMixin,"UpdateBuffs",function(self,unit)
  2.     if UnitIsUnit(unit,"player") then
  3.         self.buffPool:ReleaseAll();
  4.     end
  5. end);

This instructs the buff container to clear itself every time it gets an update call. It technically hooks all nameplate buff containers, but the unit check makes sure only the personal nameplate is affected.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
06-25-23, 01:36 AM   #3
fearkite
A Defias Bandit
Join Date: Aug 2009
Posts: 3
Thanks so much, SDPhantom! That seems to have worked. You're an absolute legend!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Simple addon to disable default blizzard personal bar debuffs


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off