1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-19 20:33:05 +08:00

Make it possible to retrieve notifications from NotificationOverlay

This commit is contained in:
Craftplacer 2019-12-17 06:55:48 +01:00
parent 1a1253a4aa
commit bea34e3aab
2 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,7 @@ using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Threading;
using System.Collections.Generic;
namespace osu.Game.Overlays
{
@ -22,6 +23,8 @@ namespace osu.Game.Overlays
public const float TRANSITION_LENGTH = 600;
public IEnumerable<Notification> Notifications => sections.Children.SelectMany(s => s.Notifications);
private FlowContainer<NotificationSection> sections;
/// <summary>

View File

@ -21,6 +21,8 @@ namespace osu.Game.Overlays.Notifications
private FlowContainer<Notification> notifications;
public IEnumerable<Notification> Notifications => notifications.Children;
public int DisplayedCount => notifications.Count(n => !n.WasClosed);
public int UnreadCount => notifications.Count(n => !n.WasClosed && !n.Read);