+ if(stats[SCORE_STAT][SPLAYER] == -1) // not initialized yet
+ return;
+
+ if(timer.check())
+ {
+ timer.start(TOTAL_DISPLAY_TIME);
+ display_stat++;
+ if(display_stat >= NUM_STATS)
+ display_stat = 1;
+ }
+
+ char str[128];
+
+ context.draw_text(white_small_text, _("- Best Level Statistics -"),
+ Vector((WMAP_INFO_LEFT_X + WMAP_INFO_RIGHT_X) / 2, 470),
+ CENTER_ALLIGN, LAYER_GUI);
+
+ sprintf(str, _("Max score:"));
+ context.draw_text(white_small_text, str, Vector(WMAP_INFO_LEFT_X, 490), LEFT_ALLIGN, LAYER_GUI);
+
+ sprintf(str, "%d", stats[SCORE_STAT][SPLAYER]);
+ context.draw_text(white_small_text, str, Vector(WMAP_INFO_RIGHT_X, 490), RIGHT_ALLIGN, LAYER_GUI);
+
+ // draw other small info
+
+ int alpha;
+ if(timer.get_timegone() < FADING_TIME)
+ alpha = int(timer.get_timegone() * 255 / FADING_TIME);
+ else if(timer.get_timeleft() < FADING_TIME)
+ alpha = int(timer.get_timeleft() * 255 / FADING_TIME);
+ else
+ alpha = 255;
+
+ context.push_transform();
+ context.set_alpha(alpha);
+
+ if(display_stat == COINS_COLLECTED_STAT)
+ sprintf(str, _("Max coins collected:"));
+ else if(display_stat == BADGUYS_KILLED_STAT)
+ sprintf(str, _("Max fragging:"));
+ else// if(display_stat == TIME_NEEDED_STAT)
+ sprintf(str, _("Min time needed:"));
+
+ context.draw_text(white_small_text, str, Vector(WMAP_INFO_LEFT_X, 508), LEFT_ALLIGN, LAYER_GUI);
+
+ if(display_stat == COINS_COLLECTED_STAT)
+ sprintf(str, "%d/%d", stats[COINS_COLLECTED_STAT][SPLAYER],
+ stats[COINS_COLLECTED_STAT][STOTAL]);
+ else if(display_stat == BADGUYS_KILLED_STAT)
+ sprintf(str, "%d/%d", stats[BADGUYS_KILLED_STAT][SPLAYER],
+ stats[BADGUYS_KILLED_STAT][STOTAL]);
+ else// if(display_stat == TIME_NEEDED_STAT)
+ sprintf(str, "%d/%d", stats[TIME_NEEDED_STAT][SPLAYER],
+ stats[TIME_NEEDED_STAT][STOTAL]);
+
+ context.draw_text(white_small_text, str, Vector(WMAP_INFO_RIGHT_X, 508), RIGHT_ALLIGN, LAYER_GUI);
+
+ context.pop_transform();