oUF-wow / oUF

WoW AddOn - Unit frame framework.
MIT License
221 stars 58 forks source link

castbar: Add override for unit checks #677

Closed p3lim closed 5 months ago

p3lim commented 5 months ago

Decided to make this an overridable with the current defaults, as it could collide with layouts that use both player and pet castbars.

Methods of fixing #676 for layouts with only player castbar:

self.Castbar.ShouldShow = function(element, unit)
  return element.__owner.unit == unit or element.__owner.realUnit == unit
end

This can also be used on pet castbars to replicate default castbar behavior:

self.Castbar.ShouldShow = function(element, unit)
  return element.__owner.unit == unit and UnitIsPossessed('pet')
end