Better fix for login screen

This commit is contained in:
Deve 2018-03-14 20:49:05 +01:00
parent 6621196266
commit a3c0254f81
2 changed files with 13 additions and 4 deletions

View File

@ -1746,10 +1746,12 @@ int main(int argc, char *argv[] )
// so we immediately start the main menu (unless it was requested // so we immediately start the main menu (unless it was requested
// to always show the login screen). Otherwise show the login // to always show the login screen). Otherwise show the login
// screen first. // screen first.
MainMenuScreen::getInstance()->push(); if(PlayerManager::getCurrentPlayer() && !
if (!PlayerManager::getCurrentPlayer() ||
UserConfigParams::m_always_show_login_screen) UserConfigParams::m_always_show_login_screen)
{
MainMenuScreen::getInstance()->push();
}
else
{ {
UserScreen::getInstance()->push(); UserScreen::getInstance()->push();
// If there is no player, push the RegisterScreen on top of // If there is no player, push the RegisterScreen on top of

View File

@ -405,8 +405,15 @@ void BaseUserScreen::eventCallback(Widget* widget,
* next. * next.
*/ */
void BaseUserScreen::closeScreen() void BaseUserScreen::closeScreen()
{
if (StateManager::get()->getMenuStackSize() > 1)
{ {
StateManager::get()->popMenu(); StateManager::get()->popMenu();
}
else
{
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
}
} // closeScreen } // closeScreen
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------