mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 07:33:20 +08:00
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 @@ namespace osu.Game.Online.Chat
|
||||
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 @@ namespace osu.Game.Overlays
|
||||
[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 @@ namespace osu.Game.Overlays
|
||||
|
||||
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
Block a user