Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6910 for code


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

Added final comments, getting ready for merge

Location:
code/branches/chat2
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/chat2/data/gui/layouts/ChatBox.layout

    r6876 r6910  
    1111            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    1212            <Property Name="TitlebarEnabled" Value="True" />
    13             <Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.03,0},{0.6,0},{0.69375,0}}" />
     13            <!--<Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.03,0},{0.6,0},{0.69375,0}}" />-->
     14            <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.10,0},{0.98,0},{0.65,0}}" />
    1415            <Window Type="MenuWidgets/Listbox" Name="orxonox/ChatBox/history" >
    1516                <Property Name="Font" Value="Monofur-10" />
  • code/branches/chat2/src/orxonox/ChatHistory.cc

    r6846 r6910  
    8080    std::string text;
    8181
    82     //COUT(0) << "Meow.\n";
    83 
    8482#ifndef CHATTEST
     83    /* get sender ID and prepend it to the message */
    8584    if (senderID != CLIENTID_UNKNOWN)
    8685    {
    87        std::string name = "unknown";
    88        PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
    89        if (player)
    90          name = player->getName();
     86      /* if we can't find anything, use "unknown" as default */
     87      std::string name = "unknown";
    9188
    92          text = name + ": " + message;
     89      PlayerInfo* player = PlayerManager::getInstance().getClient(senderID);
     90      if (player)
     91        name = player->getName();
     92
     93      text = name + ": " + message;
    9394    }
    9495    else
     
    164165  void ChatHistory::chat_hist_closelog()
    165166  {
     167    /* see if we've actually got a logfile */
    166168    if( this->hist_logfile )
    167     { this->chat_hist_logline( "--- Logfile closed ---" );
     169    {
     170      /* yes, we've got one, add a line that shows we're closing it */
     171      this->chat_hist_logline( "--- Logfile closed ---" );
     172
     173      /* actually close down the file */
    168174      this->hist_logfile.close();
    169175    }
  • code/branches/chat2/src/orxonox/ChatInputHandler.cc

    r6890 r6910  
    7575  void ChatInputHandler::configureInputBuffer()
    7676  {
     77    /* INSTALL CALLBACKS */
    7778    /* input has changed */
    7879    this->inpbuf->registerListener(this, &ChatInputHandler::inputChanged, true);
     
    9899    this->inpbuf->registerListener(this, &ChatInputHandler::cursorHome,      KeyCode::Home);
    99100
    100     /* get window pointers */
     101    /* GET WINDOW POINTERS */
    101102    input = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/input" );
    102103    inputonly = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox-inputonly/input" );
    103104
     105    /* get pointer to the history window */
    104106    CEGUI::Window *history = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/history" );
     107
     108    /* cast it to a listbox */
    105109    lb_history = dynamic_cast<CEGUI::Listbox*>(history);
    106110
  • code/branches/chat2/src/orxonox/ChatInputHandler.h

    r6885 r6910  
    7878      void sub_adjust_dispoffset( int maxlen, int cursorpos, int inplen );
    7979
    80       /* singleton pointer */
     80      /** singleton pointer */
    8181      static ChatInputHandler* singletonPtr_s;
    8282
    83       /* cegui stuff */
     83      /** cegui window handles */
    8484      CEGUI::Window *input, *inputonly;
     85
     86      /** cegui handle for the history window */
    8587      CEGUI::Listbox *lb_history;
    86 
    87     public:
    88       /** constructor */
    89       ChatInputHandler();
    90       friend class Singleton<ChatInputHandler>;
    91 
    92       /* start listening, stop listening */
    93       static void activate_static();
    94       static void activate_small_static();
    95 
    96       void incomingChat( const std::string& message,
    97         unsigned int senderID );
    98 
    99       void activate( bool full );
    100       void deactivate();
    10188
    10289      /* callbacks for input handler */
     
    11097      void cursorHome();
    11198      void exit();
     99
     100    public:
     101      /** constructor */
     102      ChatInputHandler();
     103      friend class Singleton<ChatInputHandler>;
     104
     105      /** start listening */
     106      static void activate_static();
     107
     108      /** stop listening */
     109      static void activate_small_static();
     110
     111      /** \param message the message text
     112       * \param senderID ID of the player who sent the message
     113       *
     114       * Deal with incoming chat (which means in our case: Add it to the
     115       * history window of the full chat window)
     116       */
     117      void incomingChat( const std::string& message,
     118        unsigned int senderID );
     119
     120      /** \param full true means show full chat window with history,
     121            false means show only an input line
     122       *
     123       * Show the chat window and redirect the game's keyboard input
     124       * into it.
     125       */
     126      void activate( bool full );
     127
     128      /** Deactivate the chat window, meaning: hide it. */
     129      void deactivate();
     130
    112131  };
    113132
Note: See TracChangeset for help on using the changeset viewer.