Include Badguys Killed stat in level endsequence, part of bug 951
authorTobias Markus <tobbi@mozilla-uk.org>
Tue, 19 Mar 2013 19:46:40 +0000 (09:46 -1000)
committerLMH <lmh.0013@gmail.com>
Tue, 19 Mar 2013 19:46:40 +0000 (09:46 -1000)
src/supertux/statistics.cpp

index e336997..098ec85 100644 (file)
@@ -198,6 +198,7 @@ Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, S
   int row2_y = row1_y+30;
   int row3_y = row2_y+20;
   int row4_y = row3_y+20;
+  int row5_y = row4_y+20;
 
   context.push_transform();
   context.set_alpha(0.5);
@@ -216,12 +217,20 @@ Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, S
     context.draw_text(Resources::normal_font, coins_to_string(coins_best, total_coins_best), Vector(col3_x, row3_y), ALIGN_LEFT, LAYER_HUD, Statistics::text_color);
   }
 
-  context.draw_text(Resources::normal_font, _("Secrets"), Vector(col2_x-16, row4_y), ALIGN_RIGHT, LAYER_HUD, Statistics::header_color);
-  context.draw_text(Resources::normal_font, secrets_to_string(secrets, total_secrets), Vector(col2_x, row4_y), ALIGN_LEFT, LAYER_HUD, Statistics::text_color);
+  context.draw_text(Resources::normal_font, _("Badguys"), Vector(col2_x-16, row4_y), ALIGN_RIGHT, LAYER_HUD, Statistics::header_color);
+  context.draw_text(Resources::normal_font, frags_to_string(badguys, total_badguys), Vector(col2_x, row4_y), ALIGN_LEFT, LAYER_HUD, Statistics::text_color);
+  if (best_stats) {
+       int badguys_best = (best_stats->badguys > badguys) ? best_stats->badguys : badguys;
+       int total_badguys_best = (best_stats->total_badguys > total_badguys) ? best_stats->total_badguys : total_badguys;
+       context.draw_text(Resources::normal_font, frags_to_string(badguys_best, total_badguys_best), Vector(col3_x, row4_y), ALIGN_LEFT, LAYER_HUD, Statistics::text_color);
+  }
+
+  context.draw_text(Resources::normal_font, _("Secrets"), Vector(col2_x-16, row5_y), ALIGN_RIGHT, LAYER_HUD, Statistics::header_color);
+  context.draw_text(Resources::normal_font, secrets_to_string(secrets, total_secrets), Vector(col2_x, row5_y), ALIGN_LEFT, LAYER_HUD, Statistics::text_color);
   if (best_stats) {
     int secrets_best = (best_stats->secrets > secrets) ? best_stats->secrets : secrets;
     int total_secrets_best = (best_stats->total_secrets > total_secrets) ? best_stats->total_secrets : total_secrets;
-    context.draw_text(Resources::normal_font, secrets_to_string(secrets_best, total_secrets_best), Vector(col3_x, row4_y), ALIGN_LEFT, LAYER_HUD, Statistics::text_color);
+    context.draw_text(Resources::normal_font, secrets_to_string(secrets_best, total_secrets_best), Vector(col3_x, row5_y), ALIGN_LEFT, LAYER_HUD, Statistics::text_color);
   }
 
   context.draw_text(Resources::normal_font, _("Time"), Vector(col2_x-16, row2_y), ALIGN_RIGHT, LAYER_HUD, Statistics::header_color);