Files
ElvUIModernized/ElvUI/Libraries/oUF/units.lua
T
2018-02-19 21:03:21 -06:00

18 lines
517 B
Lua

local ns = oUF
local oUF = ns.oUF
local Private = oUF.Private
local enableTargetUpdate = Private.enableTargetUpdate
-- Handles unit specific actions.
function oUF:HandleUnit(object, unit)
local unit = object.unit or unit
if(unit == 'target') then
object:RegisterEvent('PLAYER_TARGET_CHANGED', object.UpdateAllElements)
elseif(unit == 'mouseover') then
object:RegisterEvent('UPDATE_MOUSEOVER_UNIT', object.UpdateAllElements)
elseif(string.match(unit, '%w+target')) then
enableTargetUpdate(object)
end
end