2022-12-21 18:18:47 +00:00
|
|
|
// 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;
|
2022-12-21 19:02:04 +00:00
|
|
|
using osu.Game.Beatmaps;
|
2022-12-21 18:18:47 +00:00
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
using osu.Game.Online.Chat;
|
|
|
|
using osu.Game.Overlays.BeatmapListing;
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.BeatmapSet
|
|
|
|
{
|
2022-12-21 19:02:04 +00:00
|
|
|
public partial class MetadataSectionLanguage : MetadataSection<BeatmapSetOnlineLanguage>
|
2022-12-21 18:18:47 +00:00
|
|
|
{
|
2022-12-21 19:02:04 +00:00
|
|
|
public MetadataSectionLanguage(Action<BeatmapSetOnlineLanguage>? searchAction = null)
|
2022-12-21 18:18:47 +00:00
|
|
|
: base(MetadataType.Language, searchAction)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-12-23 19:11:15 +00:00
|
|
|
protected override void AddMetadata(BeatmapSetOnlineLanguage metadata, LinkFlowContainer loaded)
|
2022-12-21 18:18:47 +00:00
|
|
|
{
|
2022-12-23 19:11:15 +00:00
|
|
|
var language = (SearchLanguage)metadata.Id;
|
2022-12-21 19:02:04 +00:00
|
|
|
|
|
|
|
if (Enum.IsDefined(language))
|
|
|
|
loaded.AddLink(language.GetLocalisableDescription(), LinkAction.FilterBeatmapSetLanguage, language);
|
|
|
|
else
|
2022-12-23 19:11:15 +00:00
|
|
|
loaded.AddText(metadata.Name);
|
2022-12-21 18:18:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|