(un)interruptable cast
i was wondering if oUF had a command / function or whatever its called ( not much a of a programmer ) which allowed us to change the color of the casticon/castbar border whether its interruptable or not, i.e. the shield u see in the default UI frames. thx in advance :)
|
Not directly. You can use a custom PostCastStart/PostChannelStart function to identify if the spell is interruptible and change the display of the castbar based on that. You should also track the UNIT_SPELLCAST_INTERRUPTABLE/UNIT_SPELLCAST_NOT_INTERRUPTABLE events in case the interrupt-ability of the spell changes during cast (e.g. during the Twin Valkyrs).
To add to this, here's how I'm doing it (in my non-updated version): Code:
local postCastStart = function(self, event, unit, name, rank, text, castid, interrupt) Code:
self:RegisterEvent('UNIT_SPELLCAST_NOT_INTERRUPTABLE', spellInterruptable) |
self.Castbar.Shield is not a standard item, you will need to define this texture yourself.
|
Quote:
local postCastStart = function(self, event, unit, name, rank, text, castid, interrupt) if( interrupt ) then self.Castbar.bg:Hide() self.Castbar.Shield:Show() else self.Castbar.bg:Show() self.Castbar.Shield:Hide() end end is at all necessary? |
The bg part isn't, really. However, you do need something to show or hide a texture that indicates if the spell can be interrupted or not. The event stuff only triggers if the spell becomes interruptible/not during the cast. Otherwise they don't trigger.
|
Is there a place/way to test such code? Without a raid/group, if possible.
|
The cast option changing? Not that I know of, and I've tried to find one.
|
Quote:
If the latter, you can just target yourself and use your mount or hearthstone. |
I meant to find a cast that is un-interruptable, to be able to test the appearance of the texture I want to show for an un-interruptable cast. And to be able see if it works, ofc. :)
Are heartstone and mount really considered non-interruptable? Afaik, you just need to get hit and it's interrupted ... :rolleyes: |
Ah, sorry, I thought you meant casts that changed state. For the non-interrupt casts, various npcs and group quest bosses have casts that cannot be interrupted.
The easiest examples I know of offhand, though, are all dungeon bosses (black knight, Loken, Anub'arak...). edit: Looks like transmutes are protected. At least, saronite to titanium is. |
Quote:
|
Thanks, after all random heroic, ftw. The final boss from Ahn'kahet casts "Insanity", which worked fine. :)
However, heartstone keeps telling me it can be interrupted. Which means it's not a question of whether I believe it or not, it just won't show up that way. I don't care, though. ;) |
I did not have a postCastStart in my layout and failed to create one so I tried to just manually listen for the event in the castbar code. Nothing happens though :p
Any ideas? Code:
------------- target castbar ----------- |
You will need to add PostCastStart.
Quote:
|
oUF already has castbar:PostCastInterruptible(unit) and castbar:PostCastNotInterruptible(unit).
|
Quote:
|
Quote:
The forum thinks my message is too short, so I present you the content of my selection clipboard: http://www.youtube.com/watch?v=xE9_3QjSE08&fmt=18 |
I tried adding this under within the above posted code.
Got a nil value error for it. What did I do wrong? Code:
if self.Castbar:PostCastNotInterruptible(unit) then |
I had a chance to look over 1.4. And please correct me if I'm wrong Haste (or someone else that know)
If all you want to do is show a frame (texture, text or whatever) then you can just define it as Castbar.Shield and it should show and hide automatically. If you want to do something else, for example the code you posted sacrifice, then you will need to do the following. Outside style function Code:
local CastInterruptable = function(self, unit) Code:
Castbar.PostCastStart = PostCastStart |
That looks very much correct.
|
All times are GMT -6. The time now is 04:53 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI