Add better messaging when connecting or failing

This commit is contained in:
Dean Herbert
2018-12-26 18:05:12 +09:00
parent 7c1e3d66eb
commit 63847890d1
2 changed files with 35 additions and 15 deletions

View File

@ -17,6 +17,7 @@ using osu.Game.Graphics;
using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Input.Events;
using osu.Game.Graphics.Containers;
using RectangleF = osu.Framework.Graphics.Primitives.RectangleF;
using Container = osu.Framework.Graphics.Containers.Container;
@ -86,25 +87,29 @@ namespace osu.Game.Overlays.Settings.Sections.General
};
break;
case APIState.Failing:
Children = new Drawable[]
{
new OsuSpriteText
{
Text = "Connection failing :(",
},
};
break;
case APIState.Connecting:
LinkFlowContainer linkFlow;
Children = new Drawable[]
{
new OsuSpriteText
new LoadingAnimation
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Text = "Connecting...",
State = Visibility.Visible,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
linkFlow = new LinkFlowContainer
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
TextAnchor = Anchor.TopCentre,
AutoSizeAxes = Axes.Both,
Text = state == APIState.Failing ? "Connection is failing, will attempt to reconnect... " : "Attempting to connect... ",
Margin = new MarginPadding { Top = 10, Bottom = 10 },
},
};
linkFlow.AddLink("cancel", api.Logout, string.Empty);
break;
case APIState.Online:
Children = new Drawable[]