Make the osu! logo shared game-wide

There should only ever be one osu! logo. It is now passed around between screens in a superfluous manner.
This commit is contained in:
Dean Herbert
2017-11-01 20:54:58 +09:00
parent 7fa3ac8cf2
commit b8b05fe8d2
9 changed files with 289 additions and 109 deletions

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@ -102,6 +103,29 @@ namespace osu.Game.Screens.Menu
Beatmap.ValueChanged += beatmap_ValueChanged;
}
protected override void LogoSetup(OsuLogo logo, bool resuming)
{
base.LogoSetup(logo, resuming);
buttons.SetOsuLogo(logo);
logo.Triangles = true;
logo.Ripple = false;
logo.FadeColour(Color4.White, 100, Easing.OutQuint);
logo.FadeIn(100, Easing.OutQuint);
if (resuming)
buttons.State = MenuState.TopLevel;
}
protected override void LogoOnSuspending(OsuLogo logo)
{
logo.FadeOut(300, Easing.InSine)
.ScaleTo(0.2f, 300, Easing.InSine)
.OnComplete(l => buttons.SetOsuLogo(null));
}
private void beatmap_ValueChanged(WorkingBeatmap newValue)
{
if (!IsCurrentScreen)
@ -135,8 +159,6 @@ namespace osu.Game.Screens.Menu
const float length = 300;
buttons.State = MenuState.TopLevel;
Content.FadeIn(length, Easing.OutQuint);
Content.MoveTo(new Vector2(0, 0), length, Easing.OutQuint);