unitframes: add option to fade out of range

This commit is contained in:
shagu
2017-04-16 14:43:30 +02:00
parent 233facdb7d
commit 31012d4921
3 changed files with 29 additions and 11 deletions
+13 -11
View File
@@ -169,18 +169,20 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
pfUI.uf:RefreshUnit(this, "all")
end
if CheckInteractDistance(this.label .. this.id, 4) or not UnitName(this.label .. this.id) then
if this:GetAlpha() ~= 1 then
this:SetAlpha(1)
if this.config.portrait == "bar" then
this.portrait:SetAlpha(pfUI_config.unitframes.portraitalpha)
if this.config.faderange == "1" then
if CheckInteractDistance(this.label .. this.id, 4) or not UnitName(this.label .. this.id) then
if this:GetAlpha() ~= 1 then
this:SetAlpha(1)
if this.config.portrait == "bar" then
this.portrait:SetAlpha(pfUI_config.unitframes.portraitalpha)
end
end
end
else
if this:GetAlpha() ~= .5 then
this:SetAlpha(.5)
if this.config.portrait == "bar" then
this.portrait:SetAlpha(pfUI_config.unitframes.portraitalpha)
else
if this:GetAlpha() ~= .5 then
this:SetAlpha(.5)
if this.config.portrait == "bar" then
this.portrait:SetAlpha(pfUI_config.unitframes.portraitalpha)
end
end
end
end