Skip to content

Commit ee7c524

Browse files
committed
Allow queue completion notification to show even during gameplay
1 parent beb9778 commit ee7c524

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

osu.Game/Overlays/NotificationOverlay.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

osu.Game/Overlays/NotificationOverlayToastTray.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

osu.Game/Overlays/Notifications/Notification.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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; } = false;
46+
4247
/// <summary>
4348
/// Transient notifications only show as a toast, and do not linger in notification history.
4449
/// </summary>

osu.Game/Screens/OnlinePlay/Matchmaking/Queue/QueueController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ public partial class MatchFoundNotification : ProgressCompletionNotification
205205
{
206206
protected override IconUsage CloseButtonIcon => FontAwesome.Solid.Times;
207207

208+
public MatchFoundNotification()
209+
{
210+
IsCritical = true;
211+
}
212+
208213
[BackgroundDependencyLoader]
209214
private void load(OsuColour colours)
210215
{

0 commit comments

Comments
 (0)