From 8087ebe5757032fc9a8fa0a6175e7f6802dc120a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 27 Jan 2011 17:19:25 +0200 Subject: Show job exp in battle tab. --- src/gui/chat.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') 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 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"); + } + } } } -- cgit v1.2.3-60-g2f50