Fixed #1622 (missing password field in login screen).

This commit is contained in:
hiker 2014-10-15 08:20:06 +11:00
parent eec19b0703
commit 607e94ea84

View File

@ -212,11 +212,15 @@ void BaseUserScreen::makeEntryFieldsVisible()
getWidget<LabelWidget>("label_remember")->setVisible(online);
getWidget<CheckBoxWidget>("remember-user")->setVisible(online);
PlayerProfile *player = getSelectedPlayer();
// Don't show the password fields if the player wants to be online
// and either is the current player (no need to enter a password then)
// or has a saved session.
// and either is the current player and logged in (no need to enter a
// password then) or has a saved session.
if(player && online &&
(player->hasSavedSession() || player==PlayerManager::getCurrentPlayer()))
(player->hasSavedSession() ||
(player==PlayerManager::getCurrentPlayer() && player->isLoggedIn() )
)
)
{
// If we show the online login fields, but the player has a
// saved session, don't show the password field.
@ -451,6 +455,7 @@ void BaseUserScreen::onUpdate(float dt)
{
player->clearSession();
makeEntryFieldsVisible();
m_username_tb->setText(player->getLastOnlineName());
}
}
} // onUpdate