diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-05-30 20:34:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-05-30 20:34:35 +0300 |
commit | 9179ef5f16fe760fbe7a0d768380666332ff7982 (patch) | |
tree | 762b6222c747b154c3c37eb76d4fde8f3dc8a253 /src | |
parent | a7db0a290270d7cdd5ee57477f49a9a210bcf92d (diff) | |
download | manaverse-9179ef5f16fe760fbe7a0d768380666332ff7982.tar.gz manaverse-9179ef5f16fe760fbe7a0d768380666332ff7982.tar.bz2 manaverse-9179ef5f16fe760fbe7a0d768380666332ff7982.tar.xz manaverse-9179ef5f16fe760fbe7a0d768380666332ff7982.zip |
Reset kill counters on levelup.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/killstats.cpp | 51 | ||||
-rw-r--r-- | src/gui/killstats.h | 2 |
2 files changed, 35 insertions, 18 deletions
diff --git a/src/gui/killstats.cpp b/src/gui/killstats.cpp index faf25f27f..f46d17bdf 100644 --- a/src/gui/killstats.cpp +++ b/src/gui/killstats.cpp @@ -144,15 +144,7 @@ void KillStats::action(const gcn::ActionEvent &event) mLine6->setCaption(strprintf( _("No. of avg mob to next level: %s"), "?")); - m1minExpTime = 0; - m1minExpNum = 0; - m1minSpeed = 0; - m5minExpTime = 0; - m5minExpNum = 0; - m5minSpeed = 0; - m15minExpTime = 0; - m15minExpNum = 0; - m15minSpeed = 0; + resetTimes(); } else if (event.getId() == "timer") { @@ -162,18 +154,23 @@ void KillStats::action(const gcn::ActionEvent &event) mLine7->setCaption(strprintf( _("Kills/Min: %s, Exp/Min: %s"), "?", "?")); - m1minExpTime = 0; - m1minExpNum = 0; - m1minSpeed = 0; - m5minExpTime = 0; - m5minExpNum = 0; - m5minSpeed = 0; - m15minExpTime = 0; - m15minExpNum = 0; - m15minSpeed = 0; + resetTimes(); } } +void KillStats::resetTimes() +{ + m1minExpTime = 0; + m1minExpNum = 0; + m1minSpeed = 0; + m5minExpTime = 0; + m5minExpNum = 0; + m5minSpeed = 0; + m15minExpTime = 0; + m15minExpNum = 0; + m15minSpeed = 0; +} + void KillStats::gainXp(int xp) { if (xp == PlayerInfo::getAttribute(EXP_NEEDED)) @@ -451,5 +448,23 @@ void KillStats::processEvent(Channels channel A_UNUSED, gainXp(event.getInt("newValue") - event.getInt("oldValue")); // update(); } + else if (id == LEVEL) + { + mKillCounter = 0; + mKillTCounter = 0; + mExpCounter = 0; + mExpTCounter = 0; + mLine3->setCaption(strprintf("1%% = %d exp, avg mob for 1%%: %s", + PlayerInfo::getAttribute(EXP_NEEDED) / 100, "?")); + mLine4->setCaption(strprintf(_( + "Kills: %s, total exp: %s"), "?", "?")); + mLine5->setCaption(strprintf(_("Avg Exp: %s"), "?")); + mLine6->setCaption(strprintf( + _("No. of avg mob to next level: %s"), "?")); + mLine7->setCaption(strprintf( + _("Kills/Min: %s, Exp/Min: %s"), "?", "?")); + + resetTimes(); + } } } diff --git a/src/gui/killstats.h b/src/gui/killstats.h index af4891afe..64aef4585 100644 --- a/src/gui/killstats.h +++ b/src/gui/killstats.h @@ -85,6 +85,8 @@ class KillStats : public Window, gcn::ActionListener, public Listener void processEvent(Channels channel A_UNUSED, const DepricatedEvent &event); + void resetTimes(); + private: void validateJacko(); |