mirror of
https://github.com/ppy/osu.git
synced 2025-03-23 02:57:25 +08:00
Update BindableList usage in DrawableComment
This commit is contained in:
parent
3bf3becdd6
commit
c7d64d0015
@ -21,6 +21,7 @@ using System.Collections.Generic;
|
||||
using System;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace osu.Game.Overlays.Comments
|
||||
{
|
||||
@ -269,10 +270,21 @@ namespace osu.Game.Overlays.Comments
|
||||
});
|
||||
}
|
||||
|
||||
Replies.ItemsAdded += onRepliesAdded;
|
||||
|
||||
if (Replies.Any())
|
||||
onRepliesAdded(Replies);
|
||||
|
||||
Replies.CollectionChanged += (_, args) =>
|
||||
{
|
||||
switch (args.Action)
|
||||
{
|
||||
case NotifyCollectionChangedAction.Add:
|
||||
onRepliesAdded(args.NewItems.Cast<DrawableComment>());
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(@"You can only add replies to this list. Other actions are not supported.");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
Loading…
x
Reference in New Issue
Block a user