Changeset 8829 for code/branches/output/src/orxonox/chat
- Timestamp:
- Aug 7, 2011, 3:11:16 PM (13 years ago)
- Location:
- code/branches/output/src/orxonox/chat
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/orxonox/chat/CMakeLists.txt
r8828 r8829 2 2 ChatHistory.cc 3 3 ChatInputHandler.cc 4 ChatManager.cc 4 5 ) -
code/branches/output/src/orxonox/chat/ChatHistory.cc
r8828 r8829 74 74 75 75 /* react to incoming chat */ 76 void ChatHistory::incomingChat(const std::string& message, 77 unsigned int senderID) 76 void ChatHistory::incomingChat(const std::string& message, const std::string& /*name*/) 78 77 { 79 /* --> a) look up the actual name of the sender */80 std::string text = message;81 82 #ifndef CHATTEST83 /* get sender ID and prepend it to the message */84 if (senderID != NETWORK_PEER_ID_UNKNOWN)85 {86 PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);87 if (player)88 text = player->getName() + ": " + message;89 }90 #endif91 92 78 /* add the line to the history */ 93 this->chat_hist_addline( text);79 this->chat_hist_addline( message ); 94 80 95 81 /* add the line to the log */ 96 this->chat_hist_logline( text);82 this->chat_hist_logline( message ); 97 83 } 98 84 -
code/branches/output/src/orxonox/chat/ChatHistory.h
r8828 r8829 37 37 38 38 #ifndef CHATTEST 39 #include <OrxonoxPrereqs.h> 40 #include <PlayerManager.h> 41 #include <infos/PlayerInfo.h> 42 #include <core/BaseObject.h> 43 #include <network/ChatListener.h> 44 #include <core/PathConfig.h> 45 #include <util/Singleton.h> 39 #include "OrxonoxPrereqs.h" 40 41 #include "util/Singleton.h" 42 #include "core/BaseObject.h" 43 #include "core/PathConfig.h" 44 #include "chat/ChatListener.h" 45 #include "infos/PlayerInfo.h" 46 #include "PlayerManager.h" 46 47 #endif 47 48 … … 82 83 * \param senderID Identification number of the sender 83 84 */ 84 virtual void incomingChat(const std::string& message, 85 unsigned int senderID); 85 virtual void incomingChat(const std::string& message, const std::string& name); 86 86 87 87 /** Synchronize logfile onto the hard drive -
code/branches/output/src/orxonox/chat/ChatInputHandler.cc
r8828 r8829 44 44 #include "core/input/InputManager.h" 45 45 #include "core/input/InputState.h" 46 #include "network/Host.h" 47 46 47 #include "chat/ChatManager.h" 48 48 #include "PlayerManager.h" 49 49 #include "infos/PlayerInfo.h" … … 213 213 214 214 /* handle incoming chat */ 215 void ChatInputHandler::incomingChat(const std::string& message, 216 unsigned int senderID) 217 { 218 /* look up the actual name of the sender */ 219 std::string text = message; 220 std::string name = ""; 221 222 /* setup player name info */ 223 if (senderID != NETWORK_PEER_ID_UNKNOWN) 224 { 225 PlayerInfo* player = PlayerManager::getInstance().getClient(senderID); 226 if (player) 227 { 228 name = player->getName(); 229 text = name + ": " + message; 230 } 231 } 232 215 void ChatInputHandler::incomingChat(const std::string& message, const std::string& name) 216 { 233 217 /* create item */ 234 CEGUI::ListboxTextItem *toadd = new CEGUI::ListboxTextItem( text);218 CEGUI::ListboxTextItem *toadd = new CEGUI::ListboxTextItem( message ); 235 219 236 220 /* setup colors */ … … 320 304 321 305 /* c) send the chat via some call */ 322 Host::Chat( msgtosend );306 ChatManager::chat( msgtosend ); 323 307 324 308 /* d) stop listening to input - only if this is not fullchat */ -
code/branches/output/src/orxonox/chat/ChatInputHandler.h
r8828 r8829 30 30 #define _ChatInputHandler_H__ 31 31 32 #include <OrxonoxPrereqs.h>32 #include "OrxonoxPrereqs.h" 33 33 34 34 #include <string> … … 37 37 38 38 #include "util/Singleton.h" 39 #include " network/ChatListener.h"39 #include "chat/ChatListener.h" 40 40 41 41 namespace orxonox // tolua_export … … 112 112 * history window of the full chat window) 113 113 */ 114 void incomingChat( const std::string& message, 115 unsigned int senderID ); 114 void incomingChat(const std::string& message, const std::string& name); 116 115 117 116 /** \param full true means show full chat window with history,
Note: See TracChangeset
for help on using the changeset viewer.