More work on cutscene screens
This commit is contained in:
parent
bc2209284b
commit
e3a2246e25
@ -215,7 +215,10 @@ public:
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
bool isFirstTime() const { return m_story_mode_status->isFirstTime(); }
|
bool isFirstTime() const { return m_story_mode_status->isFirstTime(); }
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
void clearUnlocked() { m_story_mode_status->clearUnlocked(); }
|
void clearUnlocked()
|
||||||
|
{
|
||||||
|
m_story_mode_status->clearUnlocked();
|
||||||
|
}
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
/** Returns the current challenge for this player. */
|
/** Returns the current challenge for this player. */
|
||||||
const ChallengeStatus* getCurrentChallengeStatus() const
|
const ChallengeStatus* getCurrentChallengeStatus() const
|
||||||
|
@ -138,7 +138,7 @@ void AbstractStateManager::pushScreen(Screen* screen)
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void AbstractStateManager::replaceTopMostScreen(Screen* screen)
|
void AbstractStateManager::replaceTopMostScreen(Screen* screen, GUIEngine::GameState gameState)
|
||||||
{
|
{
|
||||||
//assert(m_game_mode != GAME);
|
//assert(m_game_mode != GAME);
|
||||||
// you need to close any dialog before calling this
|
// you need to close any dialog before calling this
|
||||||
@ -160,7 +160,7 @@ void AbstractStateManager::replaceTopMostScreen(Screen* screen)
|
|||||||
getCurrentScreen()->tearDown();
|
getCurrentScreen()->tearDown();
|
||||||
|
|
||||||
m_menu_stack[m_menu_stack.size()-1] = name;
|
m_menu_stack[m_menu_stack.size()-1] = name;
|
||||||
setGameState(MENU);
|
setGameState(gameState);
|
||||||
switchToScreen(name.c_str());
|
switchToScreen(name.c_str());
|
||||||
|
|
||||||
// Send init event to new menu
|
// Send init event to new menu
|
||||||
|
@ -82,7 +82,7 @@ namespace GUIEngine
|
|||||||
* without displaying the second-topmost menu of the stack
|
* without displaying the second-topmost menu of the stack
|
||||||
* in-between)
|
* in-between)
|
||||||
*/
|
*/
|
||||||
void replaceTopMostScreen(Screen* screen);
|
void replaceTopMostScreen(Screen* screen, GUIEngine::GameState gameState = GUIEngine::MENU);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief removes the menu at the top of the screens stack
|
* \brief removes the menu at the top of the screens stack
|
||||||
|
@ -419,12 +419,11 @@ void CutsceneWorld::enterRaceOverState()
|
|||||||
// un-set the GP mode so that after unlocking, it doesn't try to continue the GP
|
// un-set the GP mode so that after unlocking, it doesn't try to continue the GP
|
||||||
race_manager->setMajorMode(RaceManager::MAJOR_MODE_SINGLE);
|
race_manager->setMajorMode(RaceManager::MAJOR_MODE_SINGLE);
|
||||||
|
|
||||||
if (PlayerManager::getCurrentPlayer()
|
std::vector<const ChallengeData*> unlocked =
|
||||||
->getRecentlyCompletedChallenges().size() > 0)
|
PlayerManager::getCurrentPlayer()->getRecentlyCompletedChallenges();
|
||||||
|
if (unlocked.size() > 0)
|
||||||
{
|
{
|
||||||
std::vector<const ChallengeData*> unlocked =
|
//PlayerManager::getCurrentPlayer()->clearUnlocked();
|
||||||
PlayerManager::getCurrentPlayer()->getRecentlyCompletedChallenges();
|
|
||||||
PlayerManager::getCurrentPlayer()->clearUnlocked();
|
|
||||||
|
|
||||||
StateManager::get()->enterGameState();
|
StateManager::get()->enterGameState();
|
||||||
race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE);
|
race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE);
|
||||||
@ -443,12 +442,13 @@ void CutsceneWorld::enterRaceOverState()
|
|||||||
scene->addTrophy(race_manager->getDifficulty());
|
scene->addTrophy(race_manager->getDifficulty());
|
||||||
scene->findWhatWasUnlocked(race_manager->getDifficulty());
|
scene->findWhatWasUnlocked(race_manager->getDifficulty());
|
||||||
|
|
||||||
StateManager::get()->replaceTopMostScreen(scene);
|
StateManager::get()->replaceTopMostScreen(scene, GUIEngine::INGAME_MENU);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (race_manager->raceWasStartedFromOverworld())
|
if (race_manager->raceWasStartedFromOverworld())
|
||||||
{
|
{
|
||||||
|
//StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
|
||||||
OverWorld::enterOverWorld();
|
OverWorld::enterOverWorld();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -462,10 +462,54 @@ void CutsceneWorld::enterRaceOverState()
|
|||||||
// TODO: remove hardcoded knowledge of cutscenes, replace with scripting probably
|
// TODO: remove hardcoded knowledge of cutscenes, replace with scripting probably
|
||||||
else if (m_parts.size() == 1 && m_parts[0] == "gplose")
|
else if (m_parts.size() == 1 && m_parts[0] == "gplose")
|
||||||
{
|
{
|
||||||
|
//race_manager->exitRace();
|
||||||
|
//StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
|
||||||
|
//if (race_manager->raceWasStartedFromOverworld())
|
||||||
|
// OverWorld::enterOverWorld();
|
||||||
|
|
||||||
race_manager->exitRace();
|
race_manager->exitRace();
|
||||||
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
|
|
||||||
if (race_manager->raceWasStartedFromOverworld())
|
// un-set the GP mode so that after unlocking, it doesn't try to continue the GP
|
||||||
OverWorld::enterOverWorld();
|
race_manager->setMajorMode(RaceManager::MAJOR_MODE_SINGLE);
|
||||||
|
|
||||||
|
std::vector<const ChallengeData*> unlocked =
|
||||||
|
PlayerManager::getCurrentPlayer()->getRecentlyCompletedChallenges();
|
||||||
|
if (unlocked.size() > 0)
|
||||||
|
{
|
||||||
|
//PlayerManager::getCurrentPlayer()->clearUnlocked();
|
||||||
|
|
||||||
|
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("featunlocked", 999, false);
|
||||||
|
|
||||||
|
FeatureUnlockedCutScene* scene =
|
||||||
|
FeatureUnlockedCutScene::getInstance();
|
||||||
|
std::vector<std::string> parts;
|
||||||
|
parts.push_back("featunlocked");
|
||||||
|
((CutsceneWorld*)World::getWorld())->setParts(parts);
|
||||||
|
|
||||||
|
scene->addTrophy(race_manager->getDifficulty());
|
||||||
|
scene->findWhatWasUnlocked(race_manager->getDifficulty());
|
||||||
|
|
||||||
|
StateManager::get()->replaceTopMostScreen(scene, GUIEngine::INGAME_MENU);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (race_manager->raceWasStartedFromOverworld())
|
||||||
|
{
|
||||||
|
//StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
|
||||||
|
OverWorld::enterOverWorld();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
|
||||||
|
// we assume the main menu was pushed before showing this menu
|
||||||
|
//StateManager::get()->popMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// TODO: remove hardcoded knowledge of cutscenes, replace with scripting probably
|
// TODO: remove hardcoded knowledge of cutscenes, replace with scripting probably
|
||||||
else if (race_manager->getTrackName() == "introcutscene" ||
|
else if (race_manager->getTrackName() == "introcutscene" ||
|
||||||
|
@ -346,6 +346,8 @@ void FeatureUnlockedCutScene::init()
|
|||||||
std::cerr << "Malformed unlocked goody!!!\n";
|
std::cerr << "Malformed unlocked goody!!!\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PlayerManager::getCurrentPlayer()->clearUnlocked();
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@ -109,48 +109,6 @@ void GrandPrixLose::onCutsceneEnd()
|
|||||||
m_kart_node[1] = NULL;
|
m_kart_node[1] = NULL;
|
||||||
m_kart_node[2] = NULL;
|
m_kart_node[2] = NULL;
|
||||||
m_kart_node[3] = NULL;
|
m_kart_node[3] = NULL;
|
||||||
|
|
||||||
// un-set the GP mode so that after unlocking, it doesn't try to continue the GP
|
|
||||||
race_manager->setMajorMode(RaceManager::MAJOR_MODE_SINGLE);
|
|
||||||
|
|
||||||
std::vector<const ChallengeData*> unlocked =
|
|
||||||
PlayerManager::getCurrentPlayer()->getRecentlyCompletedChallenges();
|
|
||||||
if (unlocked.size() > 0)
|
|
||||||
{
|
|
||||||
race_manager->exitRace();
|
|
||||||
|
|
||||||
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("featunlocked", 999, false);
|
|
||||||
|
|
||||||
FeatureUnlockedCutScene* scene =
|
|
||||||
FeatureUnlockedCutScene::getInstance();
|
|
||||||
std::vector<std::string> parts;
|
|
||||||
parts.push_back("featunlocked");
|
|
||||||
((CutsceneWorld*)World::getWorld())->setParts(parts);
|
|
||||||
|
|
||||||
scene->addTrophy(race_manager->getDifficulty());
|
|
||||||
scene->findWhatWasUnlocked(race_manager->getDifficulty());
|
|
||||||
|
|
||||||
StateManager::get()->replaceTopMostScreen(scene);
|
|
||||||
PlayerManager::getCurrentPlayer()->clearUnlocked();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (race_manager->raceWasStartedFromOverworld())
|
|
||||||
{
|
|
||||||
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
|
|
||||||
OverWorld::enterOverWorld();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// we assume the main menu was pushed before showing this menu
|
|
||||||
StateManager::get()->popMenu();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user