Quantcast WoWInterface - View Single Post - Would using oUF to just replace a player's nameplate be overkill?
View Single Post
05-28-18, 07:43 AM   #14
A Theradrim Guardian
Join Date: Nov 2017
Posts: 64
Originally Posted by runamonk View Post
Oh, Thanks mate!

I've recently lost my Github password and am being lazy to find it

Originally Posted by Cogwerkz View Post
As a workaround, you could always prehook oUF.DisableBlizzard, and only call it for the units you wish disabled. Then you don't have to directly change anything in the oUF code. Been doing this in some of mine for a while.

Just add something like the following before your spawn code is run:

Lua Code:
  1. local parent, ns = ...
  2. local oUF = ns.oUF
  3. local disableBlizzard = oUF.DisableBlizzard
  5. -- table of units you wish to disable,
  6. -- all others blizzard frames will remain
  7. local framesToDisable = {
  8.    player = true,
  9.    target = true
  10. }
  12. function oUF:DisableBlizzard(unit)
  13.    if unit and framesToDisable[unit] then
  14.       return disableBlizzard(self, unit)
  15.    end
  16. end
That's actually a great idea.

The question is...

Let's say you have two addons which embeds their own copy of oUF.

One will replace all the unitframes (A) while the other will just draw an extra player unitframe on the center of the screen (B).

Do you reckon overriding a DisableBlizzard function in B would also affect one in A?

oUF doesn't use a LibStub, so I'm guessing that it won't affect each other tho...
(I can't test it myself atm )
  Reply With Quote