1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 09:07:25 +08:00

Add basic ordering

This commit is contained in:
smoogipoo 2020-09-02 21:19:15 +09:00
parent 094ddecc95
commit d363a5d164
3 changed files with 11 additions and 2 deletions

View File

@ -98,5 +98,14 @@ namespace osu.Game.Collections
public string Name;
public readonly BindableList<BeatmapInfo> Beatmaps = new BindableList<BeatmapInfo>();
public DateTimeOffset LastModifyTime { get; private set; }
public BeatmapCollection()
{
LastModifyTime = DateTimeOffset.UtcNow;
Beatmaps.CollectionChanged += (_, __) => LastModifyTime = DateTimeOffset.Now;
}
}
}

View File

@ -226,7 +226,7 @@ namespace osu.Game.Screens.Select.Carousel
items.Add(new OsuMenuItem("Add to...")
{
Items = collectionManager.Collections.Take(3).Select(createCollectionMenuItem)
Items = collectionManager.Collections.OrderByDescending(c => c.LastModifyTime).Take(3).Select(createCollectionMenuItem)
.Append(new OsuMenuItem("More...", MenuItemType.Standard, () => { }))
.ToArray()
});

View File

@ -147,7 +147,7 @@ namespace osu.Game.Screens.Select.Carousel
items.Add(new OsuMenuItem("Add all to...")
{
Items = collectionManager.Collections.Take(3).Select(createCollectionMenuItem)
Items = collectionManager.Collections.OrderByDescending(c => c.LastModifyTime).Take(3).Select(createCollectionMenuItem)
.Append(new OsuMenuItem("More...", MenuItemType.Standard, () => { }))
.ToArray()
});