Libs/oUF: Nameplates now have native UNIT events

This commit is contained in:
andrew6180
2024-04-19 09:05:53 -07:00
parent a5d90d5ed9
commit 0b4c66e6a2
24 changed files with 17 additions and 313 deletions
@@ -12,12 +12,6 @@ local UnitIsConnected = UnitIsConnected
local CreateFrame = CreateFrame
function NP:Health_UpdateColor(_, unit)
if unit and self.isNamePlate and unit:sub(1, 9) ~= "nameplate" then
local isUnit = self.unit and UnitIsUnit(self.unit, unit)
if isUnit then
unit = self.unit
end
end
if not unit or self.unit ~= unit then return end
local element = self.Health
@@ -13,12 +13,6 @@ local UnitPowerType = UnitPowerType
local POWERTYPE_ALTERNATE = 10
function NP:Power_UpdateColor(_, unit)
if unit and self.isNamePlate and unit:sub(1, 9) ~= "nameplate" then
local isUnit = self.unit and UnitIsUnit(self.unit, unit)
if isUnit then
unit = self.unit
end
end
if self.unit ~= unit then return end
local element = self.Power
-7
View File
@@ -1512,13 +1512,6 @@ do -- oUF style filter inject watch functions without actually registering any e
local update = function(frame, event, arg1, arg2, arg3, ...)
local eventFunc = mod.StyleFilterEventFunctions[event]
if arg1 and frame.isNamePlate and arg1:sub(1, 9) ~= "nameplate" then
local isUnit = frame.unit and UnitIsUnit(frame.unit, arg1)
if isUnit then
arg1 = frame.unit
end
end
if eventFunc then
eventFunc(frame, event, arg1, arg2, arg3, ...)
end
@@ -65,12 +65,6 @@ function UF:Configure_Happiness(frame)
end
function UF:HappinessOverride(event, unit)
if unit and self.isNamePlate and unit:sub(1, 9) ~= "nameplate" then
local isUnit = self.unit and UnitIsUnit(self.unit, unit)
if isUnit then
unit = self.unit
end
end
if not unit or self.unit ~= unit then return end
local db = self.db
@@ -30,12 +30,6 @@ function UF:Configure_PVPIcon(frame)
end
function UF:UpdateOverridePvP(event, unit)
if unit and self.isNamePlate and unit:sub(1, 9) ~= "nameplate" then
local isUnit = self.unit and UnitIsUnit(self.unit, unit)
if isUnit then
unit = self.unit
end
end
if not unit or self.unit ~= unit then return end
local element = self.PvPIndicator
@@ -95,12 +95,6 @@ end
function UF:UpdateThreat(unit, status, r, g, b)
local parent = self:GetParent()
if unit and parent.isNamePlate and unit:sub(1, 9) ~= "nameplate" then
local isUnit = parent.unit and UnitIsUnit(parent.unit, unit)
if isUnit then
unit = parent.unit
end
end
if (parent.unit ~= unit) or not unit then return end
local db = parent.db