View Single Post
04-18-19, 01:37 PM   #1
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 126
Tags won't update timely when some offline

Lua Code:
  1. oUF.Tags.Methods["color"] = function(unit)
  2.     local class = select(2, UnitClass(unit))
  3.     local reaction = UnitReaction(unit, "player")
  4.  
  5.     if UnitIsDeadOrGhost(unit) or not UnitIsConnected(unit) then
  6.         return "|cffA0A0A0"
  7.     elseif UnitIsTapDenied(unit) then
  8.         return hexRGB(oUF.colors.tapped)
  9.     elseif UnitIsPlayer(unit) then
  10.         return hexRGB(oUF.colors.class[class])
  11.     elseif reaction then
  12.         return hexRGB(oUF.colors.reaction[reaction])
  13.     else
  14.         return hexRGB(1, 1, 1)
  15.     end
  16. end
  17. 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?
  Reply With Quote