Ease debugging GPWin/GPLose/FeatureUnlocked scenes

This commit is contained in:
Marianne Gagnon 2014-07-08 20:37:39 -04:00
parent 173ee0d510
commit ed97fca7b3
2 changed files with 29 additions and 17 deletions

View File

@ -35,6 +35,14 @@
<spacer width="10" height="10" /> <spacer width="10" height="10" />
<buttonbar id="menu_bottomrow" x="0" y="0" width="38%" height="100%" align="center"> <buttonbar id="menu_bottomrow" x="0" y="0" width="38%" height="100%" align="center">
<icon-button id="test_gpwin" width="64" height="64" icon="gui/main_options.png" extend_label="50"
text="TEST: GPWin" label_location="hover"/>
<icon-button id="test_gplose" width="64" height="64" icon="gui/main_options.png" extend_label="50"
text="TEST: GPLose" label_location="hover"/>
<icon-button id="test_unlocked" width="64" height="64" icon="gui/main_options.png" extend_label="50"
text="TEST: Unlocked" label_location="hover"/>
<icon-button id="test_unlocked2" width="64" height="64" icon="gui/main_options.png" extend_label="50"
text="TEST: Unlocked 2" label_location="hover"/>
<icon-button id="options" width="64" height="64" icon="gui/main_options.png" extend_label="50" <icon-button id="options" width="64" height="64" icon="gui/main_options.png" extend_label="50"
I18N="Main menu button" text="Options" label_location="hover"/> I18N="Main menu button" text="Options" label_location="hover"/>
<icon-button id="help" width="64" height="64" icon="gui/main_help.png" extend_label="50" <icon-button id="help" width="64" height="64" icon="gui/main_help.png" extend_label="50"

View File

@ -80,6 +80,13 @@ void MainMenuScreen::loadedFromFile()
{ {
LabelWidget* w = getWidget<LabelWidget>("info_addons"); LabelWidget* w = getWidget<LabelWidget>("info_addons");
w->setScrollSpeed(15); w->setScrollSpeed(15);
#if DEBUG_MENU_ITEM != 1
RibbonWidget* rw = getWidget<RibbonWidget>("menu_bottomrow");
rw->removeChildNamed("test_gpwin");
rw->removeChildNamed("test_gplose");
rw->removeChildNamed("test_unlocked");
#endif
} // loadedFromFile } // loadedFromFile
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -230,14 +237,12 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
*/ */
#if DEBUG_MENU_ITEM #if DEBUG_MENU_ITEM
if (selection == "gpEditor") if (selection == "test_gpwin")
{ {
// The DEBUG item
StoryModeStatus* sms = PlayerManager::getCurrentPlayer()->getStoryModeStatus(); StoryModeStatus* sms = PlayerManager::getCurrentPlayer()->getStoryModeStatus();
sms->unlockFeature(const_cast<ChallengeStatus*>(sms->getChallengeStatus("gp1")), sms->unlockFeature(const_cast<ChallengeStatus*>(sms->getChallengeStatus("gp1")),
RaceManager::DIFFICULTY_HARD); RaceManager::DIFFICULTY_HARD);
// GP WIN
StateManager::get()->enterGameState(); StateManager::get()->enterGameState();
race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE); race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE);
race_manager->setNumKarts(0); race_manager->setNumKarts(0);
@ -248,9 +253,9 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
StateManager::get()->pushScreen(scene); StateManager::get()->pushScreen(scene);
const std::string winners[] = { "elephpant", "nolok", "pidgin" }; const std::string winners[] = { "elephpant", "nolok", "pidgin" };
scene->setKarts(winners); scene->setKarts(winners);
}
// GP Lose else if (selection == "test_gplose")
/* {
StateManager::get()->enterGameState(); StateManager::get()->enterGameState();
race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE); race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE);
race_manager->setNumKarts(0); race_manager->setNumKarts(0);
@ -265,10 +270,13 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
//losers.push_back("wilber"); //losers.push_back("wilber");
//losers.push_back("tux"); //losers.push_back("tux");
scene->setKarts(losers); scene->setKarts(losers);
*/ }
else if (selection == "test_unlocked" || selection == "test_unlocked2")
{
StoryModeStatus* sms = PlayerManager::getCurrentPlayer()->getStoryModeStatus();
sms->unlockFeature(const_cast<ChallengeStatus*>(sms->getChallengeStatus("gp1")),
RaceManager::DIFFICULTY_HARD);
/*
// FEATURE UNLOCKED
StateManager::get()->enterGameState(); StateManager::get()->enterGameState();
race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE); race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE);
race_manager->setNumKarts(0); race_manager->setNumKarts(0);
@ -284,12 +292,8 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
((CutsceneWorld*)World::getWorld())->setParts(parts); ((CutsceneWorld*)World::getWorld())->setParts(parts);
scene->addTrophy(RaceManager::DIFFICULTY_EASY); scene->addTrophy(RaceManager::DIFFICULTY_EASY);
//StateManager::get()->pushScreen(scene);
static int i = 1; if (selection == "test_unlocked")
i++;
if (i % 2 == 0)
{ {
// the passed kart will not be modified, that's why I allow myself // the passed kart will not be modified, that's why I allow myself
// to use const_cast // to use const_cast
@ -299,9 +303,10 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
), ),
L"Unlocked" L"Unlocked"
); );
scene->addUnlockedTrack(track_manager->getTrack("lighthouse"));
StateManager::get()->pushScreen(scene); StateManager::get()->pushScreen(scene);
} }
else if (i % 2 == 1) else if (selection == "test_unlocked2")
{ {
std::vector<video::ITexture*> textures; std::vector<video::ITexture*> textures;
textures.push_back(irr_driver->getTexture( textures.push_back(irr_driver->getTexture(
@ -321,7 +326,6 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
StateManager::get()->pushScreen(scene); StateManager::get()->pushScreen(scene);
} }
*/
} }
else else
#endif #endif