本文整理汇总了C++中PlayerInfo::PIGetString方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerInfo::PIGetString方法的具体用法?C++ PlayerInfo::PIGetString怎么用?C++ PlayerInfo::PIGetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerInfo
的用法示例。
在下文中一共展示了PlayerInfo::PIGetString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnQuickStartButton
static void OnQuickStartButton()
{
SetGameMode(AMJU_MODE_NONE);
static PlayerInfoManager* pim = ThePlayerInfoManager::Instance();
PlayerInfo* pi = pim->GetPI();
Assert(pi);
std::string email = pi->PIGetString(PI_KEY("email"));
TheGSLoginWaiting::Instance()->SetEmail(email);
TheGame::Instance()->SetCurrentState(TheGSLoginWaiting::Instance());
}
示例2: OnActive
void GSTitle::OnActive()
{
static bool first = true;
if (first)
{
first = false;
TheAvatarManager::Instance()->Load();
// Set default keyboard layout
KbSetLayout(KB_LAYOUT_REGULAR);
TheGSOptions::Instance()->LoadFromConfig();
}
// Kill off any dummy player object
TheGame::Instance()->ClearGameObjects();
#ifdef SHOW_FRAME_TIME
Font* font = (Font*)TheResourceManager::Instance()->GetRes("font2d/arial-font.font");
TheGame::Instance()->SetFrameTimeFont(font);
#endif
GSGui::OnActive();
if (!m_titleImage.OpenAndLoad("title-bgimage.txt"))
{
std::cout << "Failed to load GUI title bg image!\n";
Assert(0);
}
m_gui = LoadGui("gui-title.txt");
Assert(m_gui);
GuiButton* start = (GuiButton*)GetElementByName(m_gui, "start-button");
start->SetCommand(Amju::OnStartButton);
start->SetHasFocus(true);
GuiButton* options = (GuiButton*)GetElementByName(m_gui, "options-button");
options->SetCommand(Amju::OnOptionsButton);
GuiButton* quick = (GuiButton*)GetElementByName(m_gui, "quick-start-button");
static PlayerInfoManager* pim = ThePlayerInfoManager::Instance();
if (pim->GetNumPlayerNames() > 0)
{
quick->SetVisible(true);
quick->SetCommand(Amju::OnQuickStartButton);
quick->SetHasFocus(true);
// Change button text to player name
Strings names = pim->GetPlayerNames();
Assert(!names.empty());
pim->SetCurrentPlayer(names[0]);
PlayerInfo* pi = pim->GetPI();
Assert(pi);
std::string playername = pi->PIGetString(PI_KEY("playername"));
quick->SetText(playername);
}
else
{
quick->SetVisible(false);
}
GuiButton* quit = (GuiButton*)GetElementByName(m_gui, "quit-button");
quit->SetCommand(Amju::OnQuitButton);
quit->SetIsCancelButton(true);
#ifdef SHOW_VERSION
GuiText* ver = (GuiText*)GetElementByName(m_gui, "version");
std::string s = "v." + ToString(VersionMajor) + "." + ToString(VersionMinor);
#ifdef _DEBUG
s += " DEBUG";
#endif
ver->SetText(s);
#endif
//CreateText("my game");
#ifdef PLAY_MUSIC
TheSoundManager::Instance()->PlaySong(ROConfig()->GetValue("music-title", "Sound/hammers.it"));
#endif
}