Planeshift
|
Main Chat window for PlaneShift. More...
#include <chatwindow.h>
Public Member Functions | |
void | AddAutoCompleteName (const char *name) |
void | AutoReply (void) |
void | BadWordsFilter (csString &s) |
Remove bad words from the output string. | |
void | ChatOutput (const char *data, int colour=-1, int type=CHAT_SYSTEM, bool flashEnabled=true, bool hasCharName=false, int hotkeyChannel=0) |
Function that handles output of various tabbed windows. | |
void | Clear (int mode=-2) |
Clear history. | |
csString | GetBracket (int type) |
Generates a bracket like [tell] starting from the msgtype. | |
char const * | GetFontName () |
return the name of the font | |
pawsIgnoreWindow * | GetIgnoredList () |
pawsEditTextBox * | getInputTextBox () |
ChatSettings & | GetSettings () |
const char * | HandleCommand (const char *cmd) |
For the iCommandSubscriber interface. | |
void | HandleMessage (MsgEntry *message) |
For the iNetSubsciber interface. | |
bool | InputActive () |
Check to see if the text input box is active. | |
void | JoinChannel (csString name) |
Joins the channel and adds the hotkey when the server accepts the join. | |
bool | LeaveChannel (int hotkeyChannel) |
Leaves the channel and removes the hotkey association. | |
void | LoadChatSettings () |
bool | LoadSetting () |
load the settings stored by pawsConfigChatFont | |
int | mixColours (int colour1, int colour2) |
mixes two colours and returns their mixed colour | |
virtual bool | OnButtonPressed (int button, int keyModifier, pawsWidget *widget) |
Called whenever a button is pressed. | |
bool | OnChildMouseEnter (pawsWidget *widget) |
Called when mouse enters a child widget. | |
bool | OnChildMouseExit (pawsWidget *widget) |
Called when a mouse exits a child widget. | |
bool | OnDoubleClick (int button, int modifiers, int x, int y) |
Handle double click events. | |
bool | OnKeyDown (utf32_char keyCode, utf32_char key, int modifiers) |
Process keydown messages. | |
virtual void | OnLostFocus () |
Sets hasFocus false and notifys parent. | |
bool | OnMenuAction (pawsWidget *widget, const pawsMenuAction &action) |
Called whenever a menu action occurs. | |
bool | OnMouseDown (int button, int modifiers, int x, int y) |
Manage mouse down event to test for and apply window changes. | |
pawsChatWindow () | |
void | PerformAction (const char *action) |
Does an action based on this string. | |
bool | PostSetup () |
This is called after the widget and all of it's children have been created. | |
void | RefreshCommandList () |
void | ReloadChatWindow () |
Reload Chat Window. | |
void | RemoveAutoCompleteName (const char *name) |
void | SaveChatSettings () |
void | SelectChatTab (int tab) |
void | SetAway (const char *text) |
Sets the away message. | |
void | SetChatWindowFont (const char *FontName, int FontSize) |
change the font on only the windows that display the chat text | |
virtual void | Show () |
When the window is opened let the controller window know about it. | |
void | SwitchChannel (const csString &name, pawsWidget *widget=NULL) |
void | writeChatHistory () |
virtual | ~pawsChatWindow () |
Protected Member Functions | |
void | CreateSettingNode (iDocumentNode *mNode, int color, const char *name) |
void | DetermineChatTabAndSelect (int chattype) |
void | FormatMessage (csString &sText, csString &sPerson, csString prependingText, csString &buff, bool &hasCharName) |
Takes as input a message and formats it with colours, /me and /my support. | |
void | HandleSystemMessage (MsgEntry *message) |
void | LogMessage (const char *message, int type=CHAT_SAY) |
Logs a message coming from the chat. | |
void | ReplayMessages (unsigned int reqLines) |
Replay recent message history on load. | |
void | SendChatLine (csString &inputText) |
Sends the contents of the input text to the server. | |
void | SubscribeCommands () |
Subscribe the player commands. | |
void | TabCompleteCommand (const char *cmd) |
Tab completion. | |
void | TabCompleteName (const char *cmd) |
Protected Attributes | |
csArray< csArray< csString > * > | autoCompleteLists |
Contains pointers to all the autocompletion lists (excluding command lists) | |
csArray< csString > | autoCompleteNames |
list of names to auto-complete | |
csString | awayText |
csHashReversible< uint32_t, csString > | channelIDs |
Subscribed channel name to server channel ID reversible mapping. | |
csArray< uint16_t > | channels |
Hotkeys for server channel IDs. | |
pawsChatHistory * | chatHistory |
Chat history. | |
csArray< csString > | chatTriggers |
csRedBlackTree< psString > | commandList |
list of last commands | |
csString | currLine |
Current line, stored for when scrolling back in the chat history. | |
bool | havePlayerName |
Decides if we have a player name. | |
pawsIgnoreWindow * | IgnoredList |
pawsEditTextBox * | inputText |
Input box for quick access. | |
bool | isInChannel |
Is already in default channel? | |
csRef< iFile > | logFile [CHAT_END] |
Stores the references to the actually used files for each chat type. | |
csString | noCasePlayerForename |
csString | noCasePlayerName |
Player name, with no upercase. | |
csHash< csRef< iFile >, uint > | openLogFiles |
Stores a reference to all opened log files for easy search. | |
int | replyCount |
csString | replyList [4] |
ChatSettings | settings |
Stores the settings for the chat. | |
csArray< csString > | systemTriggers |
pawsTabWindow * | tabs |
Main Chat window for PlaneShift.
This class will handle most of the communication that goes on between players and system messages from the server. This class also tracks the ignore list on the client.
Definition at line 133 of file chatwindow.h.
pawsChatWindow::pawsChatWindow | ( | ) |
virtual pawsChatWindow::~pawsChatWindow | ( | ) | [virtual] |
void pawsChatWindow::AddAutoCompleteName | ( | const char * | name | ) |
void pawsChatWindow::AutoReply | ( | void | ) |
void pawsChatWindow::BadWordsFilter | ( | csString & | s | ) |
Remove bad words from the output string.
void pawsChatWindow::ChatOutput | ( | const char * | data, |
int | colour = -1 , |
||
int | type = CHAT_SYSTEM , |
||
bool | flashEnabled = true , |
||
bool | hasCharName = false , |
||
int | hotkeyChannel = 0 |
||
) |
Function that handles output of various tabbed windows.
void pawsChatWindow::Clear | ( | int | mode = -2 | ) |
Clear history.
void pawsChatWindow::CreateSettingNode | ( | iDocumentNode * | mNode, |
int | color, | ||
const char * | name | ||
) | [protected] |
void pawsChatWindow::DetermineChatTabAndSelect | ( | int | chattype | ) | [protected] |
void pawsChatWindow::FormatMessage | ( | csString & | sText, |
csString & | sPerson, | ||
csString | prependingText, | ||
csString & | buff, | ||
bool & | hasCharName | ||
) | [protected] |
Takes as input a message and formats it with colours, /me and /my support.
sText,: | The message main text. |
sPerson,: | The message sender. |
prependingText,: | the text which will be prepended before the message. This will get translated. |
buff,: | where the formatted message will be stored. |
hasCharName,: | Tells if the player character name is inside the message. |
csString pawsChatWindow::GetBracket | ( | int | type | ) |
Generates a bracket like [tell] starting from the msgtype.
char const* pawsChatWindow::GetFontName | ( | ) | [inline] |
return the name of the font
Definition at line 232 of file chatwindow.h.
pawsIgnoreWindow* pawsChatWindow::GetIgnoredList | ( | ) | [inline] |
Definition at line 206 of file chatwindow.h.
pawsEditTextBox* pawsChatWindow::getInputTextBox | ( | ) | [inline] |
Definition at line 222 of file chatwindow.h.
ChatSettings& pawsChatWindow::GetSettings | ( | ) | [inline] |
Definition at line 199 of file chatwindow.h.
const char* pawsChatWindow::HandleCommand | ( | const char * | cmd | ) | [virtual] |
For the iCommandSubscriber interface.
Implements psCmdBase.
void pawsChatWindow::HandleMessage | ( | MsgEntry * | message | ) | [virtual] |
For the iNetSubsciber interface.
Implements psCmdBase.
void pawsChatWindow::HandleSystemMessage | ( | MsgEntry * | message | ) | [protected] |
bool pawsChatWindow::InputActive | ( | ) |
Check to see if the text input box is active.
void pawsChatWindow::JoinChannel | ( | csString | name | ) |
Joins the channel and adds the hotkey when the server accepts the join.
bool pawsChatWindow::LeaveChannel | ( | int | hotkeyChannel | ) |
Leaves the channel and removes the hotkey association.
void pawsChatWindow::LoadChatSettings | ( | ) |
bool pawsChatWindow::LoadSetting | ( | ) |
load the settings stored by pawsConfigChatFont
void pawsChatWindow::LogMessage | ( | const char * | message, |
int | type = CHAT_SAY |
||
) | [protected] |
Logs a message coming from the chat.
It handles the book keeping of the log files, opens and closes them on need, Formats the log files by adding headings when opening a new one and adds brackets to them.
message | The message to log. |
type | The chat type of this message to log. |
mixes two colours and returns their mixed colour
virtual bool pawsChatWindow::OnButtonPressed | ( | int | button, |
int | keyModifier, | ||
pawsWidget * | widget | ||
) | [virtual] |
Called whenever a button is pressed.
button | The button pressed. |
keyModifier | Modifier key in effect. |
widget | The widget the button belongs to. |
Reimplemented from pawsWidget.
bool pawsChatWindow::OnChildMouseEnter | ( | pawsWidget * | child | ) | [virtual] |
Called when mouse enters a child widget.
If child wants to inform parent.
child | The child widget. |
Reimplemented from pawsWidget.
bool pawsChatWindow::OnChildMouseExit | ( | pawsWidget * | child | ) | [virtual] |
Called when a mouse exits a child widget.
If child wants to inform parent.
child | The child widget. |
Reimplemented from pawsWidget.
Handle double click events.
We handle double mouse click like mouse down events. As we don't need to handle them particularly and we don't want to pass events to the widgets.
button | The button being pressed. |
modifiers | The modifiers being actually held. |
x | The x position of the mouse. |
y | The y position of the mouse. |
Reimplemented from pawsWidget.
Definition at line 165 of file chatwindow.h.
bool pawsChatWindow::OnKeyDown | ( | utf32_char | keyCode, |
utf32_char | keyChar, | ||
int | modifiers | ||
) | [virtual] |
Process keydown messages.
keyCode | The code for the pressed key. |
keyChar | The key pressed. |
modifiers | Used to modify tab behavior. |
Reimplemented from pawsWidget.
virtual void pawsChatWindow::OnLostFocus | ( | ) | [virtual] |
Sets hasFocus false and notifys parent.
Reimplemented from pawsWidget.
bool pawsChatWindow::OnMenuAction | ( | pawsWidget * | widget, |
const pawsMenuAction & | action | ||
) | [virtual] |
Called whenever a menu action occurs.
widget | The widget acted upon. |
action | The action to take. |
Reimplemented from pawsWidget.
Manage mouse down event to test for and apply window changes.
button | Type of button: 1 resizable or movable, 2 context menu or config window. |
modifiers | Used with PAWS_CONSTRUCTION. |
x | Used to test for resize. |
y | Used to test for resize. |
Reimplemented from pawsWidget.
void pawsChatWindow::PerformAction | ( | const char * | action | ) | [virtual] |
Does an action based on this string.
action | The action to perform. |
Reimplemented from pawsWidget.
bool pawsChatWindow::PostSetup | ( | ) | [virtual] |
This is called after the widget and all of it's children have been created.
Reimplemented from pawsWidget.
void pawsChatWindow::RefreshCommandList | ( | ) |
void pawsChatWindow::ReloadChatWindow | ( | ) |
Reload Chat Window.
void pawsChatWindow::RemoveAutoCompleteName | ( | const char * | name | ) |
Replay recent message history on load.
reqLines | The amount of lines to load from the log starting from the bottom. |
void pawsChatWindow::SaveChatSettings | ( | ) |
void pawsChatWindow::SelectChatTab | ( | int | tab | ) |
void pawsChatWindow::SendChatLine | ( | csString & | inputText | ) | [protected] |
Sends the contents of the input text to the server.
void pawsChatWindow::SetAway | ( | const char * | text | ) |
Sets the away message.
void pawsChatWindow::SetChatWindowFont | ( | const char * | FontName, |
int | FontSize | ||
) |
change the font on only the windows that display the chat text
virtual void pawsChatWindow::Show | ( | void | ) | [virtual] |
When the window is opened let the controller window know about it.
Reimplemented from pawsControlledWindow.
void pawsChatWindow::SubscribeCommands | ( | ) | [protected] |
Subscribe the player commands.
void pawsChatWindow::SwitchChannel | ( | const csString & | name, |
pawsWidget * | widget = NULL |
||
) |
void pawsChatWindow::TabCompleteCommand | ( | const char * | cmd | ) | [protected] |
Tab completion.
void pawsChatWindow::TabCompleteName | ( | const char * | cmd | ) | [protected] |
void pawsChatWindow::writeChatHistory | ( | ) |
csArray<csArray<csString> *> pawsChatWindow::autoCompleteLists [protected] |
Contains pointers to all the autocompletion lists (excluding command lists)
Definition at line 284 of file chatwindow.h.
csArray<csString> pawsChatWindow::autoCompleteNames [protected] |
list of names to auto-complete
Definition at line 282 of file chatwindow.h.
csString pawsChatWindow::awayText [protected] |
Definition at line 279 of file chatwindow.h.
csHashReversible<uint32_t, csString> pawsChatWindow::channelIDs [protected] |
Subscribed channel name to server channel ID reversible mapping.
Definition at line 336 of file chatwindow.h.
csArray<uint16_t> pawsChatWindow::channels [protected] |
Hotkeys for server channel IDs.
Definition at line 338 of file chatwindow.h.
pawsChatHistory* pawsChatWindow::chatHistory [protected] |
Chat history.
Definition at line 304 of file chatwindow.h.
csArray<csString> pawsChatWindow::chatTriggers [protected] |
Definition at line 289 of file chatwindow.h.
csRedBlackTree<psString> pawsChatWindow::commandList [protected] |
list of last commands
Definition at line 287 of file chatwindow.h.
csString pawsChatWindow::currLine [protected] |
Current line, stored for when scrolling back in the chat history.
Definition at line 307 of file chatwindow.h.
bool pawsChatWindow::havePlayerName [protected] |
Decides if we have a player name.
Definition at line 297 of file chatwindow.h.
pawsIgnoreWindow* pawsChatWindow::IgnoredList [protected] |
Definition at line 275 of file chatwindow.h.
pawsEditTextBox* pawsChatWindow::inputText [protected] |
Input box for quick access.
Definition at line 292 of file chatwindow.h.
bool pawsChatWindow::isInChannel [protected] |
Is already in default channel?
Definition at line 318 of file chatwindow.h.
csRef<iFile> pawsChatWindow::logFile[CHAT_END] [protected] |
Stores the references to the actually used files for each chat type.
Definition at line 313 of file chatwindow.h.
csString pawsChatWindow::noCasePlayerForename [protected] |
Definition at line 301 of file chatwindow.h.
csString pawsChatWindow::noCasePlayerName [protected] |
Player name, with no upercase.
Definition at line 300 of file chatwindow.h.
csHash<csRef<iFile>, uint> pawsChatWindow::openLogFiles [protected] |
Stores a reference to all opened log files for easy search.
Definition at line 315 of file chatwindow.h.
int pawsChatWindow::replyCount [protected] |
Definition at line 277 of file chatwindow.h.
csString pawsChatWindow::replyList[4] [protected] |
Definition at line 276 of file chatwindow.h.
ChatSettings pawsChatWindow::settings [protected] |
Stores the settings for the chat.
Definition at line 310 of file chatwindow.h.
csArray<csString> pawsChatWindow::systemTriggers [protected] |
Definition at line 288 of file chatwindow.h.
pawsTabWindow* pawsChatWindow::tabs [protected] |
Definition at line 294 of file chatwindow.h.