View Single Post
11-19-19, 01:39 PM   #10
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
To isolate the adjustment to only when the name is showing, we'll just semi-recreate the original function managing the buff container.
Lua Code:
  1. hooksecurefunc(NameplateBuffContainerMixin,"UpdateAnchor",function(self)
  2.     local parent=self:GetParent();
  3.     local unit=parent.unit;
  4.  
  5.     if unit and ShouldShowName(parent) then
  6. --      Replicate the calculation of the original function
  7.         local offset=self:GetBaseYOffset()+((unit and UnitIsUnit(unit,"target")) and self:GetTargetYOffset() or 0);
  8.         self:SetPoint("BOTTOM",parent,"TOP",0,offset);--    Apply offset here
  9.     end--   We'll leave the false side of this alone to preserve the original anchor in that case
  10. end);
__________________
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