Thread Tools Display Modes
12-29-18, 08:02 PM   #1
GreyFox777
A Cliff Giant
Join Date: Jan 2017
Posts: 75
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
12-30-18, 02:41 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Which events (if any) do you have registered to go along with that tag?
  Reply With Quote
12-30-18, 09:31 AM   #3
GreyFox777
A Cliff Giant
Join Date: Jan 2017
Posts: 75
Originally Posted by p3lim View Post
Which events (if any) do you have registered to go along with that tag?
Code:
'UNIT_NAME_UPDATE UNIT_CONNECTION UNIT_ENTERING_VEHICLE UNIT_EXITING_VEHICLE GROUP_ROSTER_UPDATE'
these here
  Reply With Quote
01-02-19, 06:50 PM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Events seem ok to me, the "Unknown" name is indeed a caching/server issue, but it typically resolves itself when the "Unknown" player gets close to you.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Name Tag (name UNKNOWN)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off