mirror of https://github.com/ppy/osu
Merge pull request #24588 from ItsShamed/ux/notifications/flash-on-message
Flash taskbar when receiving notifications while the game is not focused
This commit is contained in:
commit
36ebdd8d30
|
@ -182,8 +182,6 @@ protected HighlightMessageNotification(Message message, Channel channel)
|
|||
private readonly Message message;
|
||||
private readonly Channel channel;
|
||||
|
||||
public override bool IsImportant => false;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours, ChatOverlay chatOverlay, INotificationOverlay notificationOverlay)
|
||||
{
|
||||
|
|
|
@ -43,6 +43,9 @@ public partial class NotificationOverlay : OsuFocusedOverlayContainer, INamedOve
|
|||
[Resolved]
|
||||
private AudioManager audio { get; set; } = null!;
|
||||
|
||||
[Resolved]
|
||||
private OsuGame? game { get; set; }
|
||||
|
||||
[Cached]
|
||||
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
|
||||
|
||||
|
@ -176,6 +179,12 @@ public void Post(Notification notification) => postScheduler.Add(() =>
|
|||
|
||||
playDebouncedSample(notification.PopInSampleName);
|
||||
|
||||
if (notification.IsImportant)
|
||||
{
|
||||
game?.Window?.Flash();
|
||||
notification.Closed += () => game?.Window?.CancelFlash();
|
||||
}
|
||||
|
||||
if (State.Value == Visibility.Hidden)
|
||||
{
|
||||
notification.IsInToastTray = true;
|
||||
|
|
Loading…
Reference in New Issue