'Setup new race' button in paused dialog now works

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4140 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2009-10-20 18:29:51 +00:00
parent 0f775b8a8c
commit 9604fa2b8c
2 changed files with 12 additions and 2 deletions

View File

@ -183,7 +183,7 @@ EventPropagation EventHandler::onWidgetActivated(GUIEngine::Widget* w, const int
// notify modal dialog too // notify modal dialog too
if (ModalDialog::isADialogActive()) if (ModalDialog::isADialogActive())
{ {
if (ModalDialog::getCurrent()->processEvent(parent->m_properties[PROP_ID])) return EVENT_LET; if (ModalDialog::getCurrent()->processEvent(parent->m_properties[PROP_ID]) == EVENT_BLOCK) return EVENT_BLOCK;
} }
transmitEvent(parent, parent->m_properties[PROP_ID]); transmitEvent(parent, parent->m_properties[PROP_ID]);

View File

@ -25,8 +25,9 @@
#include "network/network_manager.hpp" #include "network/network_manager.hpp"
#include "race/race_manager.hpp" #include "race/race_manager.hpp"
#include "states_screens/help_screen_1.hpp" #include "states_screens/help_screen_1.hpp"
#include "states_screens/options_screen_av.hpp" #include "states_screens/kart_selection.hpp"
#include "states_screens/main_menu_screen.hpp" #include "states_screens/main_menu_screen.hpp"
#include "states_screens/options_screen_av.hpp"
#include "states_screens/state_manager.hpp" #include "states_screens/state_manager.hpp"
#include "utils/translation.hpp" #include "utils/translation.hpp"
@ -229,6 +230,10 @@ GUIEngine::EventPropagation RacePausedDialog::processEvent(std::string& eventSou
// FIXME : don't hardcode player 0 // FIXME : don't hardcode player 0
const int playerId = 0; const int playerId = 0;
const std::string& selection = m_choice_ribbon->getSelectionIDString(playerId); const std::string& selection = m_choice_ribbon->getSelectionIDString(playerId);
std::cout << "RacePausedDialog::processEvent(" << eventSource.c_str() << " : " << selection << ")\n";
if (selection == "exit") if (selection == "exit")
{ {
ModalDialog::dismiss(); ModalDialog::dismiss();
@ -259,6 +264,11 @@ GUIEngine::EventPropagation RacePausedDialog::processEvent(std::string& eventSou
} }
else if (selection == "newrace") else if (selection == "newrace")
{ {
ModalDialog::dismiss();
RaceManager::getWorld()->unpause();
race_manager->exitRace();
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
StateManager::get()->pushScreen(KartSelectionScreen::getInstance());
return GUIEngine::EVENT_BLOCK; return GUIEngine::EVENT_BLOCK;
} }
} }