From 020fc76df304c554da42ceccf87065ed3a655e8b Mon Sep 17 00:00:00 2001 From: auria Date: Sat, 16 Feb 2013 16:43:13 +0000 Subject: [PATCH] Move tutorial to help menu git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12489 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- data/gui/help1.stkgui | Bin 6596 -> 6756 bytes data/gui/main.stkgui | 3 +- src/states_screens/help_screen_1.cpp | 42 +++++++++++++++++++++++- src/states_screens/main_menu_screen.cpp | 34 ------------------- 4 files changed, 42 insertions(+), 37 deletions(-) diff --git a/data/gui/help1.stkgui b/data/gui/help1.stkgui index 796b0c1112896d2e94daba7f4bab9b431ff119a9..7175e763f2ce63022d6ebdec547ad41ecb66a076 100644 GIT binary patch delta 189 zcmX?N{KRC#1op`;LL!qJxMdhkCqHBopL~c@YVreNw#naEg))m7N*EFuihyJYLn)BV z2eLDPA~_673<^MgDnkX3v<32)RXz~npk;w*p-!?~a3a~O7PoB@Qd$StRJU1a@`>1~8oLC@MTTNy1{Xf~eBu3v2@Bi455csX)0(hJ1!nh9V%Vh#`}q xj3JRBhoKnAO9Jvrz$#LJ^2I>5B7+ix{^t8af{dI0aPqNEw&UEh`56B^E&xny8Rq~1 diff --git a/data/gui/main.stkgui b/data/gui/main.stkgui index 29f2aff45..eb1dae89b 100644 --- a/data/gui/main.stkgui +++ b/data/gui/main.stkgui @@ -1,3 +1,4 @@ +
@@ -37,8 +38,6 @@ I18N="Main menu button" text="Options" label_location="hover"/> - setNumLocalPlayers(1); + race_manager->setMajorMode (RaceManager::MAJOR_MODE_SINGLE); + race_manager->setMinorMode (RaceManager::MINOR_MODE_TUTORIAL); + race_manager->setNumKarts( 1 ); + race_manager->setTrack( "tutorial" ); + race_manager->setDifficulty(RaceManager::DIFFICULTY_EASY); + + // Use keyboard 0 by default (FIXME: let player choose?) + InputDevice* device = input_manager->getDeviceList()->getKeyboard(0); + + // Create player and associate player with keyboard + StateManager::get()->createActivePlayer(unlock_manager->getCurrentPlayer(), + device); + + if (kart_properties_manager->getKart(UserConfigParams::m_default_kart) == NULL) + { + fprintf(stderr, "[MainMenuScreen] WARNING: cannot find kart '%s', will revert to default\n", + UserConfigParams::m_default_kart.c_str()); + UserConfigParams::m_default_kart.revertToDefaults(); + } + race_manager->setLocalKartInfo(0, UserConfigParams::m_default_kart); + + // ASSIGN should make sure that only input from assigned devices + // is read. + input_manager->getDeviceList()->setAssignMode(ASSIGN); + input_manager->getDeviceList() + ->setSinglePlayer( StateManager::get()->getActivePlayer(0) ); + + StateManager::get()->enterGameState(); + network_manager->setupPlayerKartInfo(); + race_manager->startNew(false); + } + else if (name == "category") { std::string selection = ((RibbonWidget*)widget)->getSelectionIDString(PLAYER_ID_GAME_MASTER).c_str(); diff --git a/src/states_screens/main_menu_screen.cpp b/src/states_screens/main_menu_screen.cpp index df328557d..0fc5b488d 100644 --- a/src/states_screens/main_menu_screen.cpp +++ b/src/states_screens/main_menu_screen.cpp @@ -300,40 +300,6 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name, { StateManager::get()->pushScreen(HelpScreen1::getInstance()); } - else if (selection == "startTutorial") - { - race_manager->setNumLocalPlayers(1); - race_manager->setMajorMode (RaceManager::MAJOR_MODE_SINGLE); - race_manager->setMinorMode (RaceManager::MINOR_MODE_TUTORIAL); - race_manager->setNumKarts( 1 ); - race_manager->setTrack( "tutorial" ); - race_manager->setDifficulty(RaceManager::DIFFICULTY_EASY); - - // Use keyboard 0 by default (FIXME: let player choose?) - InputDevice* device = input_manager->getDeviceList()->getKeyboard(0); - - // Create player and associate player with keyboard - StateManager::get()->createActivePlayer(unlock_manager->getCurrentPlayer(), - device); - - if (kart_properties_manager->getKart(UserConfigParams::m_default_kart) == NULL) - { - fprintf(stderr, "[MainMenuScreen] WARNING: cannot find kart '%s', will revert to default\n", - UserConfigParams::m_default_kart.c_str()); - UserConfigParams::m_default_kart.revertToDefaults(); - } - race_manager->setLocalKartInfo(0, UserConfigParams::m_default_kart); - - // ASSIGN should make sure that only input from assigned devices - // is read. - input_manager->getDeviceList()->setAssignMode(ASSIGN); - input_manager->getDeviceList() - ->setSinglePlayer( StateManager::get()->getActivePlayer(0) ); - - StateManager::get()->enterGameState(); - network_manager->setupPlayerKartInfo(); - race_manager->startNew(false); - } else if (selection == "story") { GameSlot* slot = unlock_manager->getCurrentSlot();