summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-08-02 00:50:35 -0400
committerChuck Miller <shadowmil@gmail.com>2010-08-02 01:18:33 -0400
commit6a0e5f20c9faf7623a465daa4a8b350d3a52e5e6 (patch)
tree0411f3e481165896c946d5bb5b4542776c8dbefb /src/gui/chat.cpp
parent9eb236c4dc25e818ee007aa2c9cb36a23111d8d9 (diff)
downloadmana-client-6a0e5f20c9faf7623a465daa4a8b350d3a52e5e6.tar.gz
mana-client-6a0e5f20c9faf7623a465daa4a8b350d3a52e5e6.tar.bz2
mana-client-6a0e5f20c9faf7623a465daa4a8b350d3a52e5e6.tar.xz
mana-client-6a0e5f20c9faf7623a465daa4a8b350d3a52e5e6.zip
Convert most of the remaining chat system to use the event system
Reviewed-by: Jared Adams
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp25
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)