1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-04 10:32:58 +08:00

Update loader look

This commit is contained in:
Dean Herbert 2020-03-11 02:49:34 +09:00
parent b8d3e64416
commit 4012e878b0
2 changed files with 21 additions and 24 deletions

View File

@ -27,7 +27,8 @@ namespace osu.Game.Graphics.UserInterface
/// Constuct a new loading spinner. /// Constuct a new loading spinner.
/// </summary> /// </summary>
/// <param name="withBox">Whether the spinner should have a surrounding black box for visibility.</param> /// <param name="withBox">Whether the spinner should have a surrounding black box for visibility.</param>
public LoadingSpinner(bool withBox = false) /// <param name="inverted">Whether colours should be inverted (black spinner instead of white).</param>
public LoadingSpinner(bool withBox = false, bool inverted = false)
{ {
Size = new Vector2(60); Size = new Vector2(60);
@ -45,7 +46,7 @@ namespace osu.Game.Graphics.UserInterface
{ {
new Box new Box
{ {
Colour = Color4.Black, Colour = inverted ? Color4.White : Color4.Black,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Alpha = withBox ? 0.7f : 0 Alpha = withBox ? 0.7f : 0
}, },
@ -53,6 +54,7 @@ namespace osu.Game.Graphics.UserInterface
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Colour = inverted ? Color4.Black : Color4.White,
Scale = new Vector2(withBox ? 0.6f : 1), Scale = new Vector2(withBox ? 0.6f : 1),
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Icon = FontAwesome.Solid.CircleNotch Icon = FontAwesome.Solid.CircleNotch

View File

@ -8,9 +8,10 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Shaders; using osu.Framework.Graphics.Shaders;
using osu.Framework.Utils; using osu.Framework.Utils;
using osu.Game.Screens.Menu; using osu.Game.Screens.Menu;
using osuTK;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Framework.Threading;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
using IntroSequence = osu.Game.Configuration.IntroSequence; using IntroSequence = osu.Game.Configuration.IntroSequence;
namespace osu.Game.Screens namespace osu.Game.Screens
@ -24,31 +25,12 @@ namespace osu.Game.Screens
ValidForResume = false; ValidForResume = false;
} }
protected override void LogoArriving(OsuLogo logo, bool resuming)
{
base.LogoArriving(logo, resuming);
logo.BeatMatching = false;
logo.Triangles = false;
logo.RelativePositionAxes = Axes.None;
logo.Origin = Anchor.BottomRight;
logo.Anchor = Anchor.BottomRight;
logo.Position = new Vector2(-40);
logo.Scale = new Vector2(0.2f);
logo.Delay(500).FadeInFromZero(1000, Easing.OutQuint);
}
protected override void LogoSuspending(OsuLogo logo)
{
base.LogoSuspending(logo);
logo.FadeOut(logo.Alpha * 400);
}
private OsuScreen loadableScreen; private OsuScreen loadableScreen;
private ShaderPrecompiler precompiler; private ShaderPrecompiler precompiler;
private IntroSequence introSequence; private IntroSequence introSequence;
private LoadingSpinner spinner;
private ScheduledDelegate spinnerShow;
protected virtual OsuScreen CreateLoadableScreen() protected virtual OsuScreen CreateLoadableScreen()
{ {
@ -82,6 +64,17 @@ namespace osu.Game.Screens
LoadComponentAsync(precompiler = CreateShaderPrecompiler(), AddInternal); LoadComponentAsync(precompiler = CreateShaderPrecompiler(), AddInternal);
LoadComponentAsync(loadableScreen = CreateLoadableScreen()); LoadComponentAsync(loadableScreen = CreateLoadableScreen());
LoadComponentAsync(spinner = new LoadingSpinner(true, true)
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
Margin = new MarginPadding(40),
}, _ =>
{
AddInternal(spinner);
spinnerShow = Scheduler.AddDelayed(spinner.Show, 200);
});
checkIfLoaded(); checkIfLoaded();
} }
@ -93,6 +86,8 @@ namespace osu.Game.Screens
return; return;
} }
spinnerShow?.Cancel();
spinner.Hide();
this.Push(loadableScreen); this.Push(loadableScreen);
} }