Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8826 for code/branches


Ignore:
Timestamp:
Aug 6, 2011, 3:40:37 PM (13 years ago)
Author:
landauf
Message:

display chat messages without sender without name (currently used for gameplay messages)

Location:
code/branches/output/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/modules/overlays/hud/ChatOverlay.cc

    r8825 r8826  
    6969    void ChatOverlay::incomingChat(const std::string& message, unsigned int senderID)
    7070    {
    71         std::string text;
     71        std::string text = message;
    7272
    7373        if (senderID != NETWORK_PEER_ID_UNKNOWN)
    7474        {
    75             std::string name = "unknown";
    76 
    7775            PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
    7876            if (player)
    79                 name = player->getName();
    80 
    81             text = name + ": " + message;
    82         }
    83         else
    84         {
    85             text = message;
     77                text = player->getName() + ": " + message;
    8678        }
    8779
  • code/branches/output/src/orxonox/ChatHistory.cc

    r8809 r8826  
    7878  {
    7979    /* --> a) look up the actual name of the sender */
    80     std::string text;
     80    std::string text = message;
    8181
    8282#ifndef CHATTEST
     
    8484    if (senderID != NETWORK_PEER_ID_UNKNOWN)
    8585    {
    86       /* if we can't find anything, use "unknown" as default */
    87       std::string name = "unknown";
    88 
    8986      PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
    9087      if (player)
    91         name = player->getName();
    92 
    93       text = name + ": " + message;
     88        text = player->getName() + ": " + message;
    9489    }
    95     else
    96       text = message;
    97 #else
    98     text = message;
    9990#endif
    10091
  • code/branches/output/src/orxonox/ChatInputHandler.cc

    r8809 r8826  
    217217  {
    218218    /* look up the actual name of the sender */
    219     std::string text, name = "unknown";
     219    std::string text = message;
     220    std::string name = "";
    220221
    221222    /* setup player name info */
     
    224225       PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
    225226       if (player)
     227       {
    226228         name = player->getName();
    227     }
    228 
    229     /* assemble the text */
    230     text = name + ": " + message;
     229         text = name + ": " + message;
     230       }
     231    }
    231232
    232233    /* create item */
     
    234235
    235236    /* setup colors */
    236     sub_setcolor( toadd, name );
     237    if (name != "")
     238      sub_setcolor( toadd, name );
    237239
    238240    /* now add */
Note: See TracChangeset for help on using the changeset viewer.