summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/chatwindow.cpp12
-rw-r--r--src/gui/chatwindow.h1
2 files changed, 10 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)
diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h
index 05882aa69..336f0cb72 100644
--- a/src/gui/chatwindow.h
+++ b/src/gui/chatwindow.h
@@ -352,6 +352,7 @@ class ChatWindow : public Window,
bool mGMLoaded;
bool mHaveMouse;
bool mAutoHide;
+ bool mShowBattleEvents;
};
extern ChatWindow *chatWindow;