Originally Posted by GreyFox777
Hey guys, can you help me to add a (not)interruptible color to a castbar?
i tried to edit this block of castbar file
But the color are not working for target mobs...
I have attached full castbar lua file if needed
|
Here are the functions i use...
Lua Code:
function UnitFrames:CheckInterrupt(unit)
if (unit == "vehicle") or (unit == "player") then
return
end
if (self.notInterruptible and UnitCanAttack("player", unit)) then
self:SetStatusBarColor(unpack(C.UnitFrames.InterruptColor))
if (self.Icon) then
self.Icon:SetDesaturated(1)
end
else
self:SetStatusBarColor(unpack(C.UnitFrames.CastBarColor))
if (self.Icon) then
self.Icon:SetDesaturated(false)
end
end
end
function UnitFrames:CheckCast(unit, name, rank, castid)
UnitFrames.CheckInterrupt(self, unit)
end
function UnitFrames:CheckChannel(unit, name, rank)
UnitFrames.CheckInterrupt(self, unit)
end
And you need to add this into your layout
Lua Code:
Castbar.PostCastStart = UnitFrames.CheckCast
Castbar.PostChannelStart = UnitFrames.CheckChannel