1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 04:52:57 +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:
Dean Herbert 2023-08-22 16:44:16 +09:00 committed by GitHub
commit 36ebdd8d30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -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)
{

View File

@ -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;