diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/channelmanager.h | 2 | ||||
-rw-r--r-- | src/gui/chat.cpp | 20 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/channelmanager.h b/src/channelmanager.h index aeb66a9a..744e48cb 100644 --- a/src/channelmanager.h +++ b/src/channelmanager.h @@ -26,6 +26,7 @@ #include <string> class Channel; +class ChatWindow; class ChannelManager { @@ -40,6 +41,7 @@ public: void removeChannel(Channel *channel); private: + friend class ChatWindow; std::list<Channel*> mChannels; }; diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 491542a8..0e75bda3 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -22,6 +22,8 @@ #include "chat.h" #include "actorspritemanager.h" +#include "channel.h" +#include "channelmanager.h" #include "configuration.h" #include "localplayer.h" #include "party.h" @@ -31,6 +33,7 @@ #include "gui/setup.h" #include "gui/sdlinput.h" +#include "gui/widgets/channeltab.h" #include "gui/widgets/chattab.h" #include "gui/widgets/itemlinkhandler.h" #include "gui/widgets/scrollarea.h" @@ -399,7 +402,24 @@ void ChatWindow::event(Event::Channel channel, const Event &event) } else if (event.getType() == Event::Announcement) { + // Show on local tab localChatTab->chatLog(event.getString("message"), BY_GM); + // Spread over channels + for (std::list<Channel*>::iterator + it = channelManager->mChannels.begin(), + it_end = channelManager->mChannels.end(); + it != it_end; ++it) + { + if (*it) + (*it)->getTab()->chatLog(event.getString("message"), BY_GM); + } + // Spread over whispers + for (TabMap::const_iterator it = mWhispers.begin(), + it_end = mWhispers.end(); it != it_end; ++it) + { + if (it->second) + it->second->chatLog(event.getString("message"), BY_GM); + } } else if (event.getType() == Event::Being) { |