Skip to content

Commit 3c6fb14

Browse files
authored
Merge pull request #35501 from peppy/more-quick-play-notification-improvements
More quick play notification improvements
2 parents 2f2847f + 3afc7b0 commit 3c6fb14

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
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; }
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: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
using osu.Framework.Bindables;
88
using osu.Framework.Extensions.ObjectExtensions;
99
using osu.Framework.Graphics;
10+
using osu.Framework.Graphics.Colour;
11+
using osu.Framework.Graphics.Sprites;
1012
using osu.Framework.Screens;
13+
using osu.Game.Graphics;
1114
using osu.Game.Online.Multiplayer;
1215
using osu.Game.Online.Rooms;
1316
using 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
}

0 commit comments

Comments
 (0)