summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-27 17:19:25 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-27 17:19:25 +0200
commit8087ebe5757032fc9a8fa0a6175e7f6802dc120a (patch)
treea5b6a2c37f6ab4ff354461ddaea59c1d104a32ef /src
parent7262e6bc785c88b4c0858d6d53deac9e45f9d68e (diff)
downloadmanaplus-8087ebe5757032fc9a8fa0a6175e7f6802dc120a.tar.gz
manaplus-8087ebe5757032fc9a8fa0a6175e7f6802dc120a.tar.bz2
manaplus-8087ebe5757032fc9a8fa0a6175e7f6802dc120a.tar.xz
manaplus-8087ebe5757032fc9a8fa0a6175e7f6802dc120a.zip
Show job exp in battle tab.
Diffstat (limited to 'src')
-rw-r--r--src/gui/chat.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 0422570d7..26b9a1c64 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -50,6 +50,7 @@
#include "gui/widgets/whispertab.h"
#include "net/chathandler.h"
+#include "net/playerhandler.h"
#include "net/net.h"
#include "utils/dtor.h"
@@ -803,6 +804,27 @@ void ChatWindow::event(Channels channel, const Mana::Event &event)
break;
};
}
+ else if (event.getName() == EVENT_UPDATESTAT)
+ {
+ if (!config.getBoolValue("showJobExp"))
+ return;
+
+ int id = event.getInt("id");
+ if (id == Net::getPlayerHandler()->getJobLocation())
+ {
+ std::pair<int, int> exp
+ = PlayerInfo::getStatExperience(id);
+ if (event.getInt("oldValue1") > exp.first
+ || !event.getInt("oldValue2"))
+ {
+ return;
+ }
+
+ int change = exp.first - event.getInt("oldValue1");
+ if (change != 0)
+ battleChatLog("+" + toString(change) + " job");
+ }
+ }
}
}