mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 16:13:34 +08:00
Merge pull request #26920 from peppy/2fa-visibility
Give better visibility when the game is pending 2FA
This commit is contained in:
commit
5260b8cae0
@ -19,6 +19,11 @@ namespace osu.Game.Localisation
|
||||
/// </summary>
|
||||
public static LocalisableString Connecting => new TranslatableString(getKey(@"connecting"), @"Connecting...");
|
||||
|
||||
/// <summary>
|
||||
/// "Verification required"
|
||||
/// </summary>
|
||||
public static LocalisableString VerificationRequired => new TranslatableString(getKey(@"verification_required"), @"Verification required");
|
||||
|
||||
/// <summary>
|
||||
/// "home"
|
||||
/// </summary>
|
||||
|
@ -95,11 +95,10 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule(() =>
|
||||
{
|
||||
failingIcon.FadeTo(state.NewValue == APIState.Failing ? 1 : 0, 200, Easing.OutQuint);
|
||||
failingIcon.FadeTo(state.NewValue == APIState.Failing || state.NewValue == APIState.RequiresSecondFactorAuth ? 1 : 0, 200, Easing.OutQuint);
|
||||
|
||||
switch (state.NewValue)
|
||||
{
|
||||
case APIState.RequiresSecondFactorAuth:
|
||||
case APIState.Connecting:
|
||||
TooltipText = ToolbarStrings.Connecting;
|
||||
spinner.Show();
|
||||
@ -108,6 +107,13 @@ namespace osu.Game.Overlays.Toolbar
|
||||
case APIState.Failing:
|
||||
TooltipText = ToolbarStrings.AttemptingToReconnect;
|
||||
spinner.Show();
|
||||
failingIcon.Icon = FontAwesome.Solid.ExclamationTriangle;
|
||||
break;
|
||||
|
||||
case APIState.RequiresSecondFactorAuth:
|
||||
TooltipText = ToolbarStrings.VerificationRequired;
|
||||
spinner.Show();
|
||||
failingIcon.Icon = FontAwesome.Solid.Key;
|
||||
break;
|
||||
|
||||
case APIState.Offline:
|
||||
|
@ -280,7 +280,7 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
sideFlashes.Delay(FADE_IN_DURATION).FadeIn(64, Easing.InQuint);
|
||||
}
|
||||
else if (!api.IsLoggedIn)
|
||||
else if (!api.IsLoggedIn || api.State.Value == APIState.RequiresSecondFactorAuth)
|
||||
{
|
||||
// copy out old action to avoid accidentally capturing logo.Action in closure, causing a self-reference loop.
|
||||
var previousAction = logo.Action;
|
||||
|
Loading…
Reference in New Issue
Block a user