diff --git a/api/config.lua b/api/config.lua index 77f6f756..15f94f95 100644 --- a/api/config.lua +++ b/api/config.lua @@ -356,6 +356,9 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", unit, "debuff_ind_size", ".65") pfUI:UpdateConfig("unitframes", unit, "clickcast", "0") pfUI:UpdateConfig("unitframes", unit, "faderange", "0") + pfUI:UpdateConfig("unitframes", unit, "alpha_visible", "1") + pfUI:UpdateConfig("unitframes", unit, "alpha_outrange", ".50") + pfUI:UpdateConfig("unitframes", unit, "alpha_offline", ".25") pfUI:UpdateConfig("unitframes", unit, "glowaggro", "1") pfUI:UpdateConfig("unitframes", unit, "glowcombat", "1") pfUI:UpdateConfig("unitframes", unit, "showtooltip", "1") diff --git a/api/unitframes.lua b/api/unitframes.lua index 834830fb..9004016f 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -311,6 +311,10 @@ function pfUI.uf:UpdateConfig() relative_point = "BOTTOMRIGHT" end + f.alpha_visible = tonumber(f.config.alpha_visible) + f.alpha_outrange = tonumber(f.config.alpha_outrange) + f.alpha_offline = tonumber(f.config.alpha_offline) + f:SetFrameStrata("BACKGROUND") f.glow:SetFrameStrata("BACKGROUND") @@ -1087,18 +1091,18 @@ function pfUI.uf:RefreshUnitAnimation(unitframe) end function pfUI.uf:RefreshUnitState(unit) - local alpha = 1 + local alpha = unit.alpha_visible local unlock = pfUI.unlock and pfUI.unlock:IsShown() or nil if not UnitIsConnected(unit.label .. unit.id) and not unlock then -- offline - alpha = .25 + alpha = unit.alpha_offline unit.hp.bar:SetMinMaxValues(0, 100) unit.power.bar:SetMinMaxValues(0, 100) unit.hp.bar:SetValue(0) unit.power.bar:SetValue(0) elseif unit.config.faderange == "1" and not pfUI.api.UnitInRange(unit.label .. unit.id, 4) and not unlock then - alpha = .5 + alpha = unit.alpha_outrange end -- skip if alpha is already correct diff --git a/modules/gui.lua b/modules/gui.lua index 0efe4ecb..d724b222 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -969,6 +969,29 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () ".75:75%", ".90:90%", }, + ["percent_small"] = { + "0:0%", + ".05:5%", + ".10:10%", + ".15:15%", + ".20:20%", + ".25:25%", + ".30:30%", + ".35:35%", + ".40:40%", + ".45:45%", + ".50:50%", + ".55:55%", + ".60:60%", + ".65:65%", + ".70:70%", + ".75:75%", + ".80:80%", + ".85:85%", + ".90:90%", + ".95:95%", + "1:100%", + }, ["uf_overheal"] = { "0:0%", "10:10%", @@ -1560,6 +1583,9 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(U[c], T["Display Frame"] .. ": " .. t, C.unitframes[c], "visible", "checkbox") CreateConfig(U[c], T["Enable Mouseover Tooltip"], C.unitframes[c], "showtooltip", "checkbox") CreateConfig(U[c], T["Enable Clickcast"], C.unitframes[c], "clickcast", "checkbox") + CreateConfig(U[c], T["Default Transparency"], C.unitframes[c], "alpha_visible", "dropdown", pfUI.gui.dropdowns.percent_small) + CreateConfig(U[c], T["Out Of Range Transparency"], C.unitframes[c], "alpha_outrange", "dropdown", pfUI.gui.dropdowns.percent_small) + CreateConfig(U[c], T["Offline Transparency"], C.unitframes[c], "alpha_offline", "dropdown", pfUI.gui.dropdowns.percent_small) CreateConfig(U[c], T["Enable Range Fading"], C.unitframes[c], "faderange", "checkbox") CreateConfig(U[c], T["Enable Aggro Glow"], C.unitframes[c], "glowaggro", "checkbox") CreateConfig(U[c], T["Enable Combat Glow"], C.unitframes[c], "glowcombat", "checkbox")