summaryrefslogtreecommitdiff
path: root/src/gui/killstats.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-08 00:56:59 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-08 00:56:59 +0300
commitefa3bc8c346aea723b8b02ea1f27d7d3e41ff134 (patch)
tree529188612c01c1fc87cf6db784d37aa973bb077f /src/gui/killstats.cpp
parent84eb733618a5a0f62d8004c09bb652b15c122357 (diff)
downloadmv-efa3bc8c346aea723b8b02ea1f27d7d3e41ff134.tar.gz
mv-efa3bc8c346aea723b8b02ea1f27d7d3e41ff134.tar.bz2
mv-efa3bc8c346aea723b8b02ea1f27d7d3e41ff134.tar.xz
mv-efa3bc8c346aea723b8b02ea1f27d7d3e41ff134.zip
Improve perfomance in kills window.
Diffstat (limited to 'src/gui/killstats.cpp')
-rw-r--r--src/gui/killstats.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/killstats.cpp b/src/gui/killstats.cpp
index d45e6a4bb..c1a858a79 100644
--- a/src/gui/killstats.cpp
+++ b/src/gui/killstats.cpp
@@ -88,7 +88,8 @@ KillStats::KillStats():
mJackoId(0),
mIsJackoAlive(false),
mIsJackoMustSpawn(true),
- mIsJackoSpawnTimeUnknown(true)
+ mIsJackoSpawnTimeUnknown(true),
+ mUpdateTime(cur_time + 1)
{
setWindowName("Kill stats");
setCloseButton(true);
@@ -302,6 +303,13 @@ void KillStats::recalcStats()
void KillStats::update()
{
BLOCK_START("KillStats::update")
+
+ const int time = cur_time;
+ if (mUpdateTime > time)
+ return;
+
+ mUpdateTime = time + 1;
+
mExpSpeed1Label->setCaption(strprintf(ngettext("Exp speed per %d min: %s",
"Exp speed per %d min: %s", 1), 1, toString(m1minSpeed).c_str()));