Page 1 of 1

Client 137 Avatar Name Color (In-Source)

PostPosted: Sun Jan 08, 2017 5:04 pm
by Dibella
So I have not been able to test this yet, but it seems really compelling (Can't get the damn client to compile xD)

Soo I spotted this(Client - Interface - CNameBox.cpp - Line 360):

  1. void CNameBox::DrawAvatarName( float x, float y, float z, CObjCHAR* pCharOBJ, bool bTargeted )
  2. {
  3.     DWORD dwColor = g_dwWHITE;
  4.    
  5.     const char* pName = pCharOBJ->Get_NAME();
  6.  
  7.     if( g_GameDATA.m_iPvPState  )/// PVP Mode, then ..
  8.     {
  9.         if( CUserInputState::IsEnemy( (CObjAVT*)pCharOBJ ) )/// If the team determines not me .. Avatar
  10.             dwColor = g_dwRED;
  11.     }
  12.  
  13.     if( pName && strlen( pName ) > 3 )
  14.     {
  15.         if( pName[ 0 ] == '[' && pName[ 1 ] == 'G' && pName[ 2 ] == 'M' && pName[3 ] == ']' )
  16.         {
  17.             dwColor = g_dwBLUE;
  18.         }
  19.  
  20.         if( pName[ 0 ] == '[' && pName[ 1 ] == 'T' && pName[ 2 ] == 'M' && pName[3 ] == ']' )
  21.         {
  22.             dwColor = g_dwBLUE;
  23.         }
  24.     }


Now my theory is that if you were is add more IF's (for example):

  1. if( pName[ 0 ] == '[' && pName[ 1 ] == 'P' && pName[ 2 ] == 'Y' && pName[3 ] == ']' )
  2.         {
  3.             dwColor = g_dwPURPLE;
  4.         }


Now if you add [PY] to your name, then you will have a violet name tag.

Also take note of the "pName[ 0 ]" since the [ 0 ] value seems to be increasing with each condition(for example):
'[' would be 'pName[ 0 ]' since it is the FIRST condition in that line "theoretically"
'P' would be pName[ 1 ] since it is the Second condition in that line.


Please note that this is amature work and I could be wrong, but incase you want to test this theory; here you go :).

Re: Client 137 Avatar Name Color (In-Source)

PostPosted: Mon Jan 09, 2017 3:44 pm
by PurpleYouko
Nice find.

You are correct. That is definitely how you would change the color of the avatar name :D

Re: Client 137 Avatar Name Color (In-Source)

PostPosted: Thu Jan 12, 2017 7:22 pm
by Dibella
Heya, so a slight update is in order.

I have made a special addition to my name (Like blue on GM's)
BUT I made a slight change, instead of giving others the luxury of seeing your sexy black name, I also managed to get it so that I can see my own black name.

If anybody is interested, I can post my code.

Regards,
Dibella :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D

Re: Client 137 Avatar Name Color (In-Source)

PostPosted: Thu Jan 12, 2017 8:35 pm
by PurpleYouko
sure go ahead.

it might be worth starting up a new sub forum for little snippets of code like this