Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6879


Ignore:
Timestamp:
May 10, 2010, 3:50:27 PM (15 years ago)
Author:
smerkli
Message:

bugfixes, performance improvements.

Location:
code/branches/chat2/src/orxonox
Files:
2 edited

Legend:

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

    r6876 r6879  
    128128    else
    129129      GUIManager::getInstance().showGUI( "ChatBox-inputonly" );
     130
     131    this->fullchat = full;
    130132  }
    131133
     
    174176    std::string assembled = "$ " + left + "|" + right;
    175177
    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    }
    188192
    189193    /* reset display offset */
     
    210214
    211215    /* d) stop listening to input  */
    212     this->deactivate();
     216    if( !this->fullchat )
     217      this->deactivate();
    213218
    214219    /* e) create item and add to history */
     
    240245
    241246  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  }
    243255
    244256}
  • code/branches/chat2/src/orxonox/ChatInputHandler.h

    r6876 r6879  
    6363      InputBuffer *inpbuf;
    6464      int disp_offset, width;
     65      bool fullchat;
    6566
    6667      /** input state */
Note: See TracChangeset for help on using the changeset viewer.