mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:47:29 +08:00
Add flash when a new notification is displayed to draw attention
This commit is contained in:
parent
60413e3e7b
commit
7b006f1f22
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user