summaryrefslogtreecommitdiff
path: root/src/gui/chatwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-22 03:50:43 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-22 03:50:43 +0300
commit49ab517a6c51a14ab7ae72143f4364b1e1416a2f (patch)
tree5ba7d8a917ef0b3b232645646c7b951e2ada492b /src/gui/chatwindow.cpp
parent8021cb4011f2884d96d65b207f82757be7cf84a5 (diff)
downloadmanaverse-49ab517a6c51a14ab7ae72143f4364b1e1416a2f.tar.gz
manaverse-49ab517a6c51a14ab7ae72143f4364b1e1416a2f.tar.bz2
manaverse-49ab517a6c51a14ab7ae72143f4364b1e1416a2f.tar.xz
manaverse-49ab517a6c51a14ab7ae72143f4364b1e1416a2f.zip
Cache some settings om chat window.
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r--src/gui/chatwindow.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index a91a8fc82..191348897 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -163,7 +163,8 @@ ChatWindow::ChatWindow():
mChatHistoryIndex(0),
mGMLoaded(false),
mHaveMouse(false),
- mAutoHide(false)
+ mAutoHide(false),
+ mShowBattleEvents(false)
{
listen(CHANNEL_NOTICES);
listen(CHANNEL_ATTRIBUTES);
@@ -230,12 +231,15 @@ ChatWindow::ChatWindow():
parseHighlights();
config.addListener("autohideChat", this);
+ config.addListener("showBattleEvents", this);
+
mAutoHide = config.getBoolValue("autohideChat");
+ mShowBattleEvents = config.getBoolValue("showBattleEvents");
}
ChatWindow::~ChatWindow()
{
- config.removeListener("autohideChat", this);
+ config.removeListeners(this);
saveState();
config.setValue("ReturnToggles", mReturnToggles);
removeAllWhispers();
@@ -917,7 +921,7 @@ void ChatWindow::processEvent(Channels channel, const DepricatedEvent &event)
}
else if (channel == CHANNEL_ATTRIBUTES)
{
- if (!config.getBoolValue("showBattleEvents"))
+ if (!mShowBattleEvents)
return;
if (event.getName() == EVENT_UPDATEATTRIBUTE)
@@ -1651,6 +1655,8 @@ void ChatWindow::optionChanged(const std::string &name)
{
if (name == "autohideChat")
mAutoHide = config.getBoolValue("autohideChat");
+ else if (name == "showBattleEvents")
+ mShowBattleEvents = config.getBoolValue("showBattleEvents");
}
void ChatWindow::mouseMoved(gcn::MouseEvent &event)