Quantcast
WoWInterface - View Single Post - Name Tag (name UNKNOWN)
View Single Post
12-29-18, 08:02 PM   #1
GreyFox777
A Cliff Giant
Join Date: Jan 2017
Posts: 74
Name Tag (name UNKNOWN)

Hello,

anyone was able to help me with name tag?

My problem is:

Some time by joining the party, name of some players show as UNKNOWN (server lag?), but the problem is, it stays and won't be refreshing until reload UI.

Here is my tag code:

Code:
tags['lumen:reactionname'] = function(unit)
        local playerName = UnitName(unit) or ""
        local color
        if UnitIsPlayer(unit) then
            local class, key = UnitClassBase(unit)
            color = key and RAID_CLASS_COLORS[class].colorStr or "ffffffff"
        else
            local reaction = UnitReaction(unit,'player') or 5
            local col = FACTION_BAR_COLORS[reaction]
            color = string.format("ff%02x%02x%02x",col.r*255,col.g*255,col.b*255)
        end
        return string.format("|c%s%s",color,playerName)
end
and the code inside the party1.lua
Code:
  core:createNameString(self, font_big, cfg.fontsize - 1, "THINOUTLINE", 80, 29, "LEFT", 130)
...
  self:Tag(self.Name, '[lumen:reactionname]')
  self.Name:SetTextColor(unpack(cfg.colors.health))
...

Last edited by p3lim : 12-30-18 at 02:42 AM. Reason: made the code readable
  Reply With Quote