Originally Posted by Silviu
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