Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 9, 2010, 9:32:58 PM (14 years ago)
Author:
rgrieder
Message:

Removed excess white space at the end of lines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/orxonox/ChatInputHandler.cc

    r7049 r7127  
    4040#include <string>
    4141
    42 namespace orxonox 
     42namespace orxonox
    4343{
    4444  /* singleton */
     
    4848  SetConsoleCommandAlias( ChatInputHandler, activate_static, "startchat",
    4949    true );
    50   SetConsoleCommandAlias( ChatInputHandler, activate_small_static, 
     50  SetConsoleCommandAlias( ChatInputHandler, activate_small_static,
    5151    "startchat_small", true );
    5252
     
    111111
    112112    /* cast it to a listbox */
    113     lb_history = dynamic_cast<CEGUI::Listbox*>(history); 
     113    lb_history = dynamic_cast<CEGUI::Listbox*>(history);
    114114
    115115    /* assert wee */
     
    140140    }
    141141
    142     // blues 
     142    // blues
    143143    red = 0.5, green = 0.5, blue = 1;
    144144    for( ; i < NumberOfColors; ++i )
     
    171171  }
    172172
    173   void ChatInputHandler::deactivate() 
     173  void ChatInputHandler::deactivate()
    174174  {
    175175    /* stop listening */
     
    202202
    203203  /* handle incoming chat */
    204   void ChatInputHandler::incomingChat(const std::string& message, 
     204  void ChatInputHandler::incomingChat(const std::string& message,
    205205    unsigned int senderID)
    206206  {
     
    210210    /* setup player name info */
    211211    if (senderID != CLIENTID_UNKNOWN)
    212     { 
     212    {
    213213       PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
    214214       if (player)
     
    227227    /* now add */
    228228    this->lb_history->addItem( dynamic_cast<CEGUI::ListboxItem*>(toadd) );
    229     this->lb_history->ensureItemIsVisible( 
     229    this->lb_history->ensureItemIsVisible(
    230230      dynamic_cast<CEGUI::ListboxItem*>(toadd) );
    231231
    232232    /* make sure the history handles it */
    233233    this->lb_history->handleUpdatedItemData();
    234   } 
     234  }
    235235
    236236
    237237  /* sub for inputchanged */
    238   void ChatInputHandler::sub_adjust_dispoffset( int maxlen, 
    239     int cursorpos, 
     238  void ChatInputHandler::sub_adjust_dispoffset( int maxlen,
     239    int cursorpos,
    240240    int inplen )
    241241  {
    242242    /* already start offsetting 5 characters before end */
    243243    if( cursorpos+5 > maxlen )
    244     { 
     244    {
    245245      /* always stay 5 characters ahead of end, looks better */
    246246      ((disp_offset = cursorpos-maxlen+5) >= 0) ? 1 : disp_offset = 0;
     
    249249      (disp_offset > cursorpos ) ? disp_offset = 0 : 1;
    250250    }
    251      
     251
    252252    /* make sure we don't die at substr */
    253253    if( inplen <= disp_offset ) disp_offset = 0;
     
    260260    std::string raw = this->inpbuf->get();
    261261    int cursorpos = this->inpbuf->getCursorPosition();
    262    
     262
    263263    /* get string before cursor */
    264264    std::string left = raw.substr( 0, cursorpos );
     
    268268    if( raw.length() >= left.length()+1 )
    269269      right = raw.substr( cursorpos );
    270      
     270
    271271    /* set the text */
    272272    std::string assembled = "$ " + left + "|" + right;
    273273
    274274    if( this->fullchat )
    275     { 
     275    {
    276276      /* adjust curser position - magic number 5 for font width */
    277       sub_adjust_dispoffset( (this->input->getUnclippedInnerRect().getWidth()/6), 
     277      sub_adjust_dispoffset( (this->input->getUnclippedInnerRect().getWidth()/6),
    278278        cursorpos, assembled.length() );
    279279      this->input->setProperty( "Text", assembled.substr( disp_offset ) );
     
    282282    {
    283283      /* adjust curser position - magic number 5 for font width */
    284       sub_adjust_dispoffset( (this->inputonly->getUnclippedInnerRect().getWidth()/6), 
     284      sub_adjust_dispoffset( (this->inputonly->getUnclippedInnerRect().getWidth()/6),
    285285        cursorpos, assembled.length() );
    286286      this->inputonly->setProperty( "Text", assembled.substr( disp_offset) );
     
    323323  void ChatInputHandler::cursorRight()
    324324  { this->inpbuf->increaseCursor(); }
    325  
     325
    326326  void ChatInputHandler::cursorLeft()
    327327  { this->inpbuf->decreaseCursor(); }
    328  
     328
    329329  void ChatInputHandler::cursorEnd()
    330330  { this->inpbuf->setCursorToEnd(); }
Note: See TracChangeset for help on using the changeset viewer.