Changeset 6879
- Timestamp:
- May 10, 2010, 3:50:27 PM (15 years ago)
- Location:
- code/branches/chat2/src/orxonox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/chat2/src/orxonox/ChatInputHandler.cc
r6876 r6879 128 128 else 129 129 GUIManager::getInstance().showGUI( "ChatBox-inputonly" ); 130 131 this->fullchat = full; 130 132 } 131 133 … … 174 176 std::string assembled = "$ " + left + "|" + right; 175 177 176 /* adjust curser position - magic number 5 for font width */ 177 sub_adjust_dispoffset( (this->input->getUnclippedInnerRect().getWidth()/6), 178 cursorpos, assembled.length() ); 179 this->input->setProperty( "Text", assembled.substr( disp_offset ) ); 180 181 /* reset display offset */ 182 disp_offset = 0; 183 184 /* adjust curser position - magic number 5 for font width */ 185 sub_adjust_dispoffset( (this->inputonly->getUnclippedInnerRect().getWidth()/6), 186 cursorpos, assembled.length() ); 187 this->inputonly->setProperty( "Text", assembled.substr( disp_offset) ); 178 if( this->fullchat ) 179 { 180 /* adjust curser position - magic number 5 for font width */ 181 sub_adjust_dispoffset( (this->input->getUnclippedInnerRect().getWidth()/6), 182 cursorpos, assembled.length() ); 183 this->input->setProperty( "Text", assembled.substr( disp_offset ) ); 184 } 185 else 186 { 187 /* adjust curser position - magic number 5 for font width */ 188 sub_adjust_dispoffset( (this->inputonly->getUnclippedInnerRect().getWidth()/6), 189 cursorpos, assembled.length() ); 190 this->inputonly->setProperty( "Text", assembled.substr( disp_offset) ); 191 } 188 192 189 193 /* reset display offset */ … … 210 214 211 215 /* d) stop listening to input */ 212 this->deactivate(); 216 if( !this->fullchat ) 217 this->deactivate(); 213 218 214 219 /* e) create item and add to history */ … … 240 245 241 246 void ChatInputHandler::exit() 242 { } 247 { 248 /* b) clear the input buffer */ 249 if (this->inpbuf->getSize() > 0) 250 this->inpbuf->clear(); 251 252 /* d) stop listening to input */ 253 this->deactivate(); 254 } 243 255 244 256 } -
code/branches/chat2/src/orxonox/ChatInputHandler.h
r6876 r6879 63 63 InputBuffer *inpbuf; 64 64 int disp_offset, width; 65 bool fullchat; 65 66 66 67 /** input state */
Note: See TracChangeset
for help on using the changeset viewer.