Level into screen will now display target time if defined for level
authorLMH <lmh.0013@gmail.com>
Sat, 7 Sep 2013 06:58:16 +0000 (20:58 -1000)
committerTobias Markus <tobbi@mozilla-uk.org>
Sat, 26 Oct 2013 16:45:21 +0000 (18:45 +0200)
src/supertux/levelintro.cpp

index 98d8544..f81d653 100644 (file)
@@ -133,7 +133,14 @@ LevelIntro::draw(DrawingContext& context)
 
   {
     std::stringstream ss;
-    ss << _("Time") << ": " << Statistics::time_to_string((best_level_statistics && (best_level_statistics->coins >= 0)) ? best_level_statistics->time : 0);
+    ss << _("Best time") << ": " << Statistics::time_to_string((best_level_statistics && (best_level_statistics->coins >= 0)) ? best_level_statistics->time : 0);
+    context.draw_center_text(Resources::normal_font, ss.str(), Vector(0, py), LAYER_FOREGROUND1,LevelIntro::stat_color);
+    py += static_cast<int>(Resources::normal_font->get_height());
+  }
+
+  if(level->target_time){
+    std::stringstream ss;
+    ss << _("Level target time") << ": " << Statistics::time_to_string(level->target_time);
     context.draw_center_text(Resources::normal_font, ss.str(), Vector(0, py), LAYER_FOREGROUND1,LevelIntro::stat_color);
     py += static_cast<int>(Resources::normal_font->get_height());
   }