mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
@@ -0,0 +1,59 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
function UF:Construct_DebuffHighlight(frame)
|
||||
local dbh = frame:CreateTexture(nil, "OVERLAY")
|
||||
E:SetInside(dbh, frame.Health.backdrop)
|
||||
dbh:SetTexture(E.media.blankTex)
|
||||
dbh:SetVertexColor(0, 0, 0, 0)
|
||||
dbh:SetBlendMode("ADD")
|
||||
frame.DebuffHighlightFilter = true
|
||||
frame.DebuffHighlightAlpha = 0.45
|
||||
frame.DebuffHighlightFilterTable = E.global.unitframe.DebuffHighlightColors
|
||||
|
||||
E:CreateShadow(frame, "Default")
|
||||
local x = frame.shadow
|
||||
frame.shadow = nil
|
||||
x:Hide()
|
||||
|
||||
frame.DBHGlow = x
|
||||
|
||||
if frame.Health then
|
||||
dbh:SetParent(frame.Health)
|
||||
frame.DBHGlow:SetParent(frame.Health)
|
||||
end
|
||||
|
||||
dbh.PostUpdate = UF.PostUpdate_DebuffHighlight
|
||||
|
||||
return dbh
|
||||
end
|
||||
|
||||
function UF:Configure_DebuffHighlight(frame)
|
||||
if E.db.unitframe.debuffHighlighting ~= "NONE" then
|
||||
frame:EnableElement("DebuffHighlight")
|
||||
frame.DebuffHighlightFilterTable = E.global.unitframe.DebuffHighlightColors
|
||||
if E.db.unitframe.debuffHighlighting == "GLOW" then
|
||||
frame.DebuffHighlightBackdrop = true
|
||||
if frame.ThreatIndicator then
|
||||
frame.DBHGlow:SetAllPoints(frame.ThreatIndicator.glow)
|
||||
elseif frame.TargetGlow then
|
||||
frame.DBHGlow:SetAllPoints(frame.TargetGlow)
|
||||
end
|
||||
else
|
||||
frame.DebuffHighlightBackdrop = false
|
||||
end
|
||||
else
|
||||
frame:DisableElement("DebuffHighlight")
|
||||
end
|
||||
end
|
||||
|
||||
function UF:PostUpdate_DebuffHighlight(object, debuffType, texture, wasFiltered, style, color)
|
||||
if debuffType and not wasFiltered then
|
||||
color = UF.db.colors.debuffHighlight[debuffType]
|
||||
if object.DebuffHighlightBackdrop and object.DBHGlow then
|
||||
object.DBHGlow:SetBackdropBorderColor(color.r, color.g, color.b, color.a)
|
||||
else
|
||||
object.DebuffHighlight:SetVertexColor(color.r, color.g, color.b, color.a)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user