Add animation when mention pill appears (or a new message arrives)

This commit is contained in:
Dean Herbert 2022-03-21 14:31:51 +09:00
parent 11b050b66b
commit 692362131e
1 changed files with 9 additions and 3 deletions

View File

@ -11,6 +11,7 @@
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays.Chat.ChannelList
{
@ -20,6 +21,8 @@ public class ChannelListItemMentionPill : CircularContainer
private OsuSpriteText countText = null!;
private Box box = null!;
[BackgroundDependencyLoader]
private void load(OsuColour osuColour, OverlayColourProvider colourProvider)
{
@ -29,7 +32,7 @@ private void load(OsuColour osuColour, OverlayColourProvider colourProvider)
Children = new Drawable[]
{
new Box
box = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = osuColour.Orange1,
@ -56,9 +59,12 @@ protected override void LoadComplete()
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);
}
}