1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-30 10:15:09 +08:00
osu-lazer/osu.Game/Screens/Select/CollectionMenuItem.cs

56 lines
1.6 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using JetBrains.Annotations;
2020-09-07 20:08:48 +08:00
using osu.Framework.Bindables;
using osu.Game.Collections;
namespace osu.Game.Screens.Select
{
2020-09-07 20:08:48 +08:00
/// <summary>
/// A <see cref="BeatmapCollection"/> filter.
/// </summary>
2020-09-09 22:11:19 +08:00
public class CollectionMenuItem
{
2020-09-07 20:08:48 +08:00
/// <summary>
/// The collection to filter beatmaps from.
/// May be null to not filter by collection (include all beatmaps).
/// </summary>
[CanBeNull]
public readonly BeatmapCollection Collection;
2020-09-07 20:08:48 +08:00
/// <summary>
/// The name of the collection.
/// </summary>
[NotNull]
public readonly Bindable<string> CollectionName;
/// <summary>
2020-09-09 22:11:19 +08:00
/// Creates a new <see cref="CollectionMenuItem"/>.
2020-09-07 20:08:48 +08:00
/// </summary>
/// <param name="collection">The collection to filter beatmaps from.</param>
2020-09-09 22:11:19 +08:00
public CollectionMenuItem([CanBeNull] BeatmapCollection collection)
{
Collection = collection;
2020-09-07 20:08:48 +08:00
CollectionName = Collection?.Name.GetBoundCopy() ?? new Bindable<string>("All beatmaps");
}
}
2020-09-09 22:11:19 +08:00
public class AllBeatmapsCollectionMenuItem : CollectionMenuItem
{
2020-09-09 22:11:19 +08:00
public AllBeatmapsCollectionMenuItem()
: base(null)
{
}
}
2020-09-09 22:11:19 +08:00
public class ManageCollectionsMenuItem : CollectionMenuItem
{
2020-09-09 22:11:19 +08:00
public ManageCollectionsMenuItem()
: base(null)
{
2020-09-08 17:42:55 +08:00
CollectionName.Value = "Manage collections...";
}
}
}