当前位置: 首页>>代码示例>>C++>>正文


C++ PlayerProfile::rememberPassword方法代码示例

本文整理汇总了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
开发者ID:devnexen,项目名称:stk-code,代码行数:56,代码来源:user_screen.cpp

示例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
开发者ID:kunal-d,项目名称:stk-code,代码行数:43,代码来源:user_screen.cpp


注:本文中的PlayerProfile::rememberPassword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。