diff options
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r-- | src/gui/chat.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 00787182..ba912276 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -77,6 +77,7 @@ ChatWindow::ChatWindow(): Window(_("Chat")), mTmpVisible(false) { + listen("Chat"); listen("Notices"); setWindowName("Chat"); @@ -417,6 +418,30 @@ void ChatWindow::event(const std::string &channel, const Mana::Event &event) if (event.getName() == "ServerNotice") localChatTab->chatLog(event.getString("message"), BY_SERVER); } + else if (channel == "Chat") + { + if (event.getName() == "Whisper") + { + whisper(event.getString("nick"), event.getString("message")); + } + else if (event.getName() == "WhisperError") + { + whisper(event.getString("nick"), + event.getString("error"), BY_SERVER); + } + else if (event.getName() == "Player") + { + localChatTab->chatLog(event.getString("message"), BY_PLAYER); + } + else if (event.getName() == "Announcement") + { + localChatTab->chatLog(event.getString("message"), BY_GM); + } + else if (event.getName() == "Being") + { + localChatTab->chatLog(event.getString("message"), BY_OTHER); + } + } } void ChatWindow::addInputText(const std::string &text) |