Fixed bug of game modes that don't reset properly

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4369 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2009-12-30 18:17:16 +00:00
parent 16c60413d5
commit 60854b0d10

View File

@@ -156,43 +156,42 @@ void RaceSetupScreen::init()
DynamicRibbonWidget* w2 = getWidget<DynamicRibbonWidget>("gamemode");
assert( w2 != NULL );
w2->clearItems();
// ---- Add game modes
irr::core::stringw name1 = irr::core::stringw(RaceManager::getNameOf(RaceManager::MINOR_MODE_NORMAL_RACE)) +
L"\n";
name1 += _("All blows allowed, so catch weapons and make clever use of them!");
if (!m_inited)
w2->addItem( name1, "normal", "/gui/mode_normal.png");
irr::core::stringw name2 = irr::core::stringw(RaceManager::getNameOf(RaceManager::MINOR_MODE_TIME_TRIAL)) +
L"\n";
name2 += _("Contains no powerups, so only your driving skills matter!");
w2->addItem( name2, "timetrial", "/gui/mode_tt.png");
if (unlock_manager->isLocked("followtheleader"))
{
irr::core::stringw name1 = irr::core::stringw(RaceManager::getNameOf(RaceManager::MINOR_MODE_NORMAL_RACE)) +
L"\n";
name1 += _("All blows allowed, so catch weapons and make clever use of them!");
w2->addItem( name1, "normal", "/gui/mode_normal.png");
irr::core::stringw name2 = irr::core::stringw(RaceManager::getNameOf(RaceManager::MINOR_MODE_TIME_TRIAL)) +
L"\n";
name2 += _("Contains no powerups, so only your driving skills matter!");
w2->addItem( name2, "timetrial", "/gui/mode_tt.png");
if (unlock_manager->isLocked("followtheleader"))
{
w2->addItem( _("Locked : solve active challenges to gain access to more!"),
"locked", "/gui/mode_ftl.png", true);
}
else
{
irr::core::stringw name3 = irr::core::stringw(RaceManager::getNameOf(RaceManager::MINOR_MODE_FOLLOW_LEADER)) +
L"\n";
name3 += _("Run for second place, as the last kart will be disqualified every time the counter hits zero. Beware : going in front of the leader will get you eliminated too!");
w2->addItem(name3, "ftl", "/gui/mode_ftl.png", false);
}
if (race_manager->getNumPlayers() > 1)
{
irr::core::stringw name4 = irr::core::stringw(RaceManager::getNameOf(RaceManager::MINOR_MODE_3_STRIKES)) +
L"\n";
name4 += _("Hit others with weapons until they lose all their lives. (Only in multiplayer games)");
w2->addItem( name4, "3strikes", "/gui/mode_3strikes.png");
}
m_inited = true;
w2->addItem( _("Locked : solve active challenges to gain access to more!"),
"locked", "/gui/mode_ftl.png", true);
}
else
{
irr::core::stringw name3 = irr::core::stringw(RaceManager::getNameOf(RaceManager::MINOR_MODE_FOLLOW_LEADER)) +
L"\n";
name3 += _("Run for second place, as the last kart will be disqualified every time the counter hits zero. Beware : going in front of the leader will get you eliminated too!");
w2->addItem(name3, "ftl", "/gui/mode_ftl.png", false);
}
if (race_manager->getNumPlayers() > 1)
{
irr::core::stringw name4 = irr::core::stringw(RaceManager::getNameOf(RaceManager::MINOR_MODE_3_STRIKES)) +
L"\n";
name4 += _("Hit others with weapons until they lose all their lives. (Only in multiplayer games)");
w2->addItem( name4, "3strikes", "/gui/mode_3strikes.png");
}
w2->updateItemDisplay();
}