Commit 386314f9 authored by Val Voronov's avatar Val Voronov Committed by GitHub

portrait: Use both UNIT_PORTRAIT_UPDATE and UNIT_MODEL_CHANGED (#400)

parent ae7a12c6
......@@ -106,6 +106,7 @@ local function Enable(self, unit)
element.ForceUpdate = ForceUpdate
self:RegisterEvent('UNIT_MODEL_CHANGED', Path)
self:RegisterEvent('UNIT_PORTRAIT_UPDATE', Path)
self:RegisterEvent('UNIT_CONNECTION', Path)
-- The quest log uses PARTY_MEMBER_{ENABLE,DISABLE} to handle updating of
......@@ -130,6 +131,7 @@ local function Disable(self)
element:Hide()
self:UnregisterEvent('UNIT_MODEL_CHANGED', Path)
self:UnregisterEvent('UNIT_PORTRAIT_UPDATE', Path)
self:UnregisterEvent('PARTY_MEMBER_ENABLE', Path)
self:UnregisterEvent('UNIT_CONNECTION', Path)
end
......
......@@ -67,8 +67,9 @@ registering events.
--]]
function frame_metatable.__index:RegisterEvent(event, func, unitless)
-- Block OnUpdate polled frames from registering events except for
-- UNIT_MODEL_CHANGED which is used for portrait updates.
if(self.__eventless and event ~= 'UNIT_MODEL_CHANGED') then return end
-- UNIT_PORTRAIT_UPDATE and UNIT_MODEL_CHANGED which are used for
-- portrait updates.
if(self.__eventless and event ~= 'UNIT_PORTRAIT_UPDATE' and event ~= 'UNIT_MODEL_CHANGED') then return end
argcheck(event, 2, 'string')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment