View Single Post
10-30-08, 05:05 AM   #177
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Originally Posted by Silviu View Post
Hello, i`m trying to get the "old UnitReactionColor" functionality back ...
Try this:

Code:
local updateName = function(self, event, unit)
  if(self.unit == unit or (not unit and self.unit)) then
    local unit = unit or self.unit
    local name = UnitName(unit)
    local index = GetRaidTargetIndex(self.unit)
    if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) or not UnitIsConnected(unit)) then
      self.Name:SetTextColor(.6, .6, .6)
    else
      local color
      --snip
      if UnitIsPlayer(unit) then
        color = RAID_CLASS_COLORS[select(2, UnitClass(unit))]
      else
        color = FACTION_BAR_COLORS[UnitReaction(unit, "player")]
      end
      --snip end
      if(color) then self.Name:SetTextColor(color.r, color.g, color.b) end
    end
    self.Name:SetText(name)
  if unit == "target" then
    updateLevel(self, unit)
    end
  end
end
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)