if(!NetworkLocal && hudMain)
{
if(m_CharIcon.IsUndefined() && CGL.localPlayer_ && (CGL.m_gameInfo.flags & GBGameInfo::SFLAGS_Nameplates))
{
char plrUserName[256]; GetUserNameAndClanTag(plrUserName);
// todo: need a better way to find player's reputation
int rep = 0;
{
char tmpUsername[64];
m_EncryptedUserName.get(tmpUsername);
for(int i=0; i<256; ++i)
{
if(strcmp(CGL.playerNames[i].Gamertag, tmpUsername)==0)
{
rep = CGL.playerNames[i].reputation;
break;
}
}
}
hudMain->addCharTag(plrUserName, ClanID == CGL.localPlayer_->ClanID && ClanID!=0, rep, m_CharIcon);
}
if(!m_CharIcon.IsUndefined())
{
bool showTag = true;
bool showName = false;
bool sameGroup = CGL.localPlayer_->GroupID==GroupID && GroupID!=0;
if(this->GetSafeID() == m_LocalPlayer_CurrentAimAt)
{
float dist = (CGL.localPlayer_->GetPosition()-GetPosition()).Length();
float time = r3dGetTime() - m_LocalPlayer_CurrentAimAt_StartTime;
if(dist < 50.0f)
showName = true;
else if(dist < 100.0f && time > 0.5f)
showName = true;
else if(dist >= 100.0f && time > 2.0f)
showName = true;
}
bool alwaysShow = true;
if(bDead)
showTag = false;
hudMain->setCharTagTextVisible(m_CharIcon, showName, sameGroup, m_isVoiceActive&&g_voip_showChatBubble->GetBool());
r3dPoint3D offset(0,0.3f,0);
// get head position
hudMain->moveUserIcon(m_CharIcon, GetHeadPosition()+offset, alwaysShow);
}
}