Show country flag in race gui

This commit is contained in:
Benau 2019-06-16 13:56:37 +08:00
parent 6a05325c75
commit 6c74d4a287
2 changed files with 16 additions and 1 deletions

View File

@ -210,7 +210,15 @@ void FreeForAll::getKartsDisplayInfo(
rank_info.lap = -1; rank_info.lap = -1;
rank_info.m_outlined_font = true; rank_info.m_outlined_font = true;
rank_info.m_color = getColor(i); rank_info.m_color = getColor(i);
rank_info.m_text = getKart(i)->getController()->getName() + L" (" + rank_info.m_text = getKart(i)->getController()->getName();
const core::stringw& flag = StringUtils::getCountryFlag(
race_manager->getKartInfo(i).getCountryCode());
if (!flag.empty())
{
rank_info.m_text += L" ";
rank_info.m_text += flag;
}
rank_info.m_text += core::stringw(L" (") +
StringUtils::toWString(m_scores[i]) + L")"; StringUtils::toWString(m_scores[i]) + L")";
} }
} // getKartsDisplayInfo } // getKartsDisplayInfo

View File

@ -640,6 +640,13 @@ void LinearWorld::getKartsDisplayInfo(
else if (kart->hasFinishedRace()) else if (kart->hasFinishedRace())
{ {
rank_info.m_text = kart->getController()->getName(); rank_info.m_text = kart->getController()->getName();
const core::stringw& flag = StringUtils::getCountryFlag(
race_manager->getKartInfo(i).getCountryCode());
if (!flag.empty())
{
rank_info.m_text += L" ";
rank_info.m_text += flag;
}
} }
else else
{ {