1) Added new attribute 'designer' to track, which is displayed if no
description is given (this simplified work for translators). 2) Changed the .track files to use designer instead of description (if applicable). 3) Updated .pot file 4) Minor clenaup in lisp parser. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1850 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
89617347fe
commit
e295434afb
File diff suppressed because it is too large
Load Diff
@ -28,6 +28,9 @@
|
|||||||
#include "material_manager.hpp"
|
#include "material_manager.hpp"
|
||||||
#include "unlock_manager.hpp"
|
#include "unlock_manager.hpp"
|
||||||
#include "translation.hpp"
|
#include "translation.hpp"
|
||||||
|
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||||
|
# define snprintf _snprintf
|
||||||
|
#endif
|
||||||
|
|
||||||
enum WidgetTokens
|
enum WidgetTokens
|
||||||
{
|
{
|
||||||
@ -100,9 +103,18 @@ void TrackSel::update(float dt)
|
|||||||
SELECTED_TRACK < (int)track_manager->getTrackCount() )
|
SELECTED_TRACK < (int)track_manager->getTrackCount() )
|
||||||
{
|
{
|
||||||
const Track* TRACK = track_manager->getTrack( SELECTED_TRACK );
|
const Track* TRACK = track_manager->getTrack( SELECTED_TRACK );
|
||||||
|
const std::string& description = TRACK->getDescription();
|
||||||
widget_manager->setWgtText( WTOK_AUTHOR, TRACK->getDescription() );
|
if(description!="")
|
||||||
|
{
|
||||||
|
widget_manager->setWgtText( WTOK_AUTHOR, TRACK->getDescription() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char designedby[MAX_MESSAGE_LENGTH];
|
||||||
|
snprintf(designedby, MAX_MESSAGE_LENGTH,
|
||||||
|
"Designed by %s", TRACK->getDesigner().c_str());
|
||||||
|
widget_manager->setWgtText( WTOK_AUTHOR, designedby );
|
||||||
|
}
|
||||||
const std::string& screenshot = TRACK->getScreenshotFile();
|
const std::string& screenshot = TRACK->getScreenshotFile();
|
||||||
const std::string& topview = TRACK->getTopviewFile();
|
const std::string& topview = TRACK->getTopviewFile();
|
||||||
|
|
||||||
|
@ -104,24 +104,24 @@ namespace lisp
|
|||||||
}
|
}
|
||||||
case Lexer::TOKEN_TRANSLATION:
|
case Lexer::TOKEN_TRANSLATION:
|
||||||
{
|
{
|
||||||
result = new Lisp(Lisp::TYPE_STRING);
|
result = new Lisp(Lisp::TYPE_STRING);
|
||||||
m_token = m_lexer->getNextToken();
|
m_token = m_lexer->getNextToken();
|
||||||
Lisp* next=read();
|
Lisp* next=read();
|
||||||
if(next->getType()!=Lisp::TYPE_STRING)
|
if(next->getType()!=Lisp::TYPE_STRING)
|
||||||
{
|
{
|
||||||
char msg[MAX_ERROR_MESSAGE_LENGTH];
|
char msg[MAX_ERROR_MESSAGE_LENGTH];
|
||||||
snprintf(msg, sizeof(msg),
|
snprintf(msg, sizeof(msg),
|
||||||
"Parse Error at line %d: No string inside translation.",
|
"Parse Error at line %d: No string inside translation.",
|
||||||
m_lexer->getLineNumber());
|
m_lexer->getLineNumber());
|
||||||
throw std::runtime_error(msg);
|
throw std::runtime_error(msg);
|
||||||
}
|
}
|
||||||
const char* trans=_(next->m_v.m_string);
|
const char* trans=_(next->m_v.m_string);
|
||||||
const size_t LEN = strlen(trans) + 1;
|
const size_t LEN = strlen(trans) + 1;
|
||||||
result->m_v.m_string = new char[LEN];
|
result->m_v.m_string = new char[LEN];
|
||||||
memcpy(result->m_v.m_string, trans, LEN);
|
memcpy(result->m_v.m_string, trans, LEN);
|
||||||
delete next;
|
delete next;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Lexer::TOKEN_OPEN_PAREN:
|
case Lexer::TOKEN_OPEN_PAREN:
|
||||||
result = new Lisp(Lisp::TYPE_CONS);
|
result = new Lisp(Lisp::TYPE_CONS);
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ Track::Track( std::string filename_, float w, float h, bool stretch )
|
|||||||
m_track_2d_height = h;
|
m_track_2d_height = h;
|
||||||
m_do_stretch = stretch;
|
m_do_stretch = stretch;
|
||||||
m_description = "";
|
m_description = "";
|
||||||
|
m_designer = "";
|
||||||
m_screenshot = "";
|
m_screenshot = "";
|
||||||
m_top_view = "";
|
m_top_view = "";
|
||||||
|
|
||||||
@ -816,6 +817,7 @@ void Track::loadTrack(std::string filename_)
|
|||||||
|
|
||||||
LISP->get ("name", m_name);
|
LISP->get ("name", m_name);
|
||||||
LISP->get ("description", m_description);
|
LISP->get ("description", m_description);
|
||||||
|
LISP->get ("designer", m_designer);
|
||||||
std::vector<std::string> filenames;
|
std::vector<std::string> filenames;
|
||||||
LISP->getVector("music", filenames);
|
LISP->getVector("music", filenames);
|
||||||
getMusicInformation(filenames, m_music);
|
getMusicInformation(filenames, m_music);
|
||||||
|
@ -49,6 +49,7 @@ private:
|
|||||||
std::vector<float> m_start_x, m_start_y, m_start_z, m_start_heading;
|
std::vector<float> m_start_x, m_start_y, m_start_z, m_start_heading;
|
||||||
std::string m_herring_style;
|
std::string m_herring_style;
|
||||||
std::string m_description;
|
std::string m_description;
|
||||||
|
std::string m_designer;
|
||||||
std::string m_filename;
|
std::string m_filename;
|
||||||
ssgBranch* m_model;
|
ssgBranch* m_model;
|
||||||
TriangleMesh* m_track_mesh;
|
TriangleMesh* m_track_mesh;
|
||||||
@ -186,6 +187,7 @@ public:
|
|||||||
const float& getAICurveSpeedAdjustment() const {return m_AI_curve_speed_adjustment;}
|
const float& getAICurveSpeedAdjustment() const {return m_AI_curve_speed_adjustment;}
|
||||||
const sgVec4& getSkyColor () const {return m_sky_color; }
|
const sgVec4& getSkyColor () const {return m_sky_color; }
|
||||||
const std::string& getDescription () const {return m_description; }
|
const std::string& getDescription () const {return m_description; }
|
||||||
|
const std::string& getDesigner () const {return m_designer; }
|
||||||
const std::string& getTopviewFile () const {return m_top_view; }
|
const std::string& getTopviewFile () const {return m_top_view; }
|
||||||
const std::string& getScreenshotFile () const {return m_screenshot; }
|
const std::string& getScreenshotFile () const {return m_screenshot; }
|
||||||
const std::vector<SGfloat>& getWidth () const {return m_path_width; }
|
const std::vector<SGfloat>& getWidth () const {return m_path_width; }
|
||||||
|
Loading…
Reference in New Issue
Block a user