unitframes: only force-update portraits on events

This commit is contained in:
shagu
2022-08-06 01:38:15 +02:00
parent dc14c10d7e
commit 1ad87b0dae
+5 -3
View File
@@ -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