View Single Post
05-28-18, 08:54 AM   #15
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Eungavi View Post
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 )
Embedded oUF instances are their own addons, with their own space. Overwriting oUF internal functions will only affect each one, not both/all.
The only way it'd affect everything is if multiple layouts use the same unembedded oUF instance (which is why you should never override colors globally).

Another way to get what you want without modifying oUF source:
Lua Code:
  1. -- store and disable the method
  2. local orig = oUF.DisableBlizzard
  3. oUF.DisableBlizzard = nop
  4.  
  5. -- spawn your frames
  6. oUF:Spawn('player')
  7.  
  8. -- re-enable the method
  9. oUF.DisableBlizzard = orig

Last edited by p3lim : 05-28-18 at 08:59 AM.
  Reply With Quote