summaryrefslogtreecommitdiff
path: root/src/gui/windows/chatwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows/chatwindow.cpp')
-rw-r--r--src/gui/windows/chatwindow.cpp45
1 files changed, 15 insertions, 30 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index dbda471c4..5b1eba199 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -185,8 +185,6 @@ ChatWindow::ChatWindow():
{
mChatTabs->postInit();
- listen(CHANNEL_ATTRIBUTES);
-
setWindowName("Chat");
if (setupWindow)
@@ -957,38 +955,25 @@ void ChatWindow::keyPressed(KeyEvent &event)
#undef ifKey
-void ChatWindow::processEvent(const Channels channel,
- const DepricatedEvent &event)
+void ChatWindow::statChanged(const int id,
+ const int oldVal1,
+ const int oldVal2)
{
- if (channel == CHANNEL_ATTRIBUTES)
- {
- if (!mShowBattleEvents)
- return;
+ if (!mShowBattleEvents || !config.getBoolValue("showJobExp"))
+ return;
- if (event.getName() == EVENT_UPDATESTAT)
- {
- if (!config.getBoolValue("showJobExp"))
- return;
+ if (id != Net::getPlayerHandler()->getJobLocation())
+ return;
- const int id = event.getInt("id");
- if (id == Net::getPlayerHandler()->getJobLocation())
- {
- const std::pair<int, int> exp
- = PlayerInfo::getStatExperience(id);
- if (event.getInt("oldValue1") > exp.first
- || !event.getInt("oldValue2"))
- {
- return;
- }
+ const std::pair<int, int> exp = PlayerInfo::getStatExperience(id);
+ if (oldVal1 > exp.first || !oldVal2)
+ return;
- const int change = exp.first - event.getInt("oldValue1");
- if (change != 0)
- {
- battleChatLog(std::string("+").append(
- toString(change)).append(" job"));
- }
- }
- }
+ const int change = exp.first - oldVal1;
+ if (change != 0)
+ {
+ battleChatLog(std::string("+").append(toString(
+ change)).append(" job"));
}
}