remove unnecessary in tracks_screen.cpp
This commit is contained in:
parent
bfc68472fb
commit
3a8bba6cad
@ -75,9 +75,6 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name, const
|
|||||||
|
|
||||||
if (selection == "random_track")
|
if (selection == "random_track")
|
||||||
{
|
{
|
||||||
RibbonWidget* tabs = this->getWidget<RibbonWidget>("trackgroups");
|
|
||||||
assert(tabs != NULL);
|
|
||||||
|
|
||||||
if (m_random_track_list.empty()) return;
|
if (m_random_track_list.empty()) return;
|
||||||
|
|
||||||
std::string track = m_random_track_list.front();
|
std::string track = m_random_track_list.front();
|
||||||
@ -148,7 +145,6 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name, const
|
|||||||
void TracksScreen::beforeAddingWidget()
|
void TracksScreen::beforeAddingWidget()
|
||||||
{
|
{
|
||||||
Screen::init();
|
Screen::init();
|
||||||
// Dynamically add tabs
|
|
||||||
RibbonWidget* tabs = this->getWidget<RibbonWidget>("trackgroups");
|
RibbonWidget* tabs = this->getWidget<RibbonWidget>("trackgroups");
|
||||||
tabs->clearAllChildren();
|
tabs->clearAllChildren();
|
||||||
|
|
||||||
@ -190,6 +186,9 @@ void TracksScreen::init()
|
|||||||
// Reset GP list everytime (accounts for locking changes, etc.)
|
// Reset GP list everytime (accounts for locking changes, etc.)
|
||||||
gps_widget->clearItems();
|
gps_widget->clearItems();
|
||||||
|
|
||||||
|
// Ensure that no GP and no track is NULL
|
||||||
|
grand_prix_manager->checkConsistency();
|
||||||
|
|
||||||
// Build GP list
|
// Build GP list
|
||||||
const int gpAmount = grand_prix_manager->getNumberOfGrandPrix();
|
const int gpAmount = grand_prix_manager->getNumberOfGrandPrix();
|
||||||
for (int n=0; n<gpAmount; n++)
|
for (int n=0; n<gpAmount; n++)
|
||||||
@ -200,17 +199,9 @@ void TracksScreen::init()
|
|||||||
std::vector<std::string> screenshots;
|
std::vector<std::string> screenshots;
|
||||||
for (unsigned int t=0; t<tracks.size(); t++)
|
for (unsigned int t=0; t<tracks.size(); t++)
|
||||||
{
|
{
|
||||||
Track* curr = track_manager->getTrack(tracks[t]);
|
const Track* curr = track_manager->getTrack(tracks[t]);
|
||||||
if (curr == NULL)
|
|
||||||
{
|
|
||||||
std::cerr << "/!\\ WARNING: Grand Prix '" << gp->getId() << "' refers to track '"
|
|
||||||
<< tracks[t] << "', which does not exist.\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
screenshots.push_back(curr->getScreenshotFile());
|
screenshots.push_back(curr->getScreenshotFile());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (screenshots.size() == 0)
|
if (screenshots.size() == 0)
|
||||||
{
|
{
|
||||||
std::cerr << "/!\\ WARNING: Grand Prix '" << gp->getId()
|
std::cerr << "/!\\ WARNING: Grand Prix '" << gp->getId()
|
||||||
@ -247,7 +238,6 @@ void TracksScreen::init()
|
|||||||
RibbonWidget* tabs = this->getWidget<RibbonWidget>("trackgroups");
|
RibbonWidget* tabs = this->getWidget<RibbonWidget>("trackgroups");
|
||||||
tabs->select(UserConfigParams::m_last_used_track_group, PLAYER_ID_GAME_MASTER);
|
tabs->select(UserConfigParams::m_last_used_track_group, PLAYER_ID_GAME_MASTER);
|
||||||
|
|
||||||
|
|
||||||
buildTrackList();
|
buildTrackList();
|
||||||
|
|
||||||
// select old track for the game master (if found)
|
// select old track for the game master (if found)
|
||||||
@ -286,8 +276,8 @@ void TracksScreen::buildTrackList()
|
|||||||
if(race_manager->getMinorMode()==RaceManager::MINOR_MODE_EASTER_EGG
|
if(race_manager->getMinorMode()==RaceManager::MINOR_MODE_EASTER_EGG
|
||||||
&& !curr->hasEasterEggs())
|
&& !curr->hasEasterEggs())
|
||||||
continue;
|
continue;
|
||||||
if (curr->isArena() || curr->isSoccer()) continue;
|
if (curr->isArena() || curr->isSoccer() || curr->isInternal())
|
||||||
if (curr->isInternal()) continue;
|
continue;
|
||||||
|
|
||||||
if(PlayerManager::getCurrentPlayer()->isLocked(curr->getIdent()))
|
if(PlayerManager::getCurrentPlayer()->isLocked(curr->getIdent()))
|
||||||
{
|
{
|
||||||
@ -316,9 +306,8 @@ void TracksScreen::buildTrackList()
|
|||||||
if(race_manager->getMinorMode()==RaceManager::MINOR_MODE_EASTER_EGG
|
if(race_manager->getMinorMode()==RaceManager::MINOR_MODE_EASTER_EGG
|
||||||
&& !curr->hasEasterEggs())
|
&& !curr->hasEasterEggs())
|
||||||
continue;
|
continue;
|
||||||
if (curr->isArena()) continue;
|
if (curr->isArena() || curr->isSoccer() || curr->isInternal())
|
||||||
if (curr->isSoccer()) continue;
|
continue;
|
||||||
if (curr->isInternal()) continue;
|
|
||||||
|
|
||||||
if (PlayerManager::getCurrentPlayer()->isLocked(curr->getIdent()))
|
if (PlayerManager::getCurrentPlayer()->isLocked(curr->getIdent()))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user