QTfrontend/hwform.cpp
changeset 307 96b428ac11f2
parent 306 7b61834edcf6
child 311 b8905423f19f
equal deleted inserted replaced
306:7b61834edcf6 307:96b428ac11f2
   288 }
   288 }
   289 
   289 
   290 void HWForm::GameStateChanged(GameState gameState)
   290 void HWForm::GameStateChanged(GameState gameState)
   291 {
   291 {
   292 	if (gameState == gsStarted)
   292 	if (gameState == gsStarted)
       
   293 	{
   293 		GoToPage(ID_PAGE_GAMESTATS);
   294 		GoToPage(ID_PAGE_GAMESTATS);
       
   295 		ui.pageGameStats->labelGameStats->setText("");
       
   296 	}
       
   297 }
       
   298 
       
   299 void HWForm::AddStatText(const QString & msg)
       
   300 {
       
   301 	ui.pageGameStats->labelGameStats->setText(
       
   302 		ui.pageGameStats->labelGameStats->text() + msg);
   294 }
   303 }
   295 
   304 
   296 void HWForm::GameStats(char type, const QString & info)
   305 void HWForm::GameStats(char type, const QString & info)
   297 {
   306 {
   298 	switch(type) {
   307 	switch(type) {
   299 		case 'r' : { ui.pageGameStats->labelGameResult->setText(info); break; }
   308 		case 'r' : {
       
   309 			AddStatText(QString("<h1 align=\"center\">%1</h1>").arg(info));
       
   310 			break;
       
   311 		}
       
   312 		case 'D' : {
       
   313 			int i = info.indexOf(' ');
       
   314 			QString message = QLabel::tr("<p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p>")
       
   315 					.arg(info.mid(i + 1), info.left(i));
       
   316 			AddStatText(message);
       
   317 			break;
       
   318 		}
       
   319 		case 'K' : {
       
   320 			QString message = QLabel::tr("<p>A total of <b>%1</b> Hedgehog(s) were killed during this round.</p>").arg(info);
       
   321 			AddStatText(message);
       
   322 			break;
       
   323 		}
   300 	}
   324 	}
   301 }
   325 }
   302 
   326 
   303 void HWForm::CreateGame(GameCFGWidget * gamecfg)
   327 void HWForm::CreateGame(GameCFGWidget * gamecfg)
   304 {
   328 {