From: Anders R. <ma...@us...> - 2003-04-22 19:16:51
|
Update of /cvsroot/planeshift/planeshift/src/client/paws In directory sc8-pr-cvs1:/tmp/cvs-serv23245/src/client/paws Modified Files: chatwindow.cpp chatwindow.h pawsprefmanager.cpp pawsprefmanager.h Log Message: - Updated the new chatwindow with the chages done to the old pscomm window to handel group chat. - Added colour for group chat and auction messages. Index: chatwindow.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/chatwindow.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** chatwindow.cpp 22 Apr 2003 18:44:50 -0000 1.2 --- chatwindow.cpp 22 Apr 2003 19:16:13 -0000 1.3 *************** *** 94,98 **** shoutColour = windowManager->GetPrefs()->GetShoutColour(); yourColour = windowManager->GetPrefs()->GetYourColour(); ! return true; --- 94,99 ---- shoutColour = windowManager->GetPrefs()->GetShoutColour(); yourColour = windowManager->GetPrefs()->GetYourColour(); ! groupColour = windowManager->GetPrefs()->GetGroupColour(); ! auctionColour= windowManager->GetPrefs()->GetAuctionColour(); return true; *************** *** 127,132 **** chattype = CHAT_GUILD; } ! else if ( !strncmp(buff+1, "group ", 6) || ! !strncmp(buff+1, "shout ", 6)) { pPerson = ""; --- 128,132 ---- chattype = CHAT_GUILD; } ! else if ( !strncmp(buff+1, "shout ", 6)) { pPerson = ""; *************** *** 135,138 **** --- 135,145 ---- chattype = CHAT_SHOUT; } + else if ( !strncmp(buff+1, "group ", 6)) + { + pPerson = ""; + pText = buff + 7; + *(pText-1) = 0; + chattype = CHAT_GROUP; + } else if ( !strncmp(buff+1, "tell ", 5) ) { *************** *** 164,184 **** chattype = CHAT_ME; } - else if ( !strncmp(buff+1, "admin", 5)) - { - delete[] buff; - return "Not implemented yet"; - } - - else if ( !strncmp(buff+1, "help", 4)) - { - delete[] buff; - return "Valid commands: /say, /me, /shout, /group, /guild, " - "/auction, /tell, /admin and /help"; - } - else { delete[] buff; ! return "Invalid command (use /help)"; } --- 171,178 ---- chattype = CHAT_ME; } else { delete[] buff; ! return "Unkown command"; } *************** *** 242,245 **** --- 236,245 ---- { case CHAT_GROUP: + { + cs_snprintf(buff,1024,"%s tells group: %s\n", + (const char *)msg.sPerson,(const char *)msg.sText); + colour = groupColour; + break; + } case CHAT_SHOUT: { *************** *** 250,258 **** } case CHAT_GUILD: - case CHAT_AUCTION: { cs_snprintf(buff,1024,"%s from %s: %s",pType, (const char *)msg.sPerson,(const char *)msg.sText); colour = guildColour; break; } --- 250,264 ---- } case CHAT_GUILD: { cs_snprintf(buff,1024,"%s from %s: %s",pType, (const char *)msg.sPerson,(const char *)msg.sText); colour = guildColour; + break; + } + case CHAT_AUCTION: + { + cs_snprintf(buff,1024,"%s from %s: %s",pType, + (const char *)msg.sPerson,(const char *)msg.sText); + colour = auctionColour; break; } Index: chatwindow.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/chatwindow.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** chatwindow.h 22 Apr 2003 00:55:27 -0000 1.1 --- chatwindow.h 22 Apr 2003 19:16:14 -0000 1.2 *************** *** 103,106 **** --- 103,110 ---- int yourColour; + int groupColour; + + int auctionColour; + /// Decides if we have a player name bool havePlayerName; Index: pawsprefmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawsprefmanager.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pawsprefmanager.cpp 22 Apr 2003 03:15:47 -0000 1.2 --- pawsprefmanager.cpp 22 Apr 2003 19:16:14 -0000 1.3 *************** *** 134,137 **** --- 134,139 ---- if ( nodeName == "guildtext") guildColour = col; if ( nodeName == "yourtext") yourColour = col; + if ( nodeName == "grouptext") groupColour = col; + if ( nodeName == "auctiontext") auctionColour = col; } Index: pawsprefmanager.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/paws/pawsprefmanager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pawsprefmanager.h 22 Apr 2003 00:55:27 -0000 1.1 --- pawsprefmanager.h 22 Apr 2003 19:16:14 -0000 1.2 *************** *** 56,59 **** --- 56,61 ---- int GetGuildColour() { return guildColour; } int GetYourColour() { return yourColour; } + int GetGroupColour() { return groupColour; } + int GetAuctionColour() { return auctionColour; } private: *************** *** 67,70 **** --- 69,74 ---- int guildColour; int yourColour; + int groupColour; + int auctionColour; csRef<iObjectRegistry> objectReg; |