File tree Expand file tree Collapse file tree 4 files changed +31
-3
lines changed
Screens/OnlinePlay/Matchmaking/Queue Expand file tree Collapse file tree 4 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -162,16 +162,17 @@ protected override void LoadComplete()
162162 private int runningDepth ;
163163
164164 private readonly Scheduler postScheduler = new Scheduler ( ) ;
165+ private readonly Scheduler criticalPostScheduler = new Scheduler ( ) ;
165166
166167 public override bool IsPresent =>
167168 // Delegate presence as we need to consider the toast tray in addition to the main overlay.
168- State . Value == Visibility . Visible || mainContent . IsPresent || toastTray . IsPresent || postScheduler . HasPendingTasks ;
169+ State . Value == Visibility . Visible || mainContent . IsPresent || toastTray . IsPresent || postScheduler . HasPendingTasks || criticalPostScheduler . HasPendingTasks ;
169170
170171 private bool processingPosts = true ;
171172
172173 private double ? lastSamplePlayback ;
173174
174- public void Post ( Notification notification ) => postScheduler . Add ( ( ) =>
175+ public void Post ( Notification notification ) => ( notification . IsCritical ? criticalPostScheduler : postScheduler ) . Add ( ( ) =>
175176 {
176177 ++ runningDepth ;
177178
@@ -220,6 +221,8 @@ protected override void Update()
220221 {
221222 base . Update ( ) ;
222223
224+ criticalPostScheduler . Update ( ) ;
225+
223226 if ( processingPosts )
224227 postScheduler . Update ( ) ;
225228 }
Original file line number Diff line number Diff line change @@ -91,7 +91,12 @@ private void load()
9191 public void FlushAllToasts ( )
9292 {
9393 foreach ( var notification in toastFlow . ToArray ( ) )
94+ {
95+ if ( notification . IsCritical )
96+ continue ;
97+
9498 forwardNotification ( notification ) ;
99+ }
95100 }
96101
97102 public void Post ( Notification notification )
Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ public abstract partial class Notification : Container
3939 /// </summary>
4040 public bool IsImportant { get ; init ; } = true ;
4141
42+ /// <summary>
43+ /// Critical notifications show even during gameplay or other scenarios where notifications would usually be suppressed.
44+ /// </summary>
45+ public bool IsCritical { get ; init ; }
46+
4247 /// <summary>
4348 /// Transient notifications only show as a toast, and do not linger in notification history.
4449 /// </summary>
Original file line number Diff line number Diff line change 77using osu . Framework . Bindables ;
88using osu . Framework . Extensions . ObjectExtensions ;
99using osu . Framework . Graphics ;
10+ using osu . Framework . Graphics . Colour ;
11+ using osu . Framework . Graphics . Sprites ;
1012using osu . Framework . Screens ;
13+ using osu . Game . Graphics ;
1114using osu . Game . Online . Multiplayer ;
1215using osu . Game . Online . Rooms ;
1316using osu . Game . Overlays ;
@@ -200,7 +203,19 @@ public void CloseAll()
200203
201204 public partial class MatchFoundNotification : ProgressCompletionNotification
202205 {
203- // for future use.
206+ protected override IconUsage CloseButtonIcon => FontAwesome . Solid . Times ;
207+
208+ public MatchFoundNotification ( )
209+ {
210+ IsCritical = true ;
211+ }
212+
213+ [ BackgroundDependencyLoader ]
214+ private void load ( OsuColour colours )
215+ {
216+ Icon = FontAwesome . Solid . Bolt ;
217+ IconContent . Colour = ColourInfo . GradientVertical ( colours . YellowDark , colours . YellowLight ) ;
218+ }
204219 }
205220 }
206221 }
You can’t perform that action at this time.
0 commit comments