mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 15:03:12 +08:00
Merge pull request #11473 from frenzibyte/explicit-search-control
Add "explicit maps" search filter control to beatmap listing
This commit is contained in:
commit
5e0fcc4a6c
@ -7,6 +7,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.BeatmapListing;
|
using osu.Game.Overlays.BeatmapListing;
|
||||||
@ -19,9 +20,18 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
[Cached]
|
[Cached]
|
||||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
||||||
|
|
||||||
private readonly BeatmapListingSearchControl control;
|
private BeatmapListingSearchControl control;
|
||||||
|
|
||||||
public TestSceneBeatmapListingSearchControl()
|
private OsuConfigManager localConfig;
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
Dependencies.Cache(localConfig = new OsuConfigManager(LocalStorage));
|
||||||
|
}
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void SetUp() => Schedule(() =>
|
||||||
{
|
{
|
||||||
OsuSpriteText query;
|
OsuSpriteText query;
|
||||||
OsuSpriteText ruleset;
|
OsuSpriteText ruleset;
|
||||||
@ -31,30 +41,34 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
OsuSpriteText extra;
|
OsuSpriteText extra;
|
||||||
OsuSpriteText ranks;
|
OsuSpriteText ranks;
|
||||||
OsuSpriteText played;
|
OsuSpriteText played;
|
||||||
|
OsuSpriteText explicitMap;
|
||||||
|
|
||||||
Add(control = new BeatmapListingSearchControl
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
control = new BeatmapListingSearchControl
|
||||||
Origin = Anchor.Centre,
|
|
||||||
});
|
|
||||||
|
|
||||||
Add(new FillFlowContainer
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
Spacing = new Vector2(0, 5),
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
query = new OsuSpriteText(),
|
Anchor = Anchor.Centre,
|
||||||
ruleset = new OsuSpriteText(),
|
Origin = Anchor.Centre,
|
||||||
category = new OsuSpriteText(),
|
},
|
||||||
genre = new OsuSpriteText(),
|
new FillFlowContainer
|
||||||
language = new OsuSpriteText(),
|
{
|
||||||
extra = new OsuSpriteText(),
|
AutoSizeAxes = Axes.Both,
|
||||||
ranks = new OsuSpriteText(),
|
Direction = FillDirection.Vertical,
|
||||||
played = new OsuSpriteText()
|
Spacing = new Vector2(0, 5),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
query = new OsuSpriteText(),
|
||||||
|
ruleset = new OsuSpriteText(),
|
||||||
|
category = new OsuSpriteText(),
|
||||||
|
genre = new OsuSpriteText(),
|
||||||
|
language = new OsuSpriteText(),
|
||||||
|
extra = new OsuSpriteText(),
|
||||||
|
ranks = new OsuSpriteText(),
|
||||||
|
played = new OsuSpriteText(),
|
||||||
|
explicitMap = new OsuSpriteText(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
control.Query.BindValueChanged(q => query.Text = $"Query: {q.NewValue}", true);
|
control.Query.BindValueChanged(q => query.Text = $"Query: {q.NewValue}", true);
|
||||||
control.Ruleset.BindValueChanged(r => ruleset.Text = $"Ruleset: {r.NewValue}", true);
|
control.Ruleset.BindValueChanged(r => ruleset.Text = $"Ruleset: {r.NewValue}", true);
|
||||||
@ -64,7 +78,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
control.Extra.BindCollectionChanged((u, v) => extra.Text = $"Extra: {(control.Extra.Any() ? string.Join('.', control.Extra.Select(i => i.ToString().ToLowerInvariant())) : "")}", true);
|
control.Extra.BindCollectionChanged((u, v) => extra.Text = $"Extra: {(control.Extra.Any() ? string.Join('.', control.Extra.Select(i => i.ToString().ToLowerInvariant())) : "")}", true);
|
||||||
control.Ranks.BindCollectionChanged((u, v) => ranks.Text = $"Ranks: {(control.Ranks.Any() ? string.Join('.', control.Ranks.Select(i => i.ToString())) : "")}", true);
|
control.Ranks.BindCollectionChanged((u, v) => ranks.Text = $"Ranks: {(control.Ranks.Any() ? string.Join('.', control.Ranks.Select(i => i.ToString())) : "")}", true);
|
||||||
control.Played.BindValueChanged(p => played.Text = $"Played: {p.NewValue}", true);
|
control.Played.BindValueChanged(p => played.Text = $"Played: {p.NewValue}", true);
|
||||||
}
|
control.ExplicitContent.BindValueChanged(e => explicitMap.Text = $"Explicit Maps: {e.NewValue}", true);
|
||||||
|
});
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCovers()
|
public void TestCovers()
|
||||||
@ -74,6 +89,22 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
AddStep("Set null beatmap", () => control.BeatmapSet = null);
|
AddStep("Set null beatmap", () => control.BeatmapSet = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestExplicitConfig()
|
||||||
|
{
|
||||||
|
AddStep("configure explicit content to allowed", () => localConfig.Set(OsuSetting.ShowOnlineExplicitContent, true));
|
||||||
|
AddAssert("explicit control set to show", () => control.ExplicitContent.Value == SearchExplicit.Show);
|
||||||
|
|
||||||
|
AddStep("configure explicit content to disallowed", () => localConfig.Set(OsuSetting.ShowOnlineExplicitContent, false));
|
||||||
|
AddAssert("explicit control set to hide", () => control.ExplicitContent.Value == SearchExplicit.Hide);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
localConfig?.Dispose();
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
}
|
||||||
|
|
||||||
private static readonly BeatmapSetInfo beatmap_set = new BeatmapSetInfo
|
private static readonly BeatmapSetInfo beatmap_set = new BeatmapSetInfo
|
||||||
{
|
{
|
||||||
OnlineInfo = new BeatmapSetOnlineInfo
|
OnlineInfo = new BeatmapSetOnlineInfo
|
||||||
|
@ -60,6 +60,8 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuSetting.ExternalLinkWarning, true);
|
Set(OsuSetting.ExternalLinkWarning, true);
|
||||||
Set(OsuSetting.PreferNoVideo, false);
|
Set(OsuSetting.PreferNoVideo, false);
|
||||||
|
|
||||||
|
Set(OsuSetting.ShowOnlineExplicitContent, false);
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01);
|
Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01);
|
||||||
|
|
||||||
@ -270,5 +272,6 @@ namespace osu.Game.Configuration
|
|||||||
EditorWaveformOpacity,
|
EditorWaveformOpacity,
|
||||||
DiscordRichPresence,
|
DiscordRichPresence,
|
||||||
AutomaticallyDownloadWhenSpectating,
|
AutomaticallyDownloadWhenSpectating,
|
||||||
|
ShowOnlineExplicitContent,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,8 @@ namespace osu.Game.Online.API.Requests
|
|||||||
|
|
||||||
public SearchPlayed Played { get; }
|
public SearchPlayed Played { get; }
|
||||||
|
|
||||||
|
public SearchExplicit ExplicitContent { get; }
|
||||||
|
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
public IReadOnlyCollection<ScoreRank> Ranks { get; }
|
public IReadOnlyCollection<ScoreRank> Ranks { get; }
|
||||||
|
|
||||||
@ -50,7 +52,8 @@ namespace osu.Game.Online.API.Requests
|
|||||||
SearchLanguage language = SearchLanguage.Any,
|
SearchLanguage language = SearchLanguage.Any,
|
||||||
IReadOnlyCollection<SearchExtra> extra = null,
|
IReadOnlyCollection<SearchExtra> extra = null,
|
||||||
IReadOnlyCollection<ScoreRank> ranks = null,
|
IReadOnlyCollection<ScoreRank> ranks = null,
|
||||||
SearchPlayed played = SearchPlayed.Any)
|
SearchPlayed played = SearchPlayed.Any,
|
||||||
|
SearchExplicit explicitContent = SearchExplicit.Hide)
|
||||||
{
|
{
|
||||||
this.query = string.IsNullOrEmpty(query) ? string.Empty : System.Uri.EscapeDataString(query);
|
this.query = string.IsNullOrEmpty(query) ? string.Empty : System.Uri.EscapeDataString(query);
|
||||||
this.ruleset = ruleset;
|
this.ruleset = ruleset;
|
||||||
@ -64,6 +67,7 @@ namespace osu.Game.Online.API.Requests
|
|||||||
Extra = extra;
|
Extra = extra;
|
||||||
Ranks = ranks;
|
Ranks = ranks;
|
||||||
Played = played;
|
Played = played;
|
||||||
|
ExplicitContent = explicitContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override WebRequest CreateWebRequest()
|
protected override WebRequest CreateWebRequest()
|
||||||
@ -93,6 +97,8 @@ namespace osu.Game.Online.API.Requests
|
|||||||
if (Played != SearchPlayed.Any)
|
if (Played != SearchPlayed.Any)
|
||||||
req.AddParameter("played", Played.ToString().ToLowerInvariant());
|
req.AddParameter("played", Played.ToString().ToLowerInvariant());
|
||||||
|
|
||||||
|
req.AddParameter("nsfw", ExplicitContent == SearchExplicit.Show ? "true" : "false");
|
||||||
|
|
||||||
req.AddCursor(cursor);
|
req.AddCursor(cursor);
|
||||||
|
|
||||||
return req;
|
return req;
|
||||||
|
@ -141,6 +141,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
searchControl.Extra.CollectionChanged += (_, __) => queueUpdateSearch();
|
searchControl.Extra.CollectionChanged += (_, __) => queueUpdateSearch();
|
||||||
searchControl.Ranks.CollectionChanged += (_, __) => queueUpdateSearch();
|
searchControl.Ranks.CollectionChanged += (_, __) => queueUpdateSearch();
|
||||||
searchControl.Played.BindValueChanged(_ => queueUpdateSearch());
|
searchControl.Played.BindValueChanged(_ => queueUpdateSearch());
|
||||||
|
searchControl.ExplicitContent.BindValueChanged(_ => queueUpdateSearch());
|
||||||
|
|
||||||
sortCriteria.BindValueChanged(_ => queueUpdateSearch());
|
sortCriteria.BindValueChanged(_ => queueUpdateSearch());
|
||||||
sortDirection.BindValueChanged(_ => queueUpdateSearch());
|
sortDirection.BindValueChanged(_ => queueUpdateSearch());
|
||||||
@ -193,7 +194,8 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
searchControl.Language.Value,
|
searchControl.Language.Value,
|
||||||
searchControl.Extra,
|
searchControl.Extra,
|
||||||
searchControl.Ranks,
|
searchControl.Ranks,
|
||||||
searchControl.Played.Value);
|
searchControl.Played.Value,
|
||||||
|
searchControl.ExplicitContent.Value);
|
||||||
|
|
||||||
getSetsRequest.Success += response =>
|
getSetsRequest.Success += response =>
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -42,6 +43,8 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
|
|
||||||
public Bindable<SearchPlayed> Played => playedFilter.Current;
|
public Bindable<SearchPlayed> Played => playedFilter.Current;
|
||||||
|
|
||||||
|
public Bindable<SearchExplicit> ExplicitContent => explicitContentFilter.Current;
|
||||||
|
|
||||||
public BeatmapSetInfo BeatmapSet
|
public BeatmapSetInfo BeatmapSet
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
@ -65,6 +68,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
private readonly BeatmapSearchMultipleSelectionFilterRow<SearchExtra> extraFilter;
|
private readonly BeatmapSearchMultipleSelectionFilterRow<SearchExtra> extraFilter;
|
||||||
private readonly BeatmapSearchScoreFilterRow ranksFilter;
|
private readonly BeatmapSearchScoreFilterRow ranksFilter;
|
||||||
private readonly BeatmapSearchFilterRow<SearchPlayed> playedFilter;
|
private readonly BeatmapSearchFilterRow<SearchPlayed> playedFilter;
|
||||||
|
private readonly BeatmapSearchFilterRow<SearchExplicit> explicitContentFilter;
|
||||||
|
|
||||||
private readonly Box background;
|
private readonly Box background;
|
||||||
private readonly UpdateableBeatmapSetCover beatmapCover;
|
private readonly UpdateableBeatmapSetCover beatmapCover;
|
||||||
@ -125,7 +129,8 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
languageFilter = new BeatmapSearchFilterRow<SearchLanguage>(@"Language"),
|
languageFilter = new BeatmapSearchFilterRow<SearchLanguage>(@"Language"),
|
||||||
extraFilter = new BeatmapSearchMultipleSelectionFilterRow<SearchExtra>(@"Extra"),
|
extraFilter = new BeatmapSearchMultipleSelectionFilterRow<SearchExtra>(@"Extra"),
|
||||||
ranksFilter = new BeatmapSearchScoreFilterRow(),
|
ranksFilter = new BeatmapSearchScoreFilterRow(),
|
||||||
playedFilter = new BeatmapSearchFilterRow<SearchPlayed>(@"Played")
|
playedFilter = new BeatmapSearchFilterRow<SearchPlayed>(@"Played"),
|
||||||
|
explicitContentFilter = new BeatmapSearchFilterRow<SearchExplicit>(@"Explicit Content"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -136,10 +141,18 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
categoryFilter.Current.Value = SearchCategory.Leaderboard;
|
categoryFilter.Current.Value = SearchCategory.Leaderboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private IBindable<bool> allowExplicitContent;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colourProvider)
|
private void load(OverlayColourProvider colourProvider, OsuConfigManager config)
|
||||||
{
|
{
|
||||||
background.Colour = colourProvider.Dark6;
|
background.Colour = colourProvider.Dark6;
|
||||||
|
|
||||||
|
allowExplicitContent = config.GetBindable<bool>(OsuSetting.ShowOnlineExplicitContent);
|
||||||
|
allowExplicitContent.BindValueChanged(allow =>
|
||||||
|
{
|
||||||
|
ExplicitContent.Value = allow.NewValue ? SearchExplicit.Show : SearchExplicit.Hide;
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TakeFocus() => textBox.TakeFocus();
|
public void TakeFocus() => textBox.TakeFocus();
|
||||||
|
@ -205,7 +205,7 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
|
|||||||
|
|
||||||
if (SetInfo.OnlineInfo?.HasExplicitContent ?? false)
|
if (SetInfo.OnlineInfo?.HasExplicitContent ?? false)
|
||||||
{
|
{
|
||||||
titleContainer.Add(new ExplicitBeatmapPill
|
titleContainer.Add(new ExplicitContentBeatmapPill
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
|
@ -219,7 +219,7 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
|
|||||||
|
|
||||||
if (SetInfo.OnlineInfo?.HasExplicitContent ?? false)
|
if (SetInfo.OnlineInfo?.HasExplicitContent ?? false)
|
||||||
{
|
{
|
||||||
titleContainer.Add(new ExplicitBeatmapPill
|
titleContainer.Add(new ExplicitContentBeatmapPill
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
|
11
osu.Game/Overlays/BeatmapListing/SearchExplicit.cs
Normal file
11
osu.Game/Overlays/BeatmapListing/SearchExplicit.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.BeatmapListing
|
||||||
|
{
|
||||||
|
public enum SearchExplicit
|
||||||
|
{
|
||||||
|
Hide,
|
||||||
|
Show
|
||||||
|
}
|
||||||
|
}
|
@ -10,9 +10,9 @@ using osu.Game.Graphics.Sprites;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.BeatmapSet
|
namespace osu.Game.Overlays.BeatmapSet
|
||||||
{
|
{
|
||||||
public class ExplicitBeatmapPill : CompositeDrawable
|
public class ExplicitContentBeatmapPill : CompositeDrawable
|
||||||
{
|
{
|
||||||
public ExplicitBeatmapPill()
|
public ExplicitContentBeatmapPill()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
}
|
}
|
@ -34,7 +34,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
private readonly Box coverGradient;
|
private readonly Box coverGradient;
|
||||||
private readonly OsuSpriteText title, artist;
|
private readonly OsuSpriteText title, artist;
|
||||||
private readonly AuthorInfo author;
|
private readonly AuthorInfo author;
|
||||||
private readonly ExplicitBeatmapPill explicitPill;
|
private readonly ExplicitContentBeatmapPill explicitContentPill;
|
||||||
private readonly FillFlowContainer downloadButtonsContainer;
|
private readonly FillFlowContainer downloadButtonsContainer;
|
||||||
private readonly BeatmapAvailability beatmapAvailability;
|
private readonly BeatmapAvailability beatmapAvailability;
|
||||||
private readonly BeatmapSetOnlineStatusPill onlineStatusPill;
|
private readonly BeatmapSetOnlineStatusPill onlineStatusPill;
|
||||||
@ -147,7 +147,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Margin = new MarginPadding { Left = 5, Bottom = 4 }, // To better lineup with the font
|
Margin = new MarginPadding { Left = 5, Bottom = 4 }, // To better lineup with the font
|
||||||
},
|
},
|
||||||
explicitPill = new ExplicitBeatmapPill
|
explicitContentPill = new ExplicitContentBeatmapPill
|
||||||
{
|
{
|
||||||
Alpha = 0f,
|
Alpha = 0f,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
@ -261,7 +261,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
title.Text = setInfo.NewValue.Metadata.Title ?? string.Empty;
|
title.Text = setInfo.NewValue.Metadata.Title ?? string.Empty;
|
||||||
artist.Text = setInfo.NewValue.Metadata.Artist ?? string.Empty;
|
artist.Text = setInfo.NewValue.Metadata.Artist ?? string.Empty;
|
||||||
|
|
||||||
explicitPill.Alpha = setInfo.NewValue.OnlineInfo.HasExplicitContent ? 1 : 0;
|
explicitContentPill.Alpha = setInfo.NewValue.OnlineInfo.HasExplicitContent ? 1 : 0;
|
||||||
|
|
||||||
onlineStatusPill.FadeIn(500, Easing.OutQuint);
|
onlineStatusPill.FadeIn(500, Easing.OutQuint);
|
||||||
onlineStatusPill.Status = setInfo.NewValue.OnlineInfo.Status;
|
onlineStatusPill.Status = setInfo.NewValue.OnlineInfo.Status;
|
||||||
|
@ -33,6 +33,12 @@ namespace osu.Game.Overlays.Settings.Sections.Online
|
|||||||
Keywords = new[] { "spectator" },
|
Keywords = new[] { "spectator" },
|
||||||
Current = config.GetBindable<bool>(OsuSetting.AutomaticallyDownloadWhenSpectating),
|
Current = config.GetBindable<bool>(OsuSetting.AutomaticallyDownloadWhenSpectating),
|
||||||
},
|
},
|
||||||
|
new SettingsCheckbox
|
||||||
|
{
|
||||||
|
LabelText = "Show explicit content in search results",
|
||||||
|
Keywords = new[] { "nsfw", "18+", "offensive" },
|
||||||
|
Current = config.GetBindable<bool>(OsuSetting.ShowOnlineExplicitContent),
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
private Container difficultyIconContainer;
|
private Container difficultyIconContainer;
|
||||||
private LinkFlowContainer beatmapText;
|
private LinkFlowContainer beatmapText;
|
||||||
private LinkFlowContainer authorText;
|
private LinkFlowContainer authorText;
|
||||||
private ExplicitBeatmapPill explicitPill;
|
private ExplicitContentBeatmapPill explicitContentPill;
|
||||||
private ModDisplay modDisplay;
|
private ModDisplay modDisplay;
|
||||||
|
|
||||||
private readonly Bindable<BeatmapInfo> beatmap = new Bindable<BeatmapInfo>();
|
private readonly Bindable<BeatmapInfo> beatmap = new Bindable<BeatmapInfo>();
|
||||||
@ -119,7 +119,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool hasExplicitContent = Item.Beatmap.Value.BeatmapSet.OnlineInfo?.HasExplicitContent == true;
|
bool hasExplicitContent = Item.Beatmap.Value.BeatmapSet.OnlineInfo?.HasExplicitContent == true;
|
||||||
explicitPill.Alpha = hasExplicitContent ? 1 : 0;
|
explicitContentPill.Alpha = hasExplicitContent ? 1 : 0;
|
||||||
|
|
||||||
modDisplay.Current.Value = requiredMods.ToArray();
|
modDisplay.Current.Value = requiredMods.ToArray();
|
||||||
}
|
}
|
||||||
@ -181,7 +181,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
authorText = new LinkFlowContainer { AutoSizeAxes = Axes.Both },
|
authorText = new LinkFlowContainer { AutoSizeAxes = Axes.Both },
|
||||||
explicitPill = new ExplicitBeatmapPill
|
explicitContentPill = new ExplicitContentBeatmapPill
|
||||||
{
|
{
|
||||||
Alpha = 0f,
|
Alpha = 0f,
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Loading…
Reference in New Issue
Block a user