Changeset 6910
- Timestamp:
- May 17, 2010, 3:22:10 PM (15 years ago)
- Location:
- code/branches/chat2
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/chat2/data/gui/layouts/ChatBox.layout
r6876 r6910 11 11 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 12 12 <Property Name="TitlebarEnabled" Value="True" /> 13 <Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.03,0},{0.6,0},{0.69375,0}}" /> 13 <!--<Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.03,0},{0.6,0},{0.69375,0}}" />--> 14 <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.10,0},{0.98,0},{0.65,0}}" /> 14 15 <Window Type="MenuWidgets/Listbox" Name="orxonox/ChatBox/history" > 15 16 <Property Name="Font" Value="Monofur-10" /> -
code/branches/chat2/src/orxonox/ChatHistory.cc
r6846 r6910 80 80 std::string text; 81 81 82 //COUT(0) << "Meow.\n";83 84 82 #ifndef CHATTEST 83 /* get sender ID and prepend it to the message */ 85 84 if (senderID != CLIENTID_UNKNOWN) 86 85 { 87 std::string name = "unknown"; 88 PlayerInfo* player = PlayerManager::getInstance().getClient(senderID); 89 if (player) 90 name = player->getName(); 86 /* if we can't find anything, use "unknown" as default */ 87 std::string name = "unknown"; 91 88 92 text = name + ": " + message; 89 PlayerInfo* player = PlayerManager::getInstance().getClient(senderID); 90 if (player) 91 name = player->getName(); 92 93 text = name + ": " + message; 93 94 } 94 95 else … … 164 165 void ChatHistory::chat_hist_closelog() 165 166 { 167 /* see if we've actually got a logfile */ 166 168 if( this->hist_logfile ) 167 { this->chat_hist_logline( "--- Logfile closed ---" ); 169 { 170 /* yes, we've got one, add a line that shows we're closing it */ 171 this->chat_hist_logline( "--- Logfile closed ---" ); 172 173 /* actually close down the file */ 168 174 this->hist_logfile.close(); 169 175 } -
code/branches/chat2/src/orxonox/ChatInputHandler.cc
r6890 r6910 75 75 void ChatInputHandler::configureInputBuffer() 76 76 { 77 /* INSTALL CALLBACKS */ 77 78 /* input has changed */ 78 79 this->inpbuf->registerListener(this, &ChatInputHandler::inputChanged, true); … … 98 99 this->inpbuf->registerListener(this, &ChatInputHandler::cursorHome, KeyCode::Home); 99 100 100 /* get window pointers*/101 /* GET WINDOW POINTERS */ 101 102 input = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/input" ); 102 103 inputonly = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox-inputonly/input" ); 103 104 105 /* get pointer to the history window */ 104 106 CEGUI::Window *history = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/history" ); 107 108 /* cast it to a listbox */ 105 109 lb_history = dynamic_cast<CEGUI::Listbox*>(history); 106 110 -
code/branches/chat2/src/orxonox/ChatInputHandler.h
r6885 r6910 78 78 void sub_adjust_dispoffset( int maxlen, int cursorpos, int inplen ); 79 79 80 /* singleton pointer */80 /** singleton pointer */ 81 81 static ChatInputHandler* singletonPtr_s; 82 82 83 /* cegui stuff*/83 /** cegui window handles */ 84 84 CEGUI::Window *input, *inputonly; 85 86 /** cegui handle for the history window */ 85 87 CEGUI::Listbox *lb_history; 86 87 public:88 /** constructor */89 ChatInputHandler();90 friend class Singleton<ChatInputHandler>;91 92 /* start listening, stop listening */93 static void activate_static();94 static void activate_small_static();95 96 void incomingChat( const std::string& message,97 unsigned int senderID );98 99 void activate( bool full );100 void deactivate();101 88 102 89 /* callbacks for input handler */ … … 110 97 void cursorHome(); 111 98 void exit(); 99 100 public: 101 /** constructor */ 102 ChatInputHandler(); 103 friend class Singleton<ChatInputHandler>; 104 105 /** start listening */ 106 static void activate_static(); 107 108 /** stop listening */ 109 static void activate_small_static(); 110 111 /** \param message the message text 112 * \param senderID ID of the player who sent the message 113 * 114 * Deal with incoming chat (which means in our case: Add it to the 115 * history window of the full chat window) 116 */ 117 void incomingChat( const std::string& message, 118 unsigned int senderID ); 119 120 /** \param full true means show full chat window with history, 121 false means show only an input line 122 * 123 * Show the chat window and redirect the game's keyboard input 124 * into it. 125 */ 126 void activate( bool full ); 127 128 /** Deactivate the chat window, meaning: hide it. */ 129 void deactivate(); 130 112 131 }; 113 132
Note: See TracChangeset
for help on using the changeset viewer.