1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 05:27:23 +08:00

Add flash when a new notification is displayed to draw attention

This commit is contained in:
Dean Herbert 2022-08-30 20:34:27 +09:00
parent 60413e3e7b
commit 7b006f1f22

View File

@ -61,6 +61,8 @@ namespace osu.Game.Overlays.Notifications
[Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!;
private readonly Box initialFlash;
private Box background = null!;
protected Notification()
@ -133,6 +135,12 @@ namespace osu.Game.Overlays.Notifications
}
},
},
initialFlash = new Box
{
Colour = Color4.White.Opacity(0.8f),
RelativeSizeAxes = Axes.Both,
Blending = BlendingParameters.Additive,
},
}
}
};
@ -177,6 +185,8 @@ namespace osu.Game.Overlays.Notifications
MainContent.MoveToX(DrawSize.X);
MainContent.MoveToX(0, 500, Easing.OutQuint);
initialFlash.FadeOutFromOne(2000, Easing.OutQuart);
}
public bool WasClosed;