Replace lap number indicator by challenge type indicator

This commit is contained in:
Alayan 2019-05-04 18:24:31 +02:00
parent bbfc4dce82
commit fbb0f48101
2 changed files with 36 additions and 30 deletions

View File

@ -291,23 +291,33 @@ ChallengeData::ChallengeData(const std::string& filename)
const irr::core::stringw ChallengeData::getChallengeDescription() const
{
core::stringw description;
if (!m_track_id.empty())
if (m_is_unlock_list)
return description;
if (m_mode == CM_GRAND_PRIX)
{
if (m_minor != RaceManager::MINOR_MODE_FOLLOW_LEADER)
{
//I18N: number of laps to race in a challenge
description += _("Laps: %i", m_num_laps);
description += core::stringw(L"\n");
}
else
{
// Follow the leader mode:
description = _("Follow the leader");
}
if (m_reverse == true)
{
description += _("Reverse");
}
if (m_minor == RaceManager::MINOR_MODE_NORMAL_RACE)
description = _("Normal Race (Grand Prix)");
else if (m_minor == RaceManager::MINOR_MODE_TIME_TRIAL)
description = _("Time-Trial (Grand Prix)");
}
else if (!m_track_id.empty())
{
if (m_is_ghost_replay)
description = _("Time-Trial - beat the replay");
else if (m_minor == RaceManager::MINOR_MODE_NORMAL_RACE)
description = _("Normal Race (single race)");
else if (m_minor == RaceManager::MINOR_MODE_TIME_TRIAL)
description = _("Time-Trial (single race)");
else if (m_minor == RaceManager::MINOR_MODE_FOLLOW_LEADER)
description = _("Follow the Leader (single race)");
}
if (m_reverse == true)
{
description += core::stringw(L"\n");
description += _("Mode: Reverse");
}
return description;
} // getChallengeDescription

View File

@ -532,14 +532,6 @@ void RaceGUIOverworld::drawGlobalMiniMap()
gui::ScalableFont* font = GUIEngine::getTitleFont();
font->draw(translations->fribidize(gp->getName()), pos, video::SColor(255,255,255,255),
false, true /* vcenter */, NULL);
core::rect<s32> pos2(pos);
pos2.UpperLeftCorner.Y += 10 + GUIEngine::getTitleFontHeight();
pos2.LowerRightCorner.Y += 10 + GUIEngine::getTitleFontHeight();
//just below GP name
font->draw(_("Type: Grand Prix"), pos2, video::SColor(255,255,255,255),
false, true /* vcenter */, NULL);
}
else
{
@ -567,17 +559,21 @@ void RaceGUIOverworld::drawGlobalMiniMap()
m_active_challenge = challenge;
m_challenge_description = challenge->getChallengeDescription();
}
GUIEngine::getFont()->draw(m_challenge_description,
pos, video::SColor(255,255,255,255),
false, false /* vcenter */, NULL);
gui::ScalableFont* font = GUIEngine::getLargeFont();
//FIXME : large font is upscaled and blurry
font->setBlackBorder(true);
font->draw(m_challenge_description, pos, video::SColor(255,255,255,255),
false, false /* vcenter */, NULL);
core::rect<s32> pos2(0,
irr_driver->getActualScreenSize().Height - GUIEngine::getFontHeight()*2,
irr_driver->getActualScreenSize().Width,
irr_driver->getActualScreenSize().Height);
GUIEngine::getOutlineFont()->draw(_("Press fire to start the challenge"), pos2,
GUIEngine::getSkin()->getColor("font::normal"),
true, true /* vcenter */, NULL);
font->draw(_("Press fire to start the challenge"), pos2,
GUIEngine::getSkin()->getColor("font::normal"),
true, true /* vcenter */, NULL);
font->setBlackBorder(false);
}
}