QTfrontend/ui/page/pagegamestats.cpp
changeset 13757 f0cb47f0bfaf
parent 13708 3264a26bbf8b
child 13768 c084bd440009
equal deleted inserted replaced
13756:a0d6404a80a2 13757:f0cb47f0bfaf
   150     labelGameStats->setText("");
   150     labelGameStats->setText("");
   151     healthPoints.clear();
   151     healthPoints.clear();
   152     labelGameRank->setText("");
   152     labelGameRank->setText("");
   153     labelGameWin->setText("");
   153     labelGameWin->setText("");
   154     playerPosition = 0;
   154     playerPosition = 0;
       
   155     scriptPlayerPosition = 0;
   155     lastColor = 0;
   156     lastColor = 0;
   156 }
   157 }
   157 
   158 
   158 void PageGameStats::restartBtnVisible(bool visible)
   159 void PageGameStats::restartBtnVisible(bool visible)
   159 {
   160 {
   324             QString image;
   325             QString image;
   325 
   326 
   326             if (lastColor == c) playerPosition--;
   327             if (lastColor == c) playerPosition--;
   327             lastColor = c;
   328             lastColor = c;
   328 
   329 
   329             switch (playerPosition)
   330             unsigned int realPlayerPosition;
       
   331             if(scriptPlayerPosition == 0)
       
   332                 realPlayerPosition = playerPosition;
       
   333             else
       
   334                 realPlayerPosition = scriptPlayerPosition;
       
   335 
       
   336             switch (realPlayerPosition)
   330             {
   337             {
   331                 case 1:
   338                 case 1:
   332                     image = "<img src=\":/res/StatsMedal1.png\">";
   339                     image = "<img src=\":/res/StatsMedal1.png\">";
   333                     break;
   340                     break;
   334                 case 2:
   341                 case 2:
   351                 //: For custom number of points in the stats screen, written after the team name. %1 is the number, %2 is the word. Example: “4 points”
   358                 //: For custom number of points in the stats screen, written after the team name. %1 is the number, %2 is the word. Example: “4 points”
   352                 killstring = PageGameStats::tr("(%1 %2)", "", kills).arg(kills).arg(kindOfPoints);
   359                 killstring = PageGameStats::tr("(%1 %2)", "", kills).arg(kills).arg(kindOfPoints);
   353                 kindOfPoints = QString("");
   360                 kindOfPoints = QString("");
   354             }
   361             }
   355 
   362 
   356             message = QString("<p><h2>%1 %2. <font color=\"%4\">%3</font> ").arg(image, QString::number(playerPosition), playername, clanColor.name()) + killstring + "</h2></p>";
   363             message = QString("<p><h2>%1 %2. <font color=\"%4\">%3</font> ").arg(image, QString::number(realPlayerPosition), playername, clanColor.name()) + killstring + "</h2></p>";
   357 
   364 
   358             labelGameRank->setText(labelGameRank->text() + message);
   365             labelGameRank->setText(labelGameRank->text() + message);
       
   366             scriptPlayerPosition = 0;
   359             break;
   367             break;
   360         }
   368         }
   361         case 's' :
   369         case 's' :
   362         {
   370         {
   363             int i = info.indexOf(' ');
   371             int i = info.indexOf(' ');
   386         {
   394         {
   387             QString message = "<p><img src=\":/res/StatsCustomAchievement.png\"> "+info+" </p>";
   395             QString message = "<p><img src=\":/res/StatsCustomAchievement.png\"> "+info+" </p>";
   388             AddStatText(message);
   396             AddStatText(message);
   389             break;
   397             break;
   390         }
   398         }
   391 
   399         case 'R' :
       
   400         {
       
   401             scriptPlayerPosition = info.toInt();
       
   402             break;
       
   403         }
   392     }
   404     }
   393 }
   405 }