本文整理汇总了C++中PlayerProfile::isFirstTime方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerProfile::isFirstTime方法的具体用法?C++ PlayerProfile::isFirstTime怎么用?C++ PlayerProfile::isFirstTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerProfile
的用法示例。
在下文中一共展示了PlayerProfile::isFirstTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventCallback
//.........这里部分代码省略.........
race_manager->setTrack( "tutorial" );
race_manager->setDifficulty(RaceManager::DIFFICULTY_EASY);
race_manager->setReverseTrack(false);
// Use keyboard 0 by default (FIXME: let player choose?)
InputDevice* device = input_manager->getDeviceManager()->getKeyboard(0);
// Create player and associate player with keyboard
StateManager::get()->createActivePlayer(PlayerManager::getCurrentPlayer(),
device);
if (kart_properties_manager->getKart(UserConfigParams::m_default_kart) == NULL)
{
Log::warn("MainMenuScreen", "Cannot find kart '%s', will revert to default",
UserConfigParams::m_default_kart.c_str());
UserConfigParams::m_default_kart.revertToDefaults();
}
race_manager->setPlayerKart(0, UserConfigParams::m_default_kart);
// ASSIGN should make sure that only input from assigned devices
// is read.
input_manager->getDeviceManager()->setAssignMode(ASSIGN);
input_manager->getDeviceManager()
->setSinglePlayer( StateManager::get()->getActivePlayer(0) );
StateManager::get()->enterGameState();
race_manager->setupPlayerKartInfo();
race_manager->startNew(false);
}
else if (selection == "story")
{
NetworkConfig::get()->unsetNetworking();
PlayerProfile *player = PlayerManager::getCurrentPlayer();
if (player->isFirstTime())
{
CutsceneWorld::setUseDuration(true);
StateManager::get()->enterGameState();
race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE);
race_manager->setNumKarts( 0 );
race_manager->setNumPlayers(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);
//race_manager->startSingleRace("introcutscene2", 999, false);
return;
}
else
{
const std::string default_kart = UserConfigParams::m_default_kart;
if (player->isLocked(default_kart))
{
KartSelectionScreen *next = OfflineKartSelectionScreen::getInstance();
next->setGoToOverworldNext();
next->setMultiplayer(false);
StateManager::get()->resetAndGoToScreen(next);
return;
}
OverWorld::enterOverWorld();
}
}
else if (selection == "online")
{
if(UserConfigParams::m_internet_status!=RequestManager::IPERM_ALLOWED)
示例2: eventCallback
//.........这里部分代码省略.........
}
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);
race_manager->setReverseTrack(false);
// 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(PlayerManager::get()->getCurrentPlayer(),
device, NULL);
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();
race_manager->setupPlayerKartInfo();
race_manager->startNew(false);
}
else if (selection == "story")
{
PlayerProfile *player = PlayerManager::get()->getCurrentPlayer();
if (player->isFirstTime())
{
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);
//race_manager->startSingleRace("introcutscene2", 999, false);
return;
}
else
{
const std::string default_kart = UserConfigParams::m_default_kart;
if (player->isLocked(default_kart))
{
KartSelectionScreen *next = OfflineKartSelectionScreen::getInstance();
next->setGoToOverworldNext();
next->setMultiplayer(false);
StateManager::get()->resetAndGoToScreen(next);
return;
}
OverWorld::enterOverWorld();
}
}
else if (selection == "online")
{
if(UserConfigParams::m_internet_status!=RequestManager::IPERM_ALLOWED)
{
new MessageDialog(_("You can not play online without internet access. "
"If you want to play online, go to options, select "
" tab 'User Interface', and edit "
"\"Allow STK to connect to the Internet\"."));
return;
}
if(CurrentUser::get()->getID())
StateManager::get()->pushScreen(OnlineScreen::getInstance());
else
StateManager::get()->pushScreen(LoginScreen::getInstance());
}
else if (selection == "addons")
{
// Don't go to addons if there is no internet, unless some addons are
// already installed (so that you can delete addons without being online).
if(UserConfigParams::m_internet_status!=RequestManager::IPERM_ALLOWED &&
!addons_manager->anyAddonsInstalled())
{
new MessageDialog(_("You can not download addons without internet access. "
"If you want to download addons, go to options, select "
" tab 'User Interface', and edit "
"\"Allow STK to connect to the Internet\"."));
return;
}
StateManager::get()->pushScreen(AddonsScreen::getInstance());
}
} // eventCallback