1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-16 21:52:54 +08:00
osu-lazer/osu.Game/Overlays/BeatmapSet/MetadataSectionGenre.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
1014 B
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 System;
using osu.Framework.Extensions;
using osu.Game.Beatmaps;
using osu.Game.Graphics.Containers;
using osu.Game.Online.Chat;
using osu.Game.Overlays.BeatmapListing;
namespace osu.Game.Overlays.BeatmapSet
{
public partial class MetadataSectionGenre : MetadataSection<BeatmapSetOnlineGenre>
{
public MetadataSectionGenre(Action<BeatmapSetOnlineGenre>? searchAction = null)
: base(MetadataType.Genre, searchAction)
{
}
2022-12-24 03:11:15 +08:00
protected override void AddMetadata(BeatmapSetOnlineGenre metadata, LinkFlowContainer loaded)
{
2022-12-24 03:11:15 +08:00
var genre = (SearchGenre)metadata.Id;
if (Enum.IsDefined(genre))
loaded.AddLink(genre.GetLocalisableDescription(), LinkAction.FilterBeatmapSetGenre, genre);
else
2022-12-24 03:11:15 +08:00
loaded.AddText(metadata.Name);
}
}
}