nameplates: add option to set inactive alpha

This commit is contained in:
shagu
2019-05-01 16:38:59 +02:00
parent 8e64a38388
commit 77d4397187
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -1010,6 +1010,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("nameplates", nil, "targethighlight", "0")
pfUI:UpdateConfig("nameplates", nil, "targetglow", "1")
pfUI:UpdateConfig("nameplates", nil, "targetzoom", "0")
pfUI:UpdateConfig("nameplates", nil, "notargalpha", ".75")
pfUI:UpdateConfig("abuttons", nil, "enable", "0")
pfUI:UpdateConfig("abuttons", nil, "position", "bottom")
+1
View File
@@ -1928,6 +1928,7 @@ pfUI:RegisterModule("gui", 20400, function ()
CreateConfig(nil, T["Highlight Target Nameplate"], C.nameplates, "targethighlight", "checkbox")
CreateConfig(nil, T["Draw Glow Around Target Nameplate"], C.nameplates, "targetglow", "checkbox")
CreateConfig(nil, T["Zoom Target Nameplate"], C.nameplates, "targetzoom", "checkbox")
CreateConfig(nil, T["Inactive Nameplate Alpha"], C.nameplates, "notargalpha")
end)
CreateGUIEntry(T["Thirdparty"], T["Integrations"], function()
+4
View File
@@ -1,6 +1,7 @@
pfUI:RegisterModule("nameplates", 20400, function ()
local font = C.nameplates.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
local font_size = C.nameplates.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
local inactive_alpha = tonumber(C.nameplates.notargalpha)
pfUI.nameplates = CreateFrame("Frame", nil, UIParent)
@@ -341,6 +342,9 @@ pfUI:RegisterModule("nameplates", 20400, function ()
function pfUI.nameplates:OnUpdate()
if not this.setup then pfUI.nameplates:OnShow() return end
-- set nameplate alpha
if this:GetAlpha() < inactive_alpha then this:SetAlpha(inactive_alpha) end
local healthbar = this.healthbar
local border, glow, name, level, levelicon , raidicon, combopoints = this.border, this.glow, this.name, this.level, this.levelicon , this.raidicon, this.combopoints
local unitname = name:GetText()