mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 19:22:54 +08:00
Add animation when mention pill appears (or a new message arrives)
This commit is contained in:
parent
11b050b66b
commit
692362131e
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Overlays.Chat.ChannelList
|
||||
{
|
||||
@ -20,6 +21,8 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
||||
|
||||
private OsuSpriteText countText = null!;
|
||||
|
||||
private Box box = null!;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour osuColour, OverlayColourProvider colourProvider)
|
||||
{
|
||||
@ -29,7 +32,7 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
box = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = osuColour.Orange1,
|
||||
@ -56,9 +59,12 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
||||
countText.Text = mentionCount > 99 ? "99+" : mentionCount.ToString();
|
||||
|
||||
if (mentionCount > 0)
|
||||
Show();
|
||||
{
|
||||
this.FadeIn(1000, Easing.OutQuint);
|
||||
box.FlashColour(Color4.White, 500, Easing.OutQuint);
|
||||
}
|
||||
else
|
||||
Hide();
|
||||
this.FadeOut(100, Easing.OutQuint);
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user