Messages Class Reference

Class that holds messages in game. More...

#include <messages.h>

Inherits InputAcceptor.

Inheritance diagram for Messages:

Inheritance graph
[legend]
Collaboration diagram for Messages:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Messages ()
 ~Messages ()
void addMessage (const std::string &msg)
void render ()
virtual bool wantKey (const SDL_keysym &keysym)
virtual bool keyDown (const SDL_keysym &keysym)
void init ()
 Inicialize the messages window and plug it into the system.
void clean ()
 Clean resources allocated by Messages window.

Private Attributes

std::list< std::string > mMessages
int mDisplayedMessages
 Number of max diplayed messages.
InputString mInputLine
 currently edited command
FontRef mFont
 font for console - should be loaded from Manager
bool mActive
 true if chat message editing is active

Detailed Description

Class that holds messages in game.

Definition at line 18 of file messages.h.


Constructor & Destructor Documentation

Messages::Messages  ) 
 

Definition at line 22 of file messages.cpp.

References IA_PRIORITY_CHAT, mActive, mDisplayedMessages, mFont, and InputAcceptor::mPriority.

Messages::~Messages  ) 
 

Definition at line 33 of file messages.cpp.


Member Function Documentation

void Messages::addMessage const std::string &  msg  ) 
 

Definition at line 70 of file messages.cpp.

References LOGD, mDisplayedMessages, mMessages, and TIN.

Referenced by GameGUI::addMessage(), and keyDown().

void Messages::clean  ) 
 

Clean resources allocated by Messages window.

Definition at line 56 of file messages.cpp.

References CHAT_ONOFF, getAppClient(), ApplicationClient::getInputManager(), mFont, InputManager::removeInputAcceptor(), InputManager::setKeyReceiver(), and TIN.

Referenced by GameGUI::clean().

Here is the call graph for this function:

void Messages::init  ) 
 

Inicialize the messages window and plug it into the system.

Menas loading font, textures and adding to InputManager.

Definition at line 39 of file messages.cpp.

References InputManager::addInputAcceptor(), CHAT_ONOFF, DIE(), getAppClient(), ApplicationClient::getInputManager(), Singleton< T >::getRef(), LOGE, mFont, InputManager::setKeyReceiver(), and TIN.

Referenced by GameGUI::init().

Here is the call graph for this function:

bool Messages::keyDown const SDL_keysym &  keysym  )  [virtual]
 

Inform acceptor that key was down.

Returns:
true if the key was accepted

Reimplemented from InputAcceptor.

Definition at line 137 of file messages.cpp.

References addMessage(), CHAT_ONOFF, InputString::clear(), getAppClient(), ApplicationClient::getInputManager(), InputString::getLineU(), LOGD, LOGE, LOGT, mActive, mInputLine, InputString::processKey(), TIN, and InputManager::WantAllInput().

Here is the call graph for this function:

void Messages::render  ) 
 

Definition at line 84 of file messages.cpp.

References assertL, getAppClient(), ApplicationClient::getGFX(), mDisplayedMessages, mFont, mMessages, and GFX::set2DOpenGL().

Referenced by GameGUI::render().

Here is the call graph for this function:

bool Messages::wantKey const SDL_keysym &  keysym  )  [virtual]
 

Console takes every key when active

Reimplemented from InputAcceptor.

Definition at line 129 of file messages.cpp.

References CHAT_ONOFF, and mActive.


Member Data Documentation

bool Messages::mActive [private]
 

true if chat message editing is active

Definition at line 57 of file messages.h.

Referenced by keyDown(), Messages(), and wantKey().

int Messages::mDisplayedMessages [private]
 

Number of max diplayed messages.

Definition at line 51 of file messages.h.

Referenced by addMessage(), Messages(), and render().

FontRef Messages::mFont [private]
 

font for console - should be loaded from Manager

Definition at line 55 of file messages.h.

Referenced by clean(), init(), Messages(), and render().

InputString Messages::mInputLine [private]
 

currently edited command

Definition at line 53 of file messages.h.

Referenced by keyDown().

std::list<std::string> Messages::mMessages [private]
 

Definition at line 50 of file messages.h.

Referenced by addMessage(), and render().


The documentation for this class was generated from the following files:
Generated on Wed Apr 12 14:19:53 2006 for bjs by  doxygen 1.4.5