mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
- added option to use out-of-combat alpha on class power bars (holy power, shards) when targeting a friendly
This commit is contained in:
@ -231,7 +231,7 @@ function IceElement.prototype:UpdateAlpha()
|
|||||||
if (self.combat) then
|
if (self.combat) then
|
||||||
self.alpha = self.settings.alphaic
|
self.alpha = self.settings.alphaic
|
||||||
self.backgroundAlpha = self.settings.alphaicbg
|
self.backgroundAlpha = self.settings.alphaicbg
|
||||||
elseif (self.target) then
|
elseif (self.target and not self:AlphaPassThroughTarget()) then
|
||||||
self.alpha = self.settings.alphaTarget
|
self.alpha = self.settings.alphaTarget
|
||||||
self.backgroundAlpha = self.settings.alphaTargetbg
|
self.backgroundAlpha = self.settings.alphaTargetbg
|
||||||
elseif (self:UseTargetAlpha(scale)) then
|
elseif (self:UseTargetAlpha(scale)) then
|
||||||
@ -249,6 +249,10 @@ function IceElement.prototype:UpdateAlpha()
|
|||||||
self.frame:SetAlpha(self.alpha)
|
self.frame:SetAlpha(self.alpha)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function IceElement.prototype:AlphaPassThroughTarget()
|
||||||
|
return false
|
||||||
|
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
|
-- 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
|
||||||
function IceElement.prototype:GetAlphaAdd()
|
function IceElement.prototype:GetAlphaAdd()
|
||||||
return 0
|
return 0
|
||||||
|
@ -252,6 +252,23 @@ function IceClassPowerCounter.prototype:GetOptions()
|
|||||||
order = 40,
|
order = 40,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts["hideFriendly"] = {
|
||||||
|
type = "toggle",
|
||||||
|
name = L["Friendly OOC alpha"],
|
||||||
|
desc = L["If this is checked, then the counter will use your 'out of target' alpha when targeting someone who is friendly."],
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.hideFriendly
|
||||||
|
end,
|
||||||
|
set = function(info, v)
|
||||||
|
self.moduleSettings.hideFriendly = v
|
||||||
|
self:Update(self.unit)
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled
|
||||||
|
end,
|
||||||
|
order = 41,
|
||||||
|
}
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -274,6 +291,7 @@ function IceClassPowerCounter.prototype:GetDefaultSettings()
|
|||||||
defaults["gradient"] = true
|
defaults["gradient"] = true
|
||||||
defaults["customMinColor"] = {r=1, g=1, b=0, a=1}
|
defaults["customMinColor"] = {r=1, g=1, b=0, a=1}
|
||||||
defaults["customColor"] = {r=1, g=0, b=0, a=1}
|
defaults["customColor"] = {r=1, g=0, b=0, a=1}
|
||||||
|
defaults["hideFriendly"] = false
|
||||||
|
|
||||||
return defaults
|
return defaults
|
||||||
end
|
end
|
||||||
@ -401,7 +419,9 @@ end
|
|||||||
|
|
||||||
function IceClassPowerCounter.prototype:CreateRuneFrame()
|
function IceClassPowerCounter.prototype:CreateRuneFrame()
|
||||||
-- create numeric runes
|
-- create numeric runes
|
||||||
|
if not self.frame.numeric then
|
||||||
self.frame.numeric = self:FontFactory(self.moduleSettings.runeFontSize, nil, self.frame.numeric)
|
self.frame.numeric = self:FontFactory(self.moduleSettings.runeFontSize, nil, self.frame.numeric)
|
||||||
|
end
|
||||||
|
|
||||||
self.frame.numeric:SetWidth(50)
|
self.frame.numeric:SetWidth(50)
|
||||||
self.frame.numeric:SetJustifyH("CENTER")
|
self.frame.numeric:SetJustifyH("CENTER")
|
||||||
@ -542,6 +562,10 @@ function IceClassPowerCounter.prototype:CheckCombat()
|
|||||||
self:Redraw()
|
self:Redraw()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function IceClassPowerCounter.prototype:AlphaPassThroughTarget()
|
||||||
|
return self.moduleSettings.hideFriendly and UnitIsFriend("player", "target")
|
||||||
|
end
|
||||||
|
|
||||||
function IceClassPowerCounter.prototype:HideBlizz()
|
function IceClassPowerCounter.prototype:HideBlizz()
|
||||||
assert(true, "Must override HideBlizz in child classes.")
|
assert(true, "Must override HideBlizz in child classes.")
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user