PageRenderTime 81ms CodeModel.GetById 40ms app.highlight 1ms RepoModel.GetById 39ms app.codeStats 0ms

/Tukui/modules/unitframes/core/oUF/units.lua

http://github.com/Asphyxia/Tukui
Lua | 20 lines | 16 code | 3 blank | 1 comment | 5 complexity | 2e8f7a485e8b2d404c91e4953a544341 MD5 | raw file
 1local parent, ns = ...
 2local oUF = ns.oUF
 3local Private = oUF.Private
 4
 5local enableTargetUpdate = Private.enableTargetUpdate
 6
 7-- Handles unit specific actions.
 8function oUF:HandleUnit(object, unit)
 9	local unit = object.unit or unit
10
11	if(unit == 'target') then
12		object:RegisterEvent('PLAYER_TARGET_CHANGED', object.UpdateAllElements)
13	elseif(unit == 'mouseover') then
14		object:RegisterEvent('UPDATE_MOUSEOVER_UNIT', object.UpdateAllElements)
15	elseif(unit == 'focus') then
16		object:RegisterEvent('PLAYER_FOCUS_CHANGED', object.UpdateAllElements)
17	elseif(unit:match'%w+target' or unit:match'(boss)%d?$' == 'boss') then
18		enableTargetUpdate(object)
19	end
20end