Lua Code:
oUF.Tags.Methods["color"] = function(unit)
local class = select(2, UnitClass(unit))
local reaction = UnitReaction(unit, "player")
if UnitIsDeadOrGhost(unit) or not UnitIsConnected(unit) then
return "|cffA0A0A0"
elseif UnitIsTapDenied(unit) then
return hexRGB(oUF.colors.tapped)
elseif UnitIsPlayer(unit) then
return hexRGB(oUF.colors.class[class])
elseif reaction then
return hexRGB(oUF.colors.reaction[reaction])
else
return hexRGB(1, 1, 1)
end
end
oUF.Tags.Events["color"] = "UNIT_HEALTH_FREQUENT UNIT_CONNECTION PLAYER_FLAGS_CHANGED"
The code above is currently used to update name color for RaidFrame in my layout.
It is not update properly when someone goes offline. And the name color stay in class color.
Or someone goes online, and the name stuck in gray.
Am I missing any events?