diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-01-06 05:37:16 +0800 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-01-06 21:41:32 +0800 |
commit | 7a9c5623cc4d69616321c87a7eeb0876694acafe (patch) | |
tree | 44d813d591f4e7c7b5a0006717a778a2ce2c8bb5 | |
parent | 440e43491c5abcfcd7bf502d68d4e0d83eb6790b (diff) | |
download | mana-7a9c5623cc4d69616321c87a7eeb0876694acafe.tar.gz mana-7a9c5623cc4d69616321c87a7eeb0876694acafe.tar.bz2 mana-7a9c5623cc4d69616321c87a7eeb0876694acafe.tar.xz mana-7a9c5623cc4d69616321c87a7eeb0876694acafe.zip |
Made announcements spreading over all whispers and channels
Resolves: Mana-mantis #430.
Reviewed-by: Bertram.
-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) { |