From c9795055ee1b6079ef9b0c0e3faf4bb79704bd98 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Jul 2016 02:30:47 +0300 Subject: Add into player attributes prefix PLAYER_. --- src/gui/windows/killstats.cpp | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'src/gui/windows/killstats.cpp') 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(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((PlayerInfo::getAttribute( - Attributes::EXP_NEEDED) - PlayerInfo::getAttribute( - Attributes::EXP)) / static_cast(m1minSpeed))).c_str())); + Attributes::PLAYER_EXP_NEEDED) - PlayerInfo::getAttribute( + Attributes::PLAYER_EXP)) / static_cast(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((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((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"), "?", "?")); -- cgit v1.2.3-70-g09d2