Changeset 8826 for code/branches
- Timestamp:
- Aug 6, 2011, 3:40:37 PM (13 years ago)
- Location:
- code/branches/output/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/modules/overlays/hud/ChatOverlay.cc
r8825 r8826 69 69 void ChatOverlay::incomingChat(const std::string& message, unsigned int senderID) 70 70 { 71 std::string text ;71 std::string text = message; 72 72 73 73 if (senderID != NETWORK_PEER_ID_UNKNOWN) 74 74 { 75 std::string name = "unknown";76 77 75 PlayerInfo* player = PlayerManager::getInstance().getClient(senderID); 78 76 if (player) 79 name = player->getName(); 80 81 text = name + ": " + message; 82 } 83 else 84 { 85 text = message; 77 text = player->getName() + ": " + message; 86 78 } 87 79 -
code/branches/output/src/orxonox/ChatHistory.cc
r8809 r8826 78 78 { 79 79 /* --> a) look up the actual name of the sender */ 80 std::string text ;80 std::string text = message; 81 81 82 82 #ifndef CHATTEST … … 84 84 if (senderID != NETWORK_PEER_ID_UNKNOWN) 85 85 { 86 /* if we can't find anything, use "unknown" as default */87 std::string name = "unknown";88 89 86 PlayerInfo* player = PlayerManager::getInstance().getClient(senderID); 90 87 if (player) 91 name = player->getName(); 92 93 text = name + ": " + message; 88 text = player->getName() + ": " + message; 94 89 } 95 else96 text = message;97 #else98 text = message;99 90 #endif 100 91 -
code/branches/output/src/orxonox/ChatInputHandler.cc
r8809 r8826 217 217 { 218 218 /* look up the actual name of the sender */ 219 std::string text, name = "unknown"; 219 std::string text = message; 220 std::string name = ""; 220 221 221 222 /* setup player name info */ … … 224 225 PlayerInfo* player = PlayerManager::getInstance().getClient(senderID); 225 226 if (player) 227 { 226 228 name = player->getName(); 227 } 228 229 /* assemble the text */ 230 text = name + ": " + message; 229 text = name + ": " + message; 230 } 231 } 231 232 232 233 /* create item */ … … 234 235 235 236 /* setup colors */ 236 sub_setcolor( toadd, name ); 237 if (name != "") 238 sub_setcolor( toadd, name ); 237 239 238 240 /* now add */
Note: See TracChangeset
for help on using the changeset viewer.