From b9e9af0ab51003bbb6b70b9266a213bc03b662ba Mon Sep 17 00:00:00 2001 From: auria Date: Sat, 29 Aug 2009 18:29:09 +0000 Subject: [PATCH] Improved track info shown on track dialog git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3952 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- .../dialogs/track_info_dialog.cpp | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/states_screens/dialogs/track_info_dialog.cpp b/src/states_screens/dialogs/track_info_dialog.cpp index 965e83a9d..81d999a55 100644 --- a/src/states_screens/dialogs/track_info_dialog.cpp +++ b/src/states_screens/dialogs/track_info_dialog.cpp @@ -24,6 +24,8 @@ #include "race/race_manager.hpp" #include "states_screens/dialogs/track_info_dialog.hpp" #include "states_screens/state_manager.hpp" +#include "tracks/track.hpp" +#include "tracks/track_manager.hpp" #include "utils/translation.hpp" using namespace GUIEngine; @@ -99,19 +101,34 @@ TrackInfoDialog::TrackInfoDialog(const std::string& trackIdent, const char* trac std::string name; float time; - char buffer[512]; - for (int n=0; ngetEntry(n, kart_name, name, &time); - - sprintf(buffer, "%s (%s) : %.2f\n", kart_name.c_str(), name.c_str(), time); - - std::cout << buffer << std::endl; - highscores_string += buffer; + if (n < amount) + { + highscores->getEntry(n, kart_name, name, &time); + + sprintf(buffer, "%s (%s) : %.2f\n", kart_name.c_str(), name.c_str(), time); + + std::cout << buffer << std::endl; + highscores_string += buffer; + } + else + { + //I18N : for empty highscores entries + highscores_string += _("(Empty)"); + highscores_string += "\n"; + } } std::cout << "======================\n"; + Track* track = track_manager->getTrack(trackIdent); + highscores_string += "\n"; /*+ track->getDescription() + "\n" */ + + //I18N : when showing who is the author of track '%s' + sprintf(buffer, _("By %s"), track->getDesigner().c_str()); + highscores_string += buffer; core::rect< s32 > area_left(0, y1, m_area.getWidth()/2, y2); IGUIStaticText* b = GUIEngine::getGUIEnv()->addStaticText( highscores_string.c_str(),