diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-25 02:30:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-25 02:30:47 +0300 |
commit | c9795055ee1b6079ef9b0c0e3faf4bb79704bd98 (patch) | |
tree | 147357b76a80705cf0af7bc1ec69cf417ef94812 /src/gui/windows/killstats.cpp | |
parent | 1e5a50f6c67cd20967e139320a6c00f54e15dfe2 (diff) | |
download | plus-c9795055ee1b6079ef9b0c0e3faf4bb79704bd98.tar.gz plus-c9795055ee1b6079ef9b0c0e3faf4bb79704bd98.tar.bz2 plus-c9795055ee1b6079ef9b0c0e3faf4bb79704bd98.tar.xz plus-c9795055ee1b6079ef9b0c0e3faf4bb79704bd98.zip |
Add into player attributes prefix PLAYER_.
Diffstat (limited to 'src/gui/windows/killstats.cpp')
-rw-r--r-- | src/gui/windows/killstats.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/gui/windows/killstats.cpp b/src/gui/windows/killstats.cpp index 0be2044ae..c745bc151 100644 --- a/src/gui/windows/killstats.cpp +++ b/src/gui/windows/killstats.cpp @@ -111,8 +111,8 @@ KillStats::KillStats() : if (setupWindow) setupWindow->registerWindowForReset(this); - const int xp(PlayerInfo::getAttribute(Attributes::EXP)); - int xpNextLevel(PlayerInfo::getAttribute(Attributes::EXP_NEEDED)); + const int xp(PlayerInfo::getAttribute(Attributes::PLAYER_EXP)); + int xpNextLevel(PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED)); if (!xpNextLevel) xpNextLevel = 1; @@ -161,7 +161,7 @@ void KillStats::action(const ActionEvent &event) mKillCounter = 0; mExpCounter = 0; mLine3->setCaption(strprintf("1%% = %d exp, avg mob for 1%%: %s", - PlayerInfo::getAttribute(Attributes::EXP_NEEDED) / 100, "?")); + PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED) / 100, "?")); // TRANSLATORS: kill stats window label mLine4->setCaption(strprintf(_("Kills: %s, total exp: %s"), "?", "?")); // TRANSLATORS: kill stats window label @@ -200,7 +200,7 @@ void KillStats::resetTimes() void KillStats::gainXp(int xp) { - const int expNeed = PlayerInfo::getAttribute(Attributes::EXP_NEEDED); + const int expNeed = PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED); if (xp == expNeed) xp = 0; else if (!xp) @@ -229,7 +229,7 @@ void KillStats::gainXp(int xp) if (timeDiff <= 0.001) timeDiff = 1; - const int exp = PlayerInfo::getAttribute(Attributes::EXP); + const int exp = PlayerInfo::getAttribute(Attributes::PLAYER_EXP); // TRANSLATORS: kill stats window label mLine1->setCaption(strprintf(_("Level: %d at %f%%"), localPlayer->getLevel(), static_cast<double>(exp) @@ -292,7 +292,7 @@ void KillStats::recalcStats() // Need Update Exp Counter if (curTime - m1minExpTime > 60) { - const int newExp = PlayerInfo::getAttribute(Attributes::EXP); + const int newExp = PlayerInfo::getAttribute(Attributes::PLAYER_EXP); if (m1minExpTime != 0) m1minSpeed = newExp - m1minExpNum; else @@ -303,7 +303,7 @@ void KillStats::recalcStats() if (curTime != 0 && mLastHost == 0xFF6B66 && cur_time > 1) { - const int newExp = PlayerInfo::getAttribute(Attributes::EXP_NEEDED); + const int newExp = PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED); if (m1minExpTime != 0) m1minSpeed = newExp - m1minExpNum; mStatsReUpdated = true; @@ -312,7 +312,7 @@ void KillStats::recalcStats() if (curTime - m5minExpTime > 60*5) { - const int newExp = PlayerInfo::getAttribute(Attributes::EXP); + const int newExp = PlayerInfo::getAttribute(Attributes::PLAYER_EXP); if (m5minExpTime != 0) m5minSpeed = newExp - m5minExpNum; else @@ -323,7 +323,7 @@ void KillStats::recalcStats() if (curTime - m15minExpTime > 60*15) { - const int newExp = PlayerInfo::getAttribute(Attributes::EXP); + const int newExp = PlayerInfo::getAttribute(Attributes::PLAYER_EXP); if (m15minExpTime != 0) m15minSpeed = newExp - m15minExpNum; else @@ -346,8 +346,8 @@ void KillStats::update() // TRANSLATORS: kill stats window label mExpTime1Label->setCaption(strprintf(_(" Time for next level: %s"), toString(static_cast<float>((PlayerInfo::getAttribute( - Attributes::EXP_NEEDED) - PlayerInfo::getAttribute( - Attributes::EXP)) / static_cast<float>(m1minSpeed))).c_str())); + Attributes::PLAYER_EXP_NEEDED) - PlayerInfo::getAttribute( + Attributes::PLAYER_EXP)) / static_cast<float>(m1minSpeed))).c_str())); } else { @@ -366,8 +366,8 @@ void KillStats::update() // TRANSLATORS: kill stats window label mExpTime5Label->setCaption(strprintf(_(" Time for next level: %s"), toString(static_cast<float>((PlayerInfo::getAttribute( - Attributes::EXP_NEEDED) - PlayerInfo::getAttribute( - Attributes::EXP)) / m5minSpeed * 5)).c_str())); + Attributes::PLAYER_EXP_NEEDED) - PlayerInfo::getAttribute( + Attributes::PLAYER_EXP)) / m5minSpeed * 5)).c_str())); } else { @@ -388,8 +388,8 @@ void KillStats::update() // TRANSLATORS: kill stats window label mExpTime15Label->setCaption(strprintf(_(" Time for next level: %s"), toString(static_cast<float>((PlayerInfo::getAttribute( - Attributes::EXP_NEEDED) - PlayerInfo::getAttribute( - Attributes::EXP)) / m15minSpeed * 15)).c_str())); + Attributes::PLAYER_EXP_NEEDED) - PlayerInfo::getAttribute( + Attributes::PLAYER_EXP)) / m15minSpeed * 15)).c_str())); } else { @@ -409,17 +409,18 @@ void KillStats::attributeChanged(const AttributesT id, PRAGMA45(GCC diagnostic ignored "-Wswitch-enum") switch (id) { - case Attributes::EXP: - case Attributes::EXP_NEEDED: + case Attributes::PLAYER_EXP: + case Attributes::PLAYER_EXP_NEEDED: gainXp(newVal - oldVal); break; - case Attributes::LEVEL: + case Attributes::PLAYER_LEVEL: mKillCounter = 0; mKillTCounter = 0; mExpCounter = 0; mExpTCounter = 0; mLine3->setCaption(strprintf("1%% = %d exp, avg mob for 1%%: %s", - PlayerInfo::getAttribute(Attributes::EXP_NEEDED) / 100, "?")); + PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED) / 100, + "?")); mLine4->setCaption(strprintf( // TRANSLATORS: kill stats window label _("Kills: %s, total exp: %s"), "?", "?")); |