created a new sendstat type for changing the kills label
authorPeriklis Ntanasis <pntanasis@gmail.com>
Mon, 10 Jun 2013 15:18:03 +0300
changeset 9178 c0902317c823
parent 9177 d5e98b81e135
child 9179 7ce9f68d28dc
created a new sendstat type for changing the kills label
QTfrontend/ui/page/pagegamestats.cpp
QTfrontend/ui/page/pagegamestats.h
hedgewars/uIO.pas
hedgewars/uTypes.pas
--- a/QTfrontend/ui/page/pagegamestats.cpp	Sun Jun 09 01:18:58 2013 +0300
+++ b/QTfrontend/ui/page/pagegamestats.cpp	Mon Jun 10 15:18:03 2013 +0300
@@ -40,6 +40,7 @@
 
 QLayout * PageGameStats::bodyLayoutDefinition()
 {
+	kindOfPoints = QString("");
 	defaultGraphTitle = true;	
     QGridLayout * pageLayout = new QGridLayout();
     pageLayout->setSpacing(20);
@@ -256,7 +257,11 @@
             }
             break;
         }
-
+		case 'p' :
+        {
+            kindOfPoints = info;
+            break;
+        }
         case 'P' :
         {
             int i = info.indexOf(' ');
@@ -293,7 +298,13 @@
             }
 
             QString message;
-            QString killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills);
+            QString killstring;
+            if(kindOfPoints.compare("") == 0) {
+				killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills);
+			} else {
+				killstring = PageGameStats::tr("(%1 %2)", "", kills).arg(kills).arg(kindOfPoints);
+				kindOfPoints = QString("");
+			}
 
             message = QString("<p><h2>%1 %2. <font color=\"%4\">%3</font> ").arg(image, QString::number(playerPosition), playername, clanColor.name()) + killstring + "</h2></p>";
 
--- a/QTfrontend/ui/page/pagegamestats.h	Sun Jun 09 01:18:58 2013 +0300
+++ b/QTfrontend/ui/page/pagegamestats.h	Mon Jun 10 15:18:03 2013 +0300
@@ -50,6 +50,7 @@
         QLabel *labelGameWin;
         QLabel *labelGameRank;
         QLabel *labelGraphTitle;
+        QString kindOfPoints;
         FitGraphicsView * graphic;
 
     public slots:
--- a/hedgewars/uIO.pas	Sun Jun 09 01:18:58 2013 +0300
+++ b/hedgewars/uIO.pas	Mon Jun 10 15:18:03 2013 +0300
@@ -212,7 +212,7 @@
 end;
 
 procedure SendStat(sit: TStatInfoType; s: shortstring);
-const stc: array [TStatInfoType] of char = ('r', 'D', 'k', 'K', 'H', 'T', 'P', 's', 'S', 'B', 'c', 'g');
+const stc: array [TStatInfoType] of char = ('r', 'D', 'k', 'K', 'H', 'T', 'P', 's', 'S', 'B', 'c', 'g', 'p');
 var buf: shortstring;
 begin
 buf:= 'i' + stc[sit] + s;
--- a/hedgewars/uTypes.pas	Sun Jun 09 01:18:58 2013 +0300
+++ b/hedgewars/uTypes.pas	Mon Jun 10 15:18:03 2013 +0300
@@ -164,7 +164,8 @@
 
     TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs,
             siClanHealth, siTeamStats, siPlayerKills, siMaxTeamDamage,
-            siMaxTeamKills, siMaxTurnSkips, siCustomAchievement, siGraphTitle);
+            siMaxTeamKills, siMaxTurnSkips, siCustomAchievement, siGraphTitle,
+            siPointType);
 
     // Various "emote" animations a hedgehog can do
     TWave = (waveRollup, waveSad, waveWave, waveHurrah, waveLemonade, waveShrug, waveJuggle);