diff --git a/IceBarElement.lua b/IceBarElement.lua index 0754594..c664b43 100644 --- a/IceBarElement.lua +++ b/IceBarElement.lua @@ -1253,7 +1253,7 @@ function IceBarElement.prototype:UpdateBar(scale, color, alpha) if (self.combat) then self.alpha = self.settings.alphaic self.backgroundAlpha = self.settings.alphaicbg - elseif (self.target) then + elseif (self.target and not self:AlphaPassThroughTarget()) then self.alpha = self.settings.alphaTarget self.backgroundAlpha = self.settings.alphaTargetbg elseif (self:UseTargetAlpha(scale)) then diff --git a/IceCore.lua b/IceCore.lua index a38f62f..211e571 100644 --- a/IceCore.lua +++ b/IceCore.lua @@ -67,6 +67,7 @@ function IceCore.prototype:SetupDefaults() alphaTargetbg = 0.25, alphaNotFullbg = 0.25, + bTreatFriendlyAsTarget = true, backgroundToggle = false, backgroundColor = {r = 0.5, g = 0.5, b = 0.5}, barTexture = "Bar", diff --git a/IceElement.lua b/IceElement.lua index 4635c18..af3a905 100644 --- a/IceElement.lua +++ b/IceElement.lua @@ -274,7 +274,7 @@ function IceElement.prototype:UpdateAlpha() end function IceElement.prototype:AlphaPassThroughTarget() - return false + return not self.settings.bTreatFriendlyAsTarget and UnitIsFriend("target", "player") end -- use this to add some value to alpha every time. if you always want an element to be slightly brighter than the actual alpha for visibility diff --git a/IceHUD_Options/Options.lua b/IceHUD_Options/Options.lua index 58a8b74..c0af586 100644 --- a/IceHUD_Options/Options.lua +++ b/IceHUD_Options/Options.lua @@ -331,6 +331,21 @@ This isn't |cff9999ffIceHUD|r - it's Blizzard's new Spell Alerts they added in 4 end, order = 32, }, + + bTreatFriendlyAsTarget = { + type = 'toggle', + name = L["Use 'Target' alpha for friendlies"], + desc = L["If this is disabled, then targeting a friendly will use the 'Alpha out of combat' setting instead of 'Alpha OOC and Target'."], + width = 'double', + get = function() + return IceHUD.IceCore.settings.bTreatFriendlyAsTarget + end, + set = function(info, value) + IceHUD.IceCore.settings.bTreatFriendlyAsTarget = value + IceHUD.IceCore:Redraw() + end, + order = 32 + }, } },