Disable online/login widget while login/logout are in progress (to

avoid race conditions, i.e. a new login arriving at server before
previous logout was processed).
This commit is contained in:
hiker
2014-01-22 16:43:59 +11:00
parent 2821913b47
commit 476d7db741

View File

@@ -144,6 +144,20 @@ void MainMenuScreen::init()
void MainMenuScreen::onUpdate(float delta)
{
if(CurrentUser::get()->getUserState()==CurrentUser::US_GUEST ||
CurrentUser::get()->getUserState()==CurrentUser::US_SIGNED_IN)
{
m_online->setActivated();
m_online->setLabel( _("Online"));
}
else if(CurrentUser::get()->getUserState()==CurrentUser::US_SIGNED_OUT)
{
m_online->setActivated();
m_online->setLabel( _("Login" ));
}
else // now must be either logging in or logging out
m_online->setDeactivated();
m_online->setLabel(CurrentUser::get()->getID() ? _("Online")
: _("Login" ) );
IconButtonWidget* addons_icon = getWidget<IconButtonWidget>("addons");