Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 10, 2010, 4:24:18 PM (14 years ago)
Author:
smerkli
Message:

Strage delete-button bug persists.

File:
1 edited

Legend:

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

    r6879 r6885  
    117117  { ChatInputHandler::getInstance().activate( false ); }
    118118
     119
     120
     121
    119122  void ChatInputHandler::activate( bool full )
    120123  {
     
    142145  }
    143146
    144   void ChatInputHandler::sub_adjust_dispoffset( int maxlen, int cursorpos, int inplen )
     147
     148  void ChatInputHandler::incomingChat(const std::string& message,
     149    unsigned int senderID)
     150  {
     151    /* --> a) look up the actual name of the sender */
     152    std::string text;
     153
     154    if (senderID != CLIENTID_UNKNOWN)
     155    {
     156       std::string name = "unknown";
     157       PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
     158       if (player)
     159         name = player->getName();
     160
     161         text = name + ": " + message;
     162    }
     163    else
     164      text = message;
     165
     166    /* e) create item and add to history */
     167    CEGUI::ListboxTextItem *toadd = new CEGUI::ListboxTextItem( text );
     168    this->lb_history->addItem( dynamic_cast<CEGUI::ListboxItem*>(toadd) );
     169    this->lb_history->ensureItemIsVisible( dynamic_cast<CEGUI::ListboxItem*>(toadd) );
     170
     171    /* f) make sure the history handles it */
     172    this->lb_history->handleUpdatedItemData();
     173  }
     174
     175
     176  void ChatInputHandler::sub_adjust_dispoffset( int maxlen,
     177    int cursorpos,
     178    int inplen )
    145179  {
    146180    /* already start offsetting 5 characters before end */
     
    213247    Host::Chat( msgtosend );
    214248
    215     /* d) stop listening to input */
     249    /* d) stop listening to input - only if this is not fullchat */
    216250    if( !this->fullchat )
    217251      this->deactivate();
    218252
    219     /* e) create item and add to history */
    220     CEGUI::ListboxTextItem *toadd = new CEGUI::ListboxTextItem( msgtosend );
    221     this->lb_history->addItem( dynamic_cast<CEGUI::ListboxItem*>(toadd) );
    222     this->lb_history->ensureItemIsVisible( dynamic_cast<CEGUI::ListboxItem*>(toadd) );
    223 
    224     /* f) make sure the history handles it */
    225     this->lb_history->handleUpdatedItemData();
    226253  }
    227254
Note: See TracChangeset for help on using the changeset viewer.