mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Unify variable names
This commit is contained in:
@ -78,7 +78,7 @@ 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.Explicit.BindValueChanged(e => explicitMap.Text = $"Explicit Maps: {e.NewValue}", true);
|
control.ExplicitContent.BindValueChanged(e => explicitMap.Text = $"Explicit Maps: {e.NewValue}", true);
|
||||||
});
|
});
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -92,11 +92,11 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestExplicitConfig()
|
public void TestExplicitConfig()
|
||||||
{
|
{
|
||||||
AddStep("configure explicit content to allowed", () => localConfig.Set(OsuSetting.AllowExplicitContent, true));
|
AddStep("configure explicit content to allowed", () => localConfig.Set(OsuSetting.ShowOnlineExplicitContent, true));
|
||||||
AddAssert("explicit control set to show", () => control.Explicit.Value == SearchExplicit.Show);
|
AddAssert("explicit control set to show", () => control.ExplicitContent.Value == SearchExplicit.Show);
|
||||||
|
|
||||||
AddStep("configure explicit content to disallowed", () => localConfig.Set(OsuSetting.AllowExplicitContent, false));
|
AddStep("configure explicit content to disallowed", () => localConfig.Set(OsuSetting.ShowOnlineExplicitContent, false));
|
||||||
AddAssert("explicit control set to hide", () => control.Explicit.Value == SearchExplicit.Hide);
|
AddAssert("explicit control set to hide", () => control.ExplicitContent.Value == SearchExplicit.Hide);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
@ -60,7 +60,7 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuSetting.ExternalLinkWarning, true);
|
Set(OsuSetting.ExternalLinkWarning, true);
|
||||||
Set(OsuSetting.PreferNoVideo, false);
|
Set(OsuSetting.PreferNoVideo, false);
|
||||||
|
|
||||||
Set(OsuSetting.AllowExplicitContent, 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);
|
||||||
@ -272,6 +272,6 @@ namespace osu.Game.Configuration
|
|||||||
EditorWaveformOpacity,
|
EditorWaveformOpacity,
|
||||||
DiscordRichPresence,
|
DiscordRichPresence,
|
||||||
AutomaticallyDownloadWhenSpectating,
|
AutomaticallyDownloadWhenSpectating,
|
||||||
AllowExplicitContent,
|
ShowOnlineExplicitContent,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ namespace osu.Game.Online.API.Requests
|
|||||||
|
|
||||||
public SearchPlayed Played { get; }
|
public SearchPlayed Played { get; }
|
||||||
|
|
||||||
public SearchExplicit Explicit { get; }
|
public SearchExplicit ExplicitContent { get; }
|
||||||
|
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
public IReadOnlyCollection<ScoreRank> Ranks { get; }
|
public IReadOnlyCollection<ScoreRank> Ranks { get; }
|
||||||
@ -53,7 +53,7 @@ namespace osu.Game.Online.API.Requests
|
|||||||
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 explicitMaps = SearchExplicit.Hide)
|
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;
|
||||||
@ -67,7 +67,7 @@ namespace osu.Game.Online.API.Requests
|
|||||||
Extra = extra;
|
Extra = extra;
|
||||||
Ranks = ranks;
|
Ranks = ranks;
|
||||||
Played = played;
|
Played = played;
|
||||||
Explicit = explicitMaps;
|
ExplicitContent = explicitContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override WebRequest CreateWebRequest()
|
protected override WebRequest CreateWebRequest()
|
||||||
@ -97,7 +97,7 @@ 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", Explicit == SearchExplicit.Show ? "true" : "false");
|
req.AddParameter("nsfw", ExplicitContent == SearchExplicit.Show ? "true" : "false");
|
||||||
|
|
||||||
req.AddCursor(cursor);
|
req.AddCursor(cursor);
|
||||||
|
|
||||||
|
@ -141,7 +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.Explicit.BindValueChanged(_ => queueUpdateSearch());
|
searchControl.ExplicitContent.BindValueChanged(_ => queueUpdateSearch());
|
||||||
|
|
||||||
sortCriteria.BindValueChanged(_ => queueUpdateSearch());
|
sortCriteria.BindValueChanged(_ => queueUpdateSearch());
|
||||||
sortDirection.BindValueChanged(_ => queueUpdateSearch());
|
sortDirection.BindValueChanged(_ => queueUpdateSearch());
|
||||||
@ -195,7 +195,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
searchControl.Extra,
|
searchControl.Extra,
|
||||||
searchControl.Ranks,
|
searchControl.Ranks,
|
||||||
searchControl.Played.Value,
|
searchControl.Played.Value,
|
||||||
searchControl.Explicit.Value);
|
searchControl.ExplicitContent.Value);
|
||||||
|
|
||||||
getSetsRequest.Success += response =>
|
getSetsRequest.Success += response =>
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
|
|
||||||
public Bindable<SearchPlayed> Played => playedFilter.Current;
|
public Bindable<SearchPlayed> Played => playedFilter.Current;
|
||||||
|
|
||||||
public Bindable<SearchExplicit> Explicit => explicitFilter.Current;
|
public Bindable<SearchExplicit> ExplicitContent => explicitContentFilter.Current;
|
||||||
|
|
||||||
public BeatmapSetInfo BeatmapSet
|
public BeatmapSetInfo BeatmapSet
|
||||||
{
|
{
|
||||||
@ -68,7 +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> explicitFilter;
|
private readonly BeatmapSearchFilterRow<SearchExplicit> explicitContentFilter;
|
||||||
|
|
||||||
private readonly Box background;
|
private readonly Box background;
|
||||||
private readonly UpdateableBeatmapSetCover beatmapCover;
|
private readonly UpdateableBeatmapSetCover beatmapCover;
|
||||||
@ -130,7 +130,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
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"),
|
||||||
explicitFilter = new BeatmapSearchFilterRow<SearchExplicit>(@"Explicit Maps"),
|
explicitContentFilter = new BeatmapSearchFilterRow<SearchExplicit>(@"Explicit Content"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -148,10 +148,10 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
{
|
{
|
||||||
background.Colour = colourProvider.Dark6;
|
background.Colour = colourProvider.Dark6;
|
||||||
|
|
||||||
allowExplicitContent = config.GetBindable<bool>(OsuSetting.AllowExplicitContent);
|
allowExplicitContent = config.GetBindable<bool>(OsuSetting.ShowOnlineExplicitContent);
|
||||||
allowExplicitContent.BindValueChanged(allow =>
|
allowExplicitContent.BindValueChanged(allow =>
|
||||||
{
|
{
|
||||||
Explicit.Value = allow.NewValue ? SearchExplicit.Show : SearchExplicit.Hide;
|
ExplicitContent.Value = allow.NewValue ? SearchExplicit.Show : SearchExplicit.Hide;
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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,
|
||||||
|
@ -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;
|
||||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Settings.Sections.Online
|
|||||||
{
|
{
|
||||||
LabelText = "Hide warnings for explicit content in beatmaps",
|
LabelText = "Hide warnings for explicit content in beatmaps",
|
||||||
Keywords = new[] { "nsfw", "18+", "offensive" },
|
Keywords = new[] { "nsfw", "18+", "offensive" },
|
||||||
Current = config.GetBindable<bool>(OsuSetting.AllowExplicitContent),
|
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,
|
||||||
|
Reference in New Issue
Block a user