Support automatic online login even if current user is not saved

(i.e. online login is now started after the player is selected).
This commit is contained in:
hiker 2014-04-15 09:07:13 +10:00
parent f33a9f7cf6
commit 3b85f601b1

View File

@ -22,6 +22,7 @@
#include "config/user_config.hpp"
#include "guiengine/widgets/check_box_widget.hpp"
#include "guiengine/widgets/list_widget.hpp"
#include "online/current_user.hpp"
#include "states_screens/dialogs/enter_player_name_dialog.hpp"
#include "states_screens/main_menu_screen.hpp"
#include "states_screens/state_manager.hpp"
@ -119,6 +120,11 @@ void StoryModeLobbyScreen::eventCallback(Widget* widget,
}
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
// Since only now the current player is defined, we have to request
// a login (if an online login was saved). If the current player was
// saved, this request will be started much earlier in the startup
// sequence from the RequestManager.
player->getCurrentUser()->requestSavedSession();
}
} // eventCallback