Cleanup, mostly in race ending

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4232 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2009-12-01 19:49:11 +00:00
parent 8fe5779087
commit 584417910d
6 changed files with 11 additions and 13 deletions

View File

@ -174,7 +174,8 @@ void AbstractStateManager::resetAndGoToScreen(Screen* screen)
{
std::string name = screen->getName();
race_manager->exitRace();
assert(!race_manager->raceIsActive());
input_manager->setMode(InputManager::MENU);
m_menu_stack.clear();
m_menu_stack.push_back(name);

View File

@ -342,11 +342,12 @@ EventPropagation DynamicRibbonWidget::rightPressed(const int playerID)
getSelectedRibbon(playerID)->getSelectionText(playerID), playerID);
}
}
std::cout << "rightpressed (dynamic ribbon)\n";
//std::cout << "rightpressed (dynamic ribbon)\n";
assert(m_rows.size() >= 1);
if (m_rows[0].m_ribbon_type == RIBBON_TOOLBAR) return EVENT_BLOCK;
std::cout << " rightpressed returning EVENT_LET\n";
//std::cout << " rightpressed returning EVENT_LET\n";
return EVENT_LET;
}
@ -367,7 +368,7 @@ EventPropagation DynamicRibbonWidget::leftPressed(const int playerID)
}
}
assert(m_rows.size() >= 1);
if (m_rows[0].m_ribbon_type == RIBBON_TOOLBAR) return EVENT_BLOCK;
return EVENT_LET;

View File

@ -388,15 +388,13 @@ void RaceManager::exitRace()
// TODO - Grand Prix ending
// menu_manager->switchToGrandPrixEnding();
}
else
{
// FIXME - back to main menu
// menu_manager->switchToMainMenu();
}
delete m_world;
m_world = NULL;
m_track_number = 0;
m_active_race = false;
StateManager::get()->resetActivePlayers();
} // exitRace
//-----------------------------------------------------------------------------

View File

@ -266,7 +266,6 @@ GUIEngine::EventPropagation RaceOverDialog::processEvent(std::string& eventSourc
RaceManager::getWorld()->unpause();
race_manager->exitRace();
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
input_manager->setMode(InputManager::MENU);
return GUIEngine::EVENT_BLOCK;
}
else if (eventSource == "continuegp")

View File

@ -238,7 +238,6 @@ GUIEngine::EventPropagation RacePausedDialog::processEvent(std::string& eventSou
ModalDialog::dismiss();
race_manager->exitRace();
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
input_manager->setMode(InputManager::MENU);
return GUIEngine::EVENT_BLOCK;
}
else if (selection == "help")