mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 20:32:55 +08:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into profile-ruleset-selector-improvements
This commit is contained in:
commit
8fde92c595
44
osu.Game/Graphics/UserInterface/DimmedLoadingLayer.cs
Normal file
44
osu.Game/Graphics/UserInterface/DimmedLoadingLayer.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osuTK.Graphics;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.UserInterface
|
||||||
|
{
|
||||||
|
public class DimmedLoadingLayer : VisibilityContainer
|
||||||
|
{
|
||||||
|
private const float transition_duration = 250;
|
||||||
|
|
||||||
|
private readonly LoadingAnimation loading;
|
||||||
|
|
||||||
|
public DimmedLoadingLayer()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Color4.Black.Opacity(0.5f),
|
||||||
|
},
|
||||||
|
loading = new LoadingAnimation(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void PopIn()
|
||||||
|
{
|
||||||
|
this.FadeIn(transition_duration, Easing.OutQuint);
|
||||||
|
loading.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void PopOut()
|
||||||
|
{
|
||||||
|
this.FadeOut(transition_duration, Easing.OutQuint);
|
||||||
|
loading.Hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -35,7 +35,7 @@ namespace osu.Game.Screens.Select
|
|||||||
private readonly MetadataSection description, source, tags;
|
private readonly MetadataSection description, source, tags;
|
||||||
private readonly Container failRetryContainer;
|
private readonly Container failRetryContainer;
|
||||||
private readonly FailRetryGraph failRetryGraph;
|
private readonly FailRetryGraph failRetryGraph;
|
||||||
private readonly DimmedLoadingAnimation loading;
|
private readonly DimmedLoadingLayer loading;
|
||||||
|
|
||||||
private IAPIProvider api;
|
private IAPIProvider api;
|
||||||
|
|
||||||
@ -156,10 +156,7 @@ namespace osu.Game.Screens.Select
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
loading = new DimmedLoadingAnimation
|
loading = new DimmedLoadingLayer(),
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,35 +362,5 @@ namespace osu.Game.Screens.Select
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DimmedLoadingAnimation : VisibilityContainer
|
|
||||||
{
|
|
||||||
private readonly LoadingAnimation loading;
|
|
||||||
|
|
||||||
public DimmedLoadingAnimation()
|
|
||||||
{
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Colour = Color4.Black.Opacity(0.5f),
|
|
||||||
},
|
|
||||||
loading = new LoadingAnimation(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void PopIn()
|
|
||||||
{
|
|
||||||
this.FadeIn(transition_duration, Easing.OutQuint);
|
|
||||||
loading.Show();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void PopOut()
|
|
||||||
{
|
|
||||||
this.FadeOut(transition_duration, Easing.OutQuint);
|
|
||||||
loading.Hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user