mirror of
https://github.com/ppy/osu.git
synced 2025-03-06 05:12:55 +08:00
Fade out text instead of removing it immediately
This commit is contained in:
parent
cacef7421d
commit
4c10185f5b
@ -5,6 +5,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
@ -14,6 +15,7 @@ using osu.Game.Online.API;
|
|||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Menu
|
namespace osu.Game.Screens.Menu
|
||||||
{
|
{
|
||||||
@ -34,13 +36,16 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
private const float icon_y = -85;
|
private const float icon_y = -85;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private APIAccess api { get; set; }
|
||||||
|
|
||||||
public Disclaimer()
|
public Disclaimer()
|
||||||
{
|
{
|
||||||
ValidForResume = false;
|
ValidForResume = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, APIAccess api)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -96,12 +101,6 @@ namespace osu.Game.Screens.Menu
|
|||||||
t.Origin = Anchor.Centre;
|
t.Origin = Anchor.Centre;
|
||||||
}).First());
|
}).First());
|
||||||
|
|
||||||
api.LocalUser.BindValueChanged(user =>
|
|
||||||
{
|
|
||||||
if (user.NewValue.IsSupporter)
|
|
||||||
textFlow.RemoveRange(supporterDrawables);
|
|
||||||
}, true);
|
|
||||||
|
|
||||||
iconColour = colours.Yellow;
|
iconColour = colours.Yellow;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,6 +108,8 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
LoadComponentAsync(intro = new Intro());
|
LoadComponentAsync(intro = new Intro());
|
||||||
|
|
||||||
|
api.LocalUser.BindValueChanged(userChanged, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnEntering(IScreen last)
|
public override void OnEntering(IScreen last)
|
||||||
@ -134,5 +135,17 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
heart.FlashColour(Color4.White, 750, Easing.OutQuint).Loop();
|
heart.FlashColour(Color4.White, 750, Easing.OutQuint).Loop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnSuspending(IScreen next)
|
||||||
|
{
|
||||||
|
base.OnSuspending(next);
|
||||||
|
|
||||||
|
api.LocalUser.ValueChanged -= userChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void userChanged(ValueChangedEvent<User> user)
|
||||||
|
{
|
||||||
|
if (user.NewValue.IsSupporter) supporterDrawables.ForEach(d => d.FadeOut(200, Easing.OutQuint).Expire());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user