Show times in GP dialogs too + prevent a crash (does not fix it, tho)
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4820 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
c0543e1c69
commit
379939e97e
@ -69,6 +69,7 @@ RaceOverDialog::RaceOverDialog(const float percentWidth,
|
||||
World *world = World::getWorld();
|
||||
const unsigned int num_karts = world->getNumKarts();
|
||||
int* order = new int [num_karts];
|
||||
for (unsigned int n=0; n<num_karts; n++) order[n] = -1;
|
||||
world->raceResultOrder(order);
|
||||
|
||||
const bool display_time = (world->getClockMode() == WorldStatus::CLOCK_CHRONO);
|
||||
@ -111,9 +112,19 @@ RaceOverDialog::RaceOverDialog(const float percentWidth,
|
||||
const int prev_score = race_manager->getKartPrevScore(order[i]);
|
||||
const int new_score = race_manager->getKartScore(order[i]);
|
||||
|
||||
kart_results_line = StringUtils::insertValues( L"#%i. %s (%i + %i = %i)",
|
||||
current_kart->getPosition(), kart_name.c_str(),
|
||||
prev_score, (new_score - prev_score), new_score);
|
||||
if (display_time)
|
||||
{
|
||||
kart_results_line = StringUtils::insertValues( L"#%i. %s %s (%i + %i = %i)",
|
||||
current_kart->getPosition(), sTime,
|
||||
kart_name.c_str(), prev_score,
|
||||
(new_score - prev_score), new_score);
|
||||
}
|
||||
else
|
||||
{
|
||||
kart_results_line = StringUtils::insertValues( L"#%i. %s (%i + %i = %i)",
|
||||
current_kart->getPosition(), kart_name.c_str(),
|
||||
prev_score, (new_score - prev_score), new_score);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -159,6 +159,24 @@ namespace StringUtils
|
||||
return insertValues(s, all_vals);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** Like the other ones above but for wide strings */
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6>
|
||||
irr::core::stringw insertValues(const irr::core::stringw &s, const T1 &v1,
|
||||
const T2 &v2, const T3 &v3, const T4 &v4,
|
||||
const T5 &v5, const T6 &v6)
|
||||
{
|
||||
std::vector<irr::core::stringw> all_vals;
|
||||
all_vals.push_back( irr::core::stringw(v1) );
|
||||
all_vals.push_back( irr::core::stringw(v2) );
|
||||
all_vals.push_back( irr::core::stringw(v3) );
|
||||
all_vals.push_back( irr::core::stringw(v4) );
|
||||
all_vals.push_back( irr::core::stringw(v5) );
|
||||
all_vals.push_back( irr::core::stringw(v6) );
|
||||
return insertValues(s, all_vals);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** Like the other ones above but for wide strings */
|
||||
template <class T1, class T2, class T3, class T4, class T5>
|
||||
|
Loading…
x
Reference in New Issue
Block a user