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
This commit is contained in:
parent
870c470eab
commit
b9e9af0ab5
@ -24,6 +24,8 @@
|
|||||||
#include "race/race_manager.hpp"
|
#include "race/race_manager.hpp"
|
||||||
#include "states_screens/dialogs/track_info_dialog.hpp"
|
#include "states_screens/dialogs/track_info_dialog.hpp"
|
||||||
#include "states_screens/state_manager.hpp"
|
#include "states_screens/state_manager.hpp"
|
||||||
|
#include "tracks/track.hpp"
|
||||||
|
#include "tracks/track_manager.hpp"
|
||||||
#include "utils/translation.hpp"
|
#include "utils/translation.hpp"
|
||||||
|
|
||||||
using namespace GUIEngine;
|
using namespace GUIEngine;
|
||||||
@ -99,19 +101,34 @@ TrackInfoDialog::TrackInfoDialog(const std::string& trackIdent, const char* trac
|
|||||||
std::string name;
|
std::string name;
|
||||||
float time;
|
float time;
|
||||||
|
|
||||||
char buffer[512];
|
char buffer[128];
|
||||||
for (int n=0; n<amount; n++)
|
for (int n=0; n<3; n++)
|
||||||
{
|
{
|
||||||
highscores->getEntry(n, kart_name, name, &time);
|
if (n < amount)
|
||||||
|
{
|
||||||
|
highscores->getEntry(n, kart_name, name, &time);
|
||||||
|
|
||||||
sprintf(buffer, "%s (%s) : %.2f\n", kart_name.c_str(), name.c_str(), time);
|
sprintf(buffer, "%s (%s) : %.2f\n", kart_name.c_str(), name.c_str(), time);
|
||||||
|
|
||||||
std::cout << buffer << std::endl;
|
std::cout << buffer << std::endl;
|
||||||
highscores_string += buffer;
|
highscores_string += buffer;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//I18N : for empty highscores entries
|
||||||
|
highscores_string += _("(Empty)");
|
||||||
|
highscores_string += "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
std::cout << "======================\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);
|
core::rect< s32 > area_left(0, y1, m_area.getWidth()/2, y2);
|
||||||
IGUIStaticText* b = GUIEngine::getGUIEnv()->addStaticText( highscores_string.c_str(),
|
IGUIStaticText* b = GUIEngine::getGUIEnv()->addStaticText( highscores_string.c_str(),
|
||||||
|
Loading…
Reference in New Issue
Block a user