From 23eb484f0cc3e30868ce78ce2aca8236dfcaef4e Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Tue, 19 Mar 2013 09:46:40 -1000 Subject: [PATCH] Include Badguys Killed stat in level endsequence, part of bug 951 --- src/supertux/statistics.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/supertux/statistics.cpp b/src/supertux/statistics.cpp index e33699783..098ec8590 100644 --- a/src/supertux/statistics.cpp +++ b/src/supertux/statistics.cpp @@ -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); -- 2.11.0