Client 137 Avatar Name Color (In-Source)

A project which includes source code for an old and somewhat unique evo client and an OsRose server which comprises of an old rev81 combined with KTRose pre-evo. Many new features in both client and server

Client 137 Avatar Name Color (In-Source)

Postby Dibella on Sun Jan 08, 2017 5:04 pm

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 :).
Dibella
Smoulie
Smoulie
 
Posts: 46
Joined: Sat Apr 13, 2013 8:49 pm

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

Postby PurpleYouko on Mon Jan 09, 2017 3:44 pm

Nice find.

You are correct. That is definitely how you would change the color of the avatar name :D
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

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

Postby Dibella on Thu Jan 12, 2017 7:22 pm

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
Dibella
Smoulie
Smoulie
 
Posts: 46
Joined: Sat Apr 13, 2013 8:49 pm

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

Postby PurpleYouko on Thu Jan 12, 2017 8:35 pm

sure go ahead.

it might be worth starting up a new sub forum for little snippets of code like this
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm


Return to Support -- Project 137

Who is online

Users browsing this forum: No registered users and 1 guest

cron