Rework a bit select challenge dialog. Show most important information first. Fix required rank for FTL

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11916 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2012-11-11 01:41:51 +00:00
parent 82e814dfa4
commit 4f439acf13

View File

@ -37,26 +37,31 @@ using namespace GUIEngine;
core::stringw getLabel(RaceManager::Difficulty difficulty, const ChallengeData* c)
{
core::stringw label = _("Number of AI Karts : %i",
c->getNumKarts(difficulty) - 1);
core::stringw label;
if (c->getPosition(difficulty) != -1)
{
label.append(L"\n");
label.append( _("Required Rank : %i", c->getPosition(difficulty)) );
int r = c->getPosition(difficulty);
if (c->getMinorMode() == RaceManager::MINOR_MODE_FOLLOW_LEADER) r--;
if (label.size() > 0) label.append(L"\n");
label.append( _("Required Rank : %i", r) );
}
if (c->getTime(difficulty) > 0)
{
label.append(L"\n");
if (label.size() > 0) label.append(L"\n");
label.append( _("Required Time : %i",
StringUtils::timeToString(c->getTime(difficulty)).c_str()) );
}
if (c->getEnergy(difficulty) > 0)
{
label.append(L"\n");
if (label.size() > 0) label.append(L"\n");
label.append( _("Required Nitro Points : %i", c->getEnergy(difficulty)) );
}
if (label.size() > 0) label.append(L"\n");
label.append(_("Number of AI Karts : %i", c->getNumKarts(difficulty) - 1));
return label;
}