本文整理汇总了C++中PlayerProfile::rememberPassword方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerProfile::rememberPassword方法的具体用法?C++ PlayerProfile::rememberPassword怎么用?C++ PlayerProfile::rememberPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerProfile
的用法示例。
在下文中一共展示了PlayerProfile::rememberPassword方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selectUser
/** Called when a user is selected. It updates the online checkbox and
* entry fields.
*/
void BaseUserScreen::selectUser(int index)
{
PlayerProfile *profile = PlayerManager::get()->getPlayer(index);
assert(profile);
// Only set focus in case of non-tabbed version (so that keyboard
// or gamepad navigation with tabs works as expected, i.e. you can
// select the next tab without having to go up to the tab list first.
bool focus_it = !getWidget<RibbonWidget>("options_choice");
m_players->setSelection(StringUtils::toString(index), PLAYER_ID_GAME_MASTER,
focus_it);
if (!m_new_registered_data)
m_username_tb->setText(profile->getLastOnlineName(true/*ignoreRTL*/));
if (!m_new_registered_data)
{
// Delete a password that might have been typed for another user
m_password_tb->setText("");
}
getWidget<CheckBoxWidget>("remember-user")->setState(
profile->rememberPassword());
// Last game was not online, so make the offline settings the default
// (i.e. unckeck online checkbox, and make entry fields invisible).
if (!profile->wasOnlineLastTime() || profile->getLastOnlineName() == "")
{
if (!m_new_registered_data)
m_online_cb->setState(false);
makeEntryFieldsVisible();
return;
}
// Now last use was with online --> Display the saved data
if (UserConfigParams::m_internet_status == Online::RequestManager::IPERM_NOT_ALLOWED)
m_online_cb->setState(false);
else
m_online_cb->setState(true);
makeEntryFieldsVisible();
m_username_tb->setActive(profile->getLastOnlineName().size() == 0);
// And make the password invisible if the session is saved (i.e
// the user does not need to enter a password).
if (profile->hasSavedSession())
{
m_password_tb->setVisible(false);
getWidget<LabelWidget>("label_password")->setVisible(false);
getWidget<ButtonWidget>("password_reset")->setVisible(false);
}
} // selectUser
示例2: selectUser
/** Called when a user is selected. It updates the online checkbox and
* entrye fields.
*/
void BaseUserScreen::selectUser(int index)
{
PlayerProfile *profile = PlayerManager::get()->getPlayer(index);
assert(profile);
m_players->setSelection(StringUtils::toString(index), PLAYER_ID_GAME_MASTER,
/*focusIt*/ true);
m_username_tb->setText(profile->getLastOnlineName());
// Delete a password that might have been typed for another user
m_password_tb->setText("");
// Last game was not online, so make the offline settings the default
// (i.e. unckeck online checkbox, and make entry fields invisible).
if (!profile->wasOnlineLastTime() || profile->getLastOnlineName() == "")
{
m_online_cb->setState(false);
makeEntryFieldsVisible();
return;
}
// Now last use was with online --> Display the saved data
m_online_cb->setState(true);
makeEntryFieldsVisible();
getWidget<CheckBoxWidget>("remember-user")->setState(
profile->rememberPassword());
if(profile->getLastOnlineName().size()>0)
m_username_tb->setDeactivated();
else
m_username_tb->setActivated();
// And make the password invisible if the session is saved (i.e
// the user does not need to enter a password).
if (profile->hasSavedSession())
{
m_password_tb->setVisible(false);
getWidget<LabelWidget>("label_password")->setVisible(false);
}
} // selectUser