From 2343eb2d99c923638b0459c7926ec5fbd075025a Mon Sep 17 00:00:00 2001 From: andrew6180 <16847730+andrew6180@users.noreply.github.com> Date: Tue, 23 May 2023 10:47:37 -0700 Subject: [PATCH] Core/Tags: fix power color tags --- ElvUI/Core/Tags.lua | 32 +++++++++++++++++++-- ElvUI/Modules/Auras/Auras.lua | 1 + ElvUI/Modules/UnitFrames/Elements/Auras.lua | 13 +++++++-- ElvUI/Settings/Profile.lua | 6 ++-- 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/ElvUI/Core/Tags.lua b/ElvUI/Core/Tags.lua index dc830b9..75ef5b2 100644 --- a/ElvUI/Core/Tags.lua +++ b/ElvUI/Core/Tags.lua @@ -530,19 +530,45 @@ E:AddTag('pvptimer', 1, function(unit) end end) +E:AddTag('powercolor', 'UNIT_DISPLAYPOWER', function() + local _, powerType = UnitPowerType("player") + local color = ElvUF.colors.power[powerType] or ElvUF.colors.power.MANA + local altR, altG, altB = color.r, color.g, color.b + if color[1] then + return Hex(color[1], color[2], color[3]) + else + return Hex(altR, altG, altB) + end +end) + E:AddTag('manacolor', 'UNIT_DISPLAYPOWER', function() local color = ElvUF.colors.power.MANA - return Hex(color) + local altR, altG, altB = color.r, color.g, color.b + if color[1] then + return Hex(color[1], color[2], color[3]) + else + return Hex(altR, altG, altB) + end end) E:AddTag('ragecolor', 'UNIT_DISPLAYPOWER', function() local color = ElvUF.colors.power.RAGE - return Hex(color) + local altR, altG, altB = color.r, color.g, color.b + if color[1] then + return Hex(color[1], color[2], color[3]) + else + return Hex(altR, altG, altB) + end end) E:AddTag('energycolor', 'UNIT_DISPLAYPOWER', function() local color = ElvUF.colors.power.ENERGY - return Hex(color) + local altR, altG, altB = color.r, color.g, color.b + if color[1] then + return Hex(color[1], color[2], color[3]) + else + return Hex(altR, altG, altB) + end end) E:AddTag('distance', 0.1, function(realUnit) diff --git a/ElvUI/Modules/Auras/Auras.lua b/ElvUI/Modules/Auras/Auras.lua index bcc0722..e30d812 100644 --- a/ElvUI/Modules/Auras/Auras.lua +++ b/ElvUI/Modules/Auras/Auras.lua @@ -1,5 +1,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local A = E:GetModule("Auras") +local NP = E:GetModule("NamePlates") local LSM = E.Libs.LSM local LBF = E.Libs.LBF diff --git a/ElvUI/Modules/UnitFrames/Elements/Auras.lua b/ElvUI/Modules/UnitFrames/Elements/Auras.lua index 3ad2af2..b7c0d15 100644 --- a/ElvUI/Modules/UnitFrames/Elements/Auras.lua +++ b/ElvUI/Modules/UnitFrames/Elements/Auras.lua @@ -506,8 +506,17 @@ function UF:AuraFilter(unit, button, name, _, _, _, debuffType, duration, expira if not name then return end -- checking for an aura that is not there, pass nil to break while loop local parent = self:GetParent() - local db = parent.db and parent.db[self.type] - if not db then return true end + local db + if self.isNamePlate then + db = NP:PlateDB(parent) + db = db and db[self.type] + else + db = parent.db and parent.db[self.type] + end + + if not db then + return true + end local isPlayer = (caster == "player" or caster == "vehicle") local isFriend = unit and UnitIsFriend("player", unit) and not UnitCanAttack("player", unit) diff --git a/ElvUI/Settings/Profile.lua b/ElvUI/Settings/Profile.lua index 4d1ac5c..76085b2 100644 --- a/ElvUI/Settings/Profile.lua +++ b/ElvUI/Settings/Profile.lua @@ -266,9 +266,9 @@ P.bags = { local NP_Auras = { enable = true, desaturate = true, - numAuras = 5, + numAuras = 8, numRows = 1, - size = 27, + size = 20, height = 23, attachTo = 'FRAME', keepSizeRatio = true, @@ -293,7 +293,7 @@ local NP_Auras = { countYOffset = 2, durationPosition = 'CENTER', minDuration = 0, - maxDuration = 0, + maxDuration = 300, priority = '' }