Using an icon (and oUF_Banzai, oUF_CombatFeedback)
oUF Debuff Highlight
This is an addon that adds Debuff Highlighting to the oUF unitframes.
Whenever a unit has a debuff it will highlight the frame in the debuff color. This can be done either on
the unitframe background or a specially created frame for the task.
To use this in your oUF layout you will need one of the following:
Code:
self.DebuffHighlightBackdrop = true
This will let oUF_DebuffHighlight know to use the backdrop for debuff highlighting. The original color and alpha
of the backdrop and backdrop border will be stored and whenever the unit needs highlighting it will color the
backdrop and backdrop border in corresponding color and set the alpha. When the debuff is gone the original
color and alpha will be restored.
The other option to add Debuff Highlighting is to provide a texture (or other UI type that supports :SetVertexcolor)
on your unit frame.
Code:
local dbh = self:CreateTexture(nil, "OVERLAY")
dbh:SetAllPoints(self)
dbh:SetTexture("SomeKindOfTexturepath")
dbh:SetBlendMode("ADD")
dbh:SetVertexColor(0,0,0,0) -- set alpha to 0 to hide the texture
self.DebuffHighlight = dbh
Be warned, your healthbar is probably the best place to create a full glow texture:
Code:
local dbh = hp:CreateTexture(nil, "OVERLAY")
Because all your unit UI elements will be covering your unitframe (self) most likely.
This frame will now be used with :SetVertexColor() to highlight debuffs.
You can control the alpha of the debuff highlight on backdrop or debuffhighlight frame by setting:
Code:
self.DebuffHighlightAlpha = .5
The default value is .5 for the highlight frame and 1 for the backdrop.
If you only want to highlight debuffs that you can cure:
Code:
self.DebuffHighlightFilter = true
This is off by default.
If you want to use the actual texture of the debuff to show instead of coloring the frame do the following:
Create the self.DebuffHighlight texture and positionit, make sure it's visible (alpha not set to 0):
r72358
- Fixes issue with not highlighting a debuff if all previous debuffs had no type.
r72075
- Fix debuffhighlight not working for units that don't have buffs/debuff display enabled
- Add support for using the debuff icon texture instead of coloring a frame
r72066
- Only highlight units that the player can interact with for curing
r72056
- Initial upload to wowinterface
Optional Files - oUF Debuff Highlight
Sorry, there are currently no optional files available.
Originally posted by Balkeep Just finished writing things to show debuff Grid-alike (small green(or w/e color debuff is) square at bottom felt of UF) and i totaly like it hehe.
But what i find out is in ur main code cleansing list looks like this:
Code:
SHAMAN = { Poison = true, Disease = true, },
and its not completely true cuz since 3.0 shamans can decurse aswel. Now i will fix it myself but can u please fix this in ur addon too? Thx!
I have not updated this for 3.0, I will do so shortly.
I had a PC meltdown, the magic smoke was released, and am awaiting a new wow capable machine
The original color and alpha
of the backdrop and backdrop border will be stored and whenever the unit needs highlighting it will color the
backdrop and backdrop border in corresponding color and set the alpha. When the debuff is gone the original
color and alpha will be restored.
At the moment the BackdropBorderColor is not being changed. Shouldn't the below function read like this?
Code:
local function PostUpdateAura(object, event, unit)
local debuffType, texture = GetDebuffType(unit, object.DebuffHighlightFilter)
if debuffType then
local color = DebuffTypeColor[debuffType]
if object.DebuffHighlightBackdrop then
object:SetBackdropColor(color.r, color.g, color.b, object.DebuffHighlightAlpha or 1)
object:SetBackdropBorderColor(color.r, color.g, color.b, object.DebuffHighlightAlpha or 1)
elseif object.DebuffHighlightUseTexture then
object.DebuffHighlight:SetTexture(texture)
else
object.DebuffHighlight:SetVertexColor(color.r, color.g, color.b, object.DebuffHighlightAlpha or .5)
end
else
if object.DebuffHighlightBackdrop then
local color = origColors[object]
object:SetBackdropColor(color.r, color.g, color.b, color.a)
color = origBorderColors[object]
object:SetBackdropBorderColor(color.r, color.g, color.b, color.a)
elseif object.DebuffHighlightUseTexture then
object.DebuffHighlight:SetTexture(nil)
else
local color = origColors[object]
object.DebuffHighlight:SetVertexColor(color.r, color.g, color.b, color.a)
end
end
end
For some reason I get no indication of debuff (trying to force things to poison you is such a pain).
However, when I use:
Code:
local dbh = hp:CreateTexture(nil, "OVERLAY") -- support of oUF_DebuffHighlight, which i highly recommend
dbh:SetWidth(22)
dbh:SetHeight(22)
dbh:SetPoint("CENTER", self, "CENTER")
dbh:SetBlendMode("BLEND")
self.DebuffHighlightUseTexture = true
self.DebuffHighlightFilter = true
self.DebuffHighlight = dbh
I DO get the icon on top of my frame. I realize this is probably because my lack of understanding of exactly how the frames work, but i am hoping you can shed some light for me.
EDIT: Leaving my original question just in case it helps someone else. I noticed with the code below that once I changed the vertex color from 0,0,0 to some other value I started to see my texture come through. Also the "BLEND" mode worked out pretty cool for me - makes the debuff very visable on my frames.
I was wondering - perhaps Ammo or some other Lua master can tell me what their thoughts are on why changing the SetVertexColor from 0,0,0 to antoher value did the trick? It looks like oUF_Debuff changes this value to the color of the debuff - ie green for poison etc, yet at 0,0,0 it seemed to fail?
Originally posted by shadowknight456 Heya, just wondering if it would be possible to get this to only shade the border of my frame (kind of like PitBull) Thanks in advance =D