summaryrefslogtreecommitdiff
path: root/src/gui/windows/chatwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-27 22:35:38 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-27 22:35:38 +0300
commit9429dc4f5b5b6102a8b575de25ce5d8e7170551f (patch)
treed4603ddbea06f75e8637a1ff94da4432d7b96951 /src/gui/windows/chatwindow.cpp
parent64d30eda264c342aced8d791b47a35def0e4d15c (diff)
downloadmanaverse-9429dc4f5b5b6102a8b575de25ce5d8e7170551f.tar.gz
manaverse-9429dc4f5b5b6102a8b575de25ce5d8e7170551f.tar.bz2
manaverse-9429dc4f5b5b6102a8b575de25ce5d8e7170551f.tar.xz
manaverse-9429dc4f5b5b6102a8b575de25ce5d8e7170551f.zip
Change player job level, exp from stat object to attribute.
Diffstat (limited to 'src/gui/windows/chatwindow.cpp')
-rw-r--r--src/gui/windows/chatwindow.cpp42
1 files changed, 19 insertions, 23 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index a3bb4829b..aa899202d 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -999,29 +999,6 @@ bool ChatWindow::addCurrentToHistory()
return true;
}
-void ChatWindow::statChanged(const AttributesT id,
- const int oldVal1,
- const int oldVal2)
-{
- if (!mShowBattleEvents || !config.getBoolValue("showJobExp"))
- return;
-
- if (id != Attributes::PLAYER_JOB)
- return;
-
- const std::pair<int, int> exp = PlayerInfo::getStatExperience(id);
- if (oldVal1 > exp.first || (oldVal2 == 0))
- return;
-
- const int change = exp.first - oldVal1;
- if (change != 0)
- {
- battleChatLog(std::string("+").append(toString(
- change)).append(" job"),
- ChatMsgType::BY_SERVER);
- }
-}
-
void ChatWindow::attributeChanged(const AttributesT id,
const int64_t oldVal,
const int64_t newVal)
@@ -1051,6 +1028,25 @@ void ChatWindow::attributeChanged(const AttributesT id,
newVal))),
ChatMsgType::BY_SERVER);
break;
+ case Attributes::PLAYER_JOB_EXP:
+ {
+ if (!config.getBoolValue("showJobExp"))
+ return;
+ if (oldVal > newVal ||
+ PlayerInfo::getAttribute(
+ Attributes::PLAYER_JOB_EXP_NEEDED) == 0)
+ {
+ return;
+ }
+ const int64_t change = newVal - oldVal;
+ if (change != 0)
+ {
+ battleChatLog(std::string("+").append(toString(CAST_U64(
+ change))).append(" job"),
+ ChatMsgType::BY_SERVER);
+ }
+ break;
+ }
default:
break;
};