mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-22 15:46:56 +00:00
unitframes: add option to fade out of range
This commit is contained in:
@@ -105,6 +105,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "player", "buff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "player", "debuff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "player", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "player", "faderange", "0")
|
||||
pfUI:UpdateConfig("unitframes", "player", "txtleft", "unit")
|
||||
pfUI:UpdateConfig("unitframes", "player", "txtcenter", "none")
|
||||
pfUI:UpdateConfig("unitframes", "player", "txtright", "healthdyn")
|
||||
@@ -126,6 +127,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "target", "buff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "target", "debuff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "target", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "target", "faderange", "0")
|
||||
pfUI:UpdateConfig("unitframes", "target", "txtleft", "unit")
|
||||
pfUI:UpdateConfig("unitframes", "target", "txtcenter", "none")
|
||||
pfUI:UpdateConfig("unitframes", "target", "txtright", "healthdyn")
|
||||
@@ -144,6 +146,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "group", "buff_indicator", "1")
|
||||
pfUI:UpdateConfig("unitframes", "group", "debuff_indicator", "1")
|
||||
pfUI:UpdateConfig("unitframes", "group", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "group", "faderange", "1")
|
||||
pfUI:UpdateConfig("unitframes", "group", "txtleft", "unit")
|
||||
pfUI:UpdateConfig("unitframes", "group", "txtcenter", "none")
|
||||
pfUI:UpdateConfig("unitframes", "group", "txtright", "healthmiss")
|
||||
@@ -162,6 +165,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "buff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "debuff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "faderange", "1")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "txtleft", "unit")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "txtcenter", "none")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "txtright", "healthperc")
|
||||
@@ -179,6 +183,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "buff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "debuff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "faderange", "1")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "txtleft", "unit")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "txtcenter", "none")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "txtright", "healthperc")
|
||||
@@ -196,6 +201,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "raid", "buff_indicator", "1")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "debuff_indicator", "1")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "faderange", "1")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "txtleft", "name")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "txtcenter", "none")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "txtright", "healthmiss")
|
||||
@@ -213,6 +219,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "buff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "debuff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "faderange", "0")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "txtleft", "none")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "txtcenter", "name")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "txtright", "none")
|
||||
@@ -230,6 +237,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "pet", "buff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "debuff_indicator", "0")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "clickcast", "0")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "faderange", "0")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "txtleft", "none")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "txtcenter", "name")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "txtright", "none")
|
||||
|
||||
+13
-11
@@ -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
|
||||
|
||||
@@ -892,6 +892,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Buff Indicators", C.unitframes.player, "buff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Debuff Indicators", C.unitframes.player, "debuff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Clickcast", C.unitframes.player, "clickcast", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Range Fading", C.unitframes.player, "faderange", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.player, "txtleft", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.player, "txtcenter", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.player, "txtright", "dropdown", txtValues)
|
||||
@@ -915,6 +916,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Buff Indicators", C.unitframes.target, "buff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Debuff Indicators", C.unitframes.target, "debuff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Clickcast", C.unitframes.target, "clickcast", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Range Fading", C.unitframes.target, "faderange", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.target, "txtleft", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.target, "txtcenter", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.target, "txtright", "dropdown", txtValues)
|
||||
@@ -933,6 +935,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Buff Indicators", C.unitframes.group, "buff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Debuff Indicators", C.unitframes.group, "debuff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Clickcast", C.unitframes.group, "clickcast", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Range Fading", C.unitframes.group, "faderange", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.group, "txtleft", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.group, "txtcenter", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.group, "txtright", "dropdown", txtValues)
|
||||
@@ -952,6 +955,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Buff Indicators", C.unitframes.grouptarget, "buff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Debuff Indicators", C.unitframes.grouptarget, "debuff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Clickcast", C.unitframes.grouptarget, "clickcast", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Range Fading", C.unitframes.grouptarget, "faderange", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.grouptarget, "txtleft", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.grouptarget, "txtcenter", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.grouptarget, "txtright", "dropdown", txtValues)
|
||||
@@ -970,6 +974,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Buff Indicators", C.unitframes.grouppet, "buff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Debuff Indicators", C.unitframes.grouppet, "debuff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Clickcast", C.unitframes.grouppet, "clickcast", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Range Fading", C.unitframes.grouppet, "faderange", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.grouppet, "txtleft", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.grouppet, "txtcenter", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.grouppet, "txtright", "dropdown", txtValues)
|
||||
@@ -988,6 +993,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Buff Indicators", C.unitframes.raid, "buff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Debuff Indicators", C.unitframes.raid, "debuff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Clickcast", C.unitframes.raid, "clickcast", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Range Fading", C.unitframes.raid, "faderange", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.raid, "txtleft", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.raid, "txtcenter", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.raid, "txtright", "dropdown", txtValues)
|
||||
@@ -1006,6 +1012,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Buff Indicators", C.unitframes.target, "buff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Debuff Indicators", C.unitframes.target, "debuff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Clickcast", C.unitframes.target, "clickcast", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Range Fading", C.unitframes.target, "faderange", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.ttarget, "txtleft", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.ttarget, "txtcenter", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.ttarget, "txtright", "dropdown", txtValues)
|
||||
@@ -1024,6 +1031,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Buff Indicators", C.unitframes.pet, "buff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Debuff Indicators", C.unitframes.pet, "debuff_indicator", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Clickcast", C.unitframes.pet, "clickcast", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Range Fading", C.unitframes.pet, "faderange", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.pet, "txtleft", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.pet, "txtcenter", "dropdown", txtValues)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.pet, "txtright", "dropdown", txtValues)
|
||||
|
||||
Reference in New Issue
Block a user