From: <wel...@us...> - 2010-01-06 18:11:47
|
Revision: 5163 http://planeshift.svn.sourceforge.net/planeshift/?rev=5163&view=rev Author: weltall2 Date: 2010-01-06 18:11:41 +0000 (Wed, 06 Jan 2010) Log Message: ----------- fixed colouring mess of char names and added it also on /my Modified Paths: -------------- trunk/src/client/gui/chatwindow.cpp Modified: trunk/src/client/gui/chatwindow.cpp =================================================================== --- trunk/src/client/gui/chatwindow.cpp 2010-01-06 15:13:57 UTC (rev 5162) +++ trunk/src/client/gui/chatwindow.cpp 2010-01-06 18:11:41 UTC (rev 5163) @@ -1241,18 +1241,17 @@ void pawsChatWindow::FormatMessage(csString &sText, csString &sPerson, csString prependingText, csString &buff, bool &hasCharName) { + //checks how we should colour the name of the person + //red if it's the player green if it's other players + csString nameColouringCode = hasCharName ? REDCODE : GREENCODE; if ( sText.StartsWith("/me ") ) - buff.Format(REDCODE "%s" DEFAULTCODE " %s", (const char *)sPerson, ((const char *)sText)+4); + buff.Format("%s%s" DEFAULTCODE " %s", (const char *) nameColouringCode, (const char *)sPerson, ((const char *)sText)+4); else if ( sText.StartsWith("/my ") ) - buff.Format("%s's %s", (const char *)sPerson, ((const char *)sText)+4); + buff.Format("%s%s's %s", (const char *) nameColouringCode, (const char *)sPerson, ((const char *)sText)+4); else { - if(hasCharName) - buff.Format(REDCODE "%s" DEFAULTCODE " %s: %s", (const char *)sPerson, (const char *) PawsManager::GetSingleton().Translate(prependingText), - (const char *)sText); - else - buff.Format(GREENCODE "%s" DEFAULTCODE " %s: %s", (const char *)sPerson, (const char *) PawsManager::GetSingleton().Translate(prependingText), - (const char *)sText); + buff.Format("%s%s" DEFAULTCODE " %s: %s", (const char *) nameColouringCode,(const char *)sPerson, + (const char *) PawsManager::GetSingleton().Translate(prependingText), (const char *)sText); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |