--- a/QTfrontend/statsPage.cpp Sun Nov 07 19:49:39 2010 +0300
+++ b/QTfrontend/statsPage.cpp Sun Nov 07 19:59:34 2010 +0300
@@ -177,57 +177,51 @@
team.Wins++; // should draws count as wins?
//team.SaveToFile(); // don't save yet
}
- break;
- }
-
+ break;
+ }
+
case 'P' : {
int i = info.indexOf(' ');
- playerPosition++;
- QString color = info.left(i);
- quint32 c = color.toInt();
- QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255));
+ playerPosition++;
+ QString color = info.left(i);
+ quint32 c = color.toInt();
+ QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255));
- QString playerinfo = info.mid(i + 1);
-
- i = playerinfo.indexOf(' ');
+ QString playerinfo = info.mid(i + 1);
+
+ i = playerinfo.indexOf(' ');
- QString kills = playerinfo.left(i);
- QString playername = playerinfo.mid(i + 1);
- QString image;
+ int kills = playerinfo.left(i).toInt();
+ QString playername = playerinfo.mid(i + 1);
+ QString image;
if (lastColor == c && playerPosition <= 2) playerPosition = 1;
- lastColor = c;
+ lastColor = c;
- switch (playerPosition)
- {
- case 1:
- image = "<img src=\":/res/StatsMedal1.png\">";
- break;
- case 2:
- image = "<img src=\":/res/StatsMedal2.png\">";
- break;
- case 3:
- image = "<img src=\":/res/StatsMedal3.png\">";
- break;
- default:
- image = "<img src=\":/res/StatsMedal4.png\">";
- break;
- }
+ switch (playerPosition)
+ {
+ case 1:
+ image = "<img src=\":/res/StatsMedal1.png\">";
+ break;
+ case 2:
+ image = "<img src=\":/res/StatsMedal2.png\">";
+ break;
+ case 3:
+ image = "<img src=\":/res/StatsMedal3.png\">";
+ break;
+ default:
+ image = "<img src=\":/res/StatsMedal4.png\">";
+ break;
+ }
QString message;
- QString killstring;
- if (kills.toInt() == 1)
- {
- killstring = PageGameStats::tr("(%1 kill)").arg(kills);
- } else {
- killstring = PageGameStats::tr("(%1 kills)").arg(kills);
- }
-
- message = QString("<p><h2>%1 %2. <font color=\"%4\">%3</font> ").arg(image, QString::number(playerPosition), playername, clanColor.name()) + killstring + "</h2></p>";
-
- labelGameRank->setText(labelGameRank->text() + message);
- break;
- }
+ QString killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills);
+
+ message = QString("<p><h2>%1 %2. <font color=\"%4\">%3</font> ").arg(image, QString::number(playerPosition), playername, clanColor.name()) + killstring + "</h2></p>";
+
+ labelGameRank->setText(labelGameRank->text() + message);
+ break;
+ }
case 's' : {
int i = info.indexOf(' ');
QString message = "<p><img src=\":/res/StatsMostSelfDamage.png\"> " + PageGameStats::tr("<b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.").arg(info.mid(i + 1), info.left(i)) + "</p>";