Intro and end and now for real\! Intro will play once the first time you play, and end plays after you beat nolok

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11596 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2012-09-18 22:50:44 +00:00
parent 4f835f341f
commit 6c81939430
2 changed files with 35 additions and 2 deletions

View File

@ -23,6 +23,8 @@
#include "animations/animation_base.hpp"
#include "audio/music_manager.hpp"
#include "challenges/game_slot.hpp"
#include "challenges/unlock_manager.hpp"
#include "graphics/irr_driver.hpp"
#include "io/file_manager.hpp"
#include "karts/abstract_kart.hpp"
@ -32,6 +34,7 @@
#include "physics/physics.hpp"
#include "states_screens/credits.hpp"
#include "states_screens/cutscene_gui.hpp"
#include "states_screens/kart_selection.hpp"
#include "states_screens/main_menu_screen.hpp"
#include "tracks/track.hpp"
#include "tracks/track_object.hpp"
@ -325,6 +328,22 @@ void CutsceneWorld::enterRaceOverState()
StateManager::get()->resetAndSetStack(newStack);
StateManager::get()->pushScreen(credits);
}
else if (m_parts.size() > 0 && m_parts[0] == "introcutscene")
{
GameSlot* slot = unlock_manager->getCurrentSlot();
if (slot->isFirstTime())
{
race_manager->exitRace();
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
slot->setFirstTime(false);
unlock_manager->save();
KartSelectionScreen* s = KartSelectionScreen::getInstance();
s->setMultiplayer(false);
s->setFromOverworld(true);
StateManager::get()->pushScreen( s );
}
}
else
{
race_manager->exitRace();

View File

@ -189,7 +189,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
std::string selection =
ribbon->getSelectionIDString(PLAYER_ID_GAME_MASTER);
/*
if (selection == "story")
{
StateManager::get()->enterGameState();
@ -206,7 +206,8 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
//race_manager->startSingleRace("introcutscene2", 999, false);
return;
}
*/
#if DEBUG_MENU_ITEM
if (selection == "options")
{
@ -311,12 +312,25 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
GameSlot* slot = unlock_manager->getCurrentSlot();
if (slot->isFirstTime())
{
/*
slot->setFirstTime(false);
unlock_manager->save();
KartSelectionScreen* s = KartSelectionScreen::getInstance();
s->setMultiplayer(false);
s->setFromOverworld(true);
StateManager::get()->pushScreen( s );
*/
StateManager::get()->enterGameState();
race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE);
race_manager->setNumKarts( 0 );
race_manager->setNumPlayers(0);
race_manager->setNumLocalPlayers(0);
race_manager->startSingleRace("introcutscene", 999, false);
std::vector<std::string> parts;
parts.push_back("introcutscene");
parts.push_back("introcutscene2");
((CutsceneWorld*)World::getWorld())->setParts(parts);
}
else
{