From 1ad87b0dae5fc6cb903669a06554c53a0b4ef6a9 Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 6 Aug 2022 01:38:15 +0200 Subject: [PATCH] unitframes: only force-update portraits on events --- api/unitframes.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index a7463091..93d61805 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -1769,13 +1769,15 @@ function pfUI.uf:RefreshUnit(unit, component) unit.portrait.tex:Hide() unit.portrait.model:Show() - if unit.tick then + if component == "portrait" then + -- regular portrait update after event + unit.portrait.model.update = unitstr + else + -- detect portrait change without events unit.portrait.model.next:SetUnit(unitstr) if unit.portrait.model.lastUnit ~= UnitName(unitstr) or unit.portrait.model:GetModel() ~= unit.portrait.model.next:GetModel() then unit.portrait.model.update = unitstr end - else - unit.portrait.model.update = unitstr end end end