Skip to content

Commit

Permalink
part of #1409
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Oct 30, 2024
1 parent 6a1e465 commit a6a9752
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ElvUI/Core/Defaults/Profile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1764,10 +1764,10 @@ P.unitframe = {
high = 0.75,
low = 0.3,
onlyLow = false,
colorBackdrop = false,
good = { r = 0, g = 1, b = 0 },
neutral = { r = 1, g = 1, b = 0 },
bad = { r = 1, g = 0, b = 0 },
colorBackdrop = 0,
},
--healththreat = false,
healthselection = false,
Expand Down
10 changes: 3 additions & 7 deletions ElvUI/Core/Modules/UnitFrames/Elements/Health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ function UF:PostUpdateHealthColor(unit, r, g, b)
local isTapped = UnitIsTapDenied(unit)
local isDeadOrGhost = UnitIsDeadOrGhost(unit)
local healthBreak = not isTapped and colors.healthBreak
local usingHealthBreakBg

local color -- main bar
if not b then
Expand All @@ -269,7 +268,7 @@ function UF:PostUpdateHealthColor(unit, r, g, b)
end
end

local newr, newg, newb
local newr, newg, newb, healthbreakBackdrop
if not color then -- dont need to process this when its hostile
if not parent.db or parent.db.colorOverride ~= 'ALWAYS' then
if ((colors.healthclass and colors.colorhealthbyvalue) or (colors.colorhealthbyvalue and parent.isForced)) and not isTapped then
Expand All @@ -287,7 +286,7 @@ function UF:PostUpdateHealthColor(unit, r, g, b)
end

if color and healthBreak.colorBackdrop then
usingHealthBreakBg = 1
healthbreakBackdrop = true
end
end
end
Expand All @@ -302,14 +301,11 @@ function UF:PostUpdateHealthColor(unit, r, g, b)
local bg, bgc = self.bg
if bg then
local mult = bg.multiplier or BACKDROP_MULT

if colors.useDeadBackdrop and isDeadOrGhost then
bgc = colors.health_backdrop_dead
mult = 1 -- custom backdrop (dead)
elseif usingHealthBreakBg then
elseif healthbreakBackdrop then
bgc = color
-- is mult = 1 required?
mult = 1 -- custom backdrop
elseif colors.healthbackdropbyvalue then
if colors.customhealthbackdrop then
newr, newg, newb = ElvUF:ColorGradient(self.cur, self.max, 1, 0, 0, 1, 1, 0, colors.health_backdrop.r, colors.health_backdrop.g, colors.health_backdrop.b)
Expand Down
2 changes: 1 addition & 1 deletion ElvUI_Options/Core/UnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ Colors.healthGroup.args.healthBreak.args.high = ACH:Range(L["High"], nil, 2, { m
Colors.healthGroup.args.healthBreak.args.low = ACH:Range(L["Low"], nil, 3, { min = 0, max = 0.5, step = 0.01, isPercent = true })
Colors.healthGroup.args.healthBreak.args.onlyLow = ACH:Toggle(L["Only Low"], nil, 4)
Colors.healthGroup.args.healthBreak.args.colorBackdrop = ACH:Toggle(L["Color Backdrop"], nil, 5)
Colors.healthGroup.args.spacer = ACH:Spacer(6, 'full')
Colors.healthGroup.args.healthBreak.args.spacer = ACH:Spacer(6, 'full')
Colors.healthGroup.args.healthBreak.args.good = ACH:Color(L["Good"], nil, 7)
Colors.healthGroup.args.healthBreak.args.neutral = ACH:Color(L["Neutral"], nil, 8)
Colors.healthGroup.args.healthBreak.args.bad = ACH:Color(L["Bad"], nil, 9)
Expand Down

0 comments on commit a6a9752

Please sign in to comment.