(HELP) Dispellable Debuffs Highlighted for non-purge Classes
1 Attachment(s)
So prior to Dragonflight I used a script to create the "stealable" glow around dispellable buffs on enemies for classes that don't possess an offensive dispel. With the overhaul of the UI in Dragonflight it no longer works. I attached an image that shows what I mean.
Code that worked before Dragonflight: Code:
hooksecurefunc('TargetFrame_UpdateAuras', function(self) |
What does "no longer work" entail?
Anyway, I'd suggest to verify field and frame names, a lot of names changed with the update P.S: you have a typo in Lua Code:
though that should not affect functionality, only bleed a global variable or two ("_" is a variable name as well, you'll also want to make that local) |
A lot has changed with how the TargetFrame shows auras.
Lua Code:
First to note, most of TargetFrame's functions were moved to a mixin. This is basically a table that is copied when inherited. The buff/debuff frames are now allocated by frame pools that provide a different way to iterate over them. Lastly, using .auraInstanceID, we can use the new C_UnitAuras.GetAuraDataByAuraInstanceID() to query the buff each individual button is assigned to. |
Quote:
|
Lua Code:
|
Don't know how that mistake happened, but I corrected in the original post too.
|
Quote:
|
Quote:
|
question can thus script be modified instead of enlight magic spells to enlight helpful or harmfull buffs or only one that have above 1min cooldown or buffs that have duration above 10seconds is that possible?
|
There's no way to query cooldown info on just any arbitrary ability. That and not all buffs share the same SpellID as the ability that applies it.
Also, the buff update doesn't continuously happen, so duration tracking will have to be written from scratch. Buff updates only fire when the list changes, usually by a buff (re)applying, gaining or losing stacks, dispelled, or expiration. |
Quote:
buff.Stealable:SetShown(data.duration >= 10 and (data.expirationTime - GetTime()) < 20 ); only buff that have duration above10 and under 20 and its working |
Quote:
You're going to need either an OnUpdate script or a C_Timer loop periodically calling the code to get reliable updates when filtering by remaining time. |
I've been looking for almost exactly what OP describes since 10.0. My old code showed on all targets though.
Phantom, would it be possible to edit your code above to show the stealable glow on all targets, not just enemies. IE, friendly/enemy/self/npc/everything. If possible, thanks. |
Quote:
with if UnitIsUnit(self.unit) then |
Quote:
|
What are the errors you're getting?
|
Usage: UnitIsUnit("unit", "otherUnit")
[string "=[C]"]: in function `UnitIsUnit' [string "@Interface/AddOns/Tweaks/Glow.lua"]:2: in function <Interface/AddOns/Tweaks/Glow.lua:1> [string "=[C]"]: in function `UpdateAuras' [string "@Interface/FrameXML/EditModeSystemTemplates.lua"]:989: in function `UpdateSystemSettingBuffsOnTop' [string "@Interface/FrameXML/EditModeSystemTemplates.lua"]:1141: in function `UpdateSystemSetting' [string "@Interface/FrameXML/EditModeSystemTemplates.lua"]:219: in function `UpdateSystem' [string "@Interface/FrameXML/EditModeManager.lua"]:1031: in function `UpdateSystem' [string "@Interface/FrameXML/EditModeManager.lua"]:1023: in function <Interface/FrameXML/EditModeManager.lua:1022> [string "=[C]"]: in function `secureexecuterange' [string "@Interface/FrameXML/EditModeManager.lua"]:1025: in function `UpdateSystems' [string "@Interface/FrameXML/EditModeManager.lua"]:895: in function `UpdateLayoutInfo' [string "@Interface/FrameXML/EditModeManager.lua"]:238: in function <Interface/FrameXML/EditModeManager.lua:235> Locals: (*temporary) = "target" Looks like it's Edit Mode related. |
UnitIsUnit() is expecting two units to compare equality. This is commonly used to check if a firing UNIT_* event is for a script's unitframe. We're already grabbing our unit from the buff frame, there's nothing to compare with here.
If you want to check if a unit exists, you need to use UnitExists(). Considering the hooked function doesn't even fire when the unit doesn't exist, this is also pointless. This is the updated script without any filtering. Lua Code:
|
Tyvm for your help, but unfortunately it is still not working.
Now giving this error. I put it into it's own addon folder just to be sure something else wasn't interfering. Quote:
|
Quote:
|
All times are GMT -6. The time now is 02:38 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI