View Single Post
05-15-18, 08:06 AM   #9
Eungavi
A Theradrim Guardian
Join Date: Nov 2017
Posts: 64
Yeah, I thought of adding one extra parameter to Spawn function, but I quit doing it as I don't want to modify lua file whenver there's an update :/

Lua Code:
  1. function oUF:Spawn(unit, overrideName, showBlizzard)
  2.     argcheck(unit, 2, 'string')
  3.     if(not style) then return error('Unable to create frame. No styles have been registered.') end
  4.  
  5.     unit = unit:lower()
  6.  
  7.     local name = overrideName or generateName(unit)
  8.     local object = CreateFrame('Button', name, oUF_PetBattleFrameHider, 'SecureUnitButtonTemplate')
  9.     Private.UpdateUnits(object, unit)
  10.  
  11.     -- maybe something like this
  12.     if not showBlizzard then
  13.         self:DisableBlizzard(unit)
  14.     end
  15.    
  16.     walkObject(object, unit)
  17.  
  18.     object:SetAttribute('unit', unit)
  19.     RegisterUnitWatch(object)
  20.  
  21.     return object
  22. end
  Reply With Quote