--- a/QTfrontend/ui/page/pagegamestats.cpp Mon Jan 30 23:20:28 2012 +0100
+++ b/QTfrontend/ui/page/pagegamestats.cpp Mon Jan 30 17:32:18 2012 -0500
@@ -62,7 +62,7 @@
gbl->addWidget(labelGameStats);
gb->setLayout(gbl);
pageLayout->addWidget(gb, 1, 1, 1, 2);
-
+
// graph
graphic = new FitGraphicsView(gb);
l = new QLabel(this);
@@ -73,7 +73,7 @@
gbl->addWidget(graphic);
graphic->scale(1.0, -1.0);
graphic->setBackgroundBrush(QBrush(Qt::black));
-
+
labelGameWin = new QLabel(this);
labelGameWin->setTextFormat(Qt::RichText);
pageLayout->addWidget(labelGameWin, 0, 0, 1, 2);
@@ -160,38 +160,45 @@
void PageGameStats::GameStats(char type, const QString & info)
{
- switch(type) {
- case 'r' : {
+ switch(type)
+ {
+ case 'r' :
+ {
labelGameWin->setText(QString("<h1 align=\"center\">%1</h1>").arg(info));
break;
}
- case 'D' : {
+ case 'D' :
+ {
int i = info.indexOf(' ');
QString message = "<p><img src=\":/res/StatsBestShot.png\"> " + PageGameStats::tr("The best shot award was won by <b>%1</b> with <b>%2</b> pts.").arg(info.mid(i + 1), info.left(i)) + "</p>";
AddStatText(message);
break;
}
- case 'k' : {
+ case 'k' :
+ {
int i = info.indexOf(' ');
int num = info.left(i).toInt();
QString message = "<p><img src=\":/res/StatsBestKiller.png\"> " + PageGameStats::tr("The best killer is <b>%1</b> with <b>%2</b> kills in a turn.", "", num).arg(info.mid(i + 1), info.left(i)) + "</p>";
AddStatText(message);
break;
}
- case 'K' : {
+ case 'K' :
+ {
int num = info.toInt();
QString message = "<p><img src=\":/res/StatsHedgehogsKilled.png\"> " + PageGameStats::tr("A total of <b>%1</b> hedgehog(s) were killed during this round.", "", num).arg(num) + "</p>";
AddStatText(message);
break;
}
- case 'H' : {
+ case 'H' :
+ {
int i = info.indexOf(' ');
quint32 clan = info.left(i).toInt();
quint32 hp = info.mid(i + 1).toUInt();
healthPoints[clan].append(hp);
break;
}
- case 'T': { // local team stats
+ case 'T': // local team stats
+ {
//AddStatText("<p>local team: " + info + "</p>");
QStringList infol = info.split(":");
HWTeam team(infol[0]);
@@ -204,9 +211,10 @@
//team.SaveToFile(); // don't save yet
}
break;
- }
+ }
- case 'P' : {
+ case 'P' :
+ {
int i = info.indexOf(' ');
playerPosition++;
QString color = info.left(i);
@@ -227,17 +235,17 @@
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;
+ 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;
@@ -246,23 +254,26 @@
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;
+ break;
}
- case 's' : {
+ case 's' :
+ {
int i = info.indexOf(' ');
int num = info.left(i).toInt();
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.", "", num).arg(info.mid(i + 1)).arg(num) + "</p>";
AddStatText(message);
break;
}
- case 'S' : {
+ case 'S' :
+ {
int i = info.indexOf(' ');
int num = info.left(i).toInt();
QString message = "<p><img src=\":/res/StatsSelfKilled.png\"> " + PageGameStats::tr("<b>%1</b> killed <b>%2</b> of his own hedgehogs.", "", num).arg(info.mid(i + 1)).arg(num) + "</p>";
AddStatText(message);
break;
}
- case 'B' : {
+ case 'B' :
+ {
int i = info.indexOf(' ');
int num = info.left(i).toInt();
QString message = "<p><img src=\":/res/StatsSkipped.png\"> " + PageGameStats::tr("<b>%1</b> was scared and skipped turn <b>%2</b> times.", "", num).arg(info.mid(i + 1)).arg(num) + "</p>";