WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   notInterruptible (https://www.wowinterface.com/forums/showthread.php?t=56165)

GreyFox777 04-20-18 09:27 AM

notInterruptible
 
1 Attachment(s)
Hey guys, can you help me to add a (not)interruptible color to a castbar?

i tried to edit this block of castbar file


Quote:


...
...
elseif(self.mystyle == "target") then
core:setBackdrop(castbar, cfg.units.target.castbar.height + 4, 2, 2, 2)

if notInterruptible then
castbar:SetStatusBarColor(1.00, 0.00, 0.00)
else
castbar:SetStatusBarColor(0.00, 1.00, 0.00)
end

castbar:SetWidth(cfg.units.target.castbar.width - cfg.units.target.castbar.height + 6)
castbar:SetHeight(cfg.units.target.castbar.height)
castbar:SetPoint("CENTER", "UIParent", "CENTER", 0, 350)
...
...
...
But the color are not working for target mobs...

I have attached full castbar lua file if needed

Aftermathhqt 04-20-18 09:45 AM

Quote:

Originally Posted by GreyFox777 (Post 327603)
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:
  1. function UnitFrames:CheckInterrupt(unit)
  2.     if (unit == "vehicle") or (unit == "player") then
  3.         return
  4.     end
  5.  
  6.     if (self.notInterruptible and UnitCanAttack("player", unit)) then
  7.         self:SetStatusBarColor(unpack(C.UnitFrames.InterruptColor))
  8.        
  9.         if (self.Icon) then
  10.             self.Icon:SetDesaturated(1)
  11.         end
  12.     else
  13.         self:SetStatusBarColor(unpack(C.UnitFrames.CastBarColor))
  14.        
  15.         if (self.Icon) then
  16.             self.Icon:SetDesaturated(false)
  17.         end
  18.     end
  19. end
  20.  
  21. function UnitFrames:CheckCast(unit, name, rank, castid)
  22.     UnitFrames.CheckInterrupt(self, unit)
  23. end
  24.  
  25. function UnitFrames:CheckChannel(unit, name, rank)
  26.     UnitFrames.CheckInterrupt(self, unit)
  27. end

And you need to add this into your layout

Lua Code:
  1. Castbar.PostCastStart = UnitFrames.CheckCast
  2. Castbar.PostChannelStart = UnitFrames.CheckChannel

GreyFox777 04-20-18 10:05 AM

Maybe is there some easier way?:confused:



EDIT: I think it is working now...


All times are GMT -6. The time now is 05:00 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI