1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:17:23 +08:00

Unify variable names

This commit is contained in:
Dean Herbert 2021-01-17 22:40:24 +09:00
parent addd463d26
commit 5fd644fc57
11 changed files with 29 additions and 29 deletions

View File

@ -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.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.Explicit.BindValueChanged(e => explicitMap.Text = $"Explicit Maps: {e.NewValue}", true);
control.ExplicitContent.BindValueChanged(e => explicitMap.Text = $"Explicit Maps: {e.NewValue}", true);
});
[Test]
@ -92,11 +92,11 @@ namespace osu.Game.Tests.Visual.UserInterface
[Test]
public void TestExplicitConfig()
{
AddStep("configure explicit content to allowed", () => localConfig.Set(OsuSetting.AllowExplicitContent, true));
AddAssert("explicit control set to show", () => control.Explicit.Value == SearchExplicit.Show);
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.AllowExplicitContent, false));
AddAssert("explicit control set to hide", () => control.Explicit.Value == SearchExplicit.Hide);
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)

View File

@ -60,7 +60,7 @@ namespace osu.Game.Configuration
Set(OsuSetting.ExternalLinkWarning, true);
Set(OsuSetting.PreferNoVideo, false);
Set(OsuSetting.AllowExplicitContent, false);
Set(OsuSetting.ShowOnlineExplicitContent, false);
// Audio
Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01);
@ -272,6 +272,6 @@ namespace osu.Game.Configuration
EditorWaveformOpacity,
DiscordRichPresence,
AutomaticallyDownloadWhenSpectating,
AllowExplicitContent,
ShowOnlineExplicitContent,
}
}

View File

@ -30,7 +30,7 @@ namespace osu.Game.Online.API.Requests
public SearchPlayed Played { get; }
public SearchExplicit Explicit { get; }
public SearchExplicit ExplicitContent { get; }
[CanBeNull]
public IReadOnlyCollection<ScoreRank> Ranks { get; }
@ -53,7 +53,7 @@ namespace osu.Game.Online.API.Requests
IReadOnlyCollection<SearchExtra> extra = null,
IReadOnlyCollection<ScoreRank> ranks = null,
SearchPlayed played = SearchPlayed.Any,
SearchExplicit explicitMaps = SearchExplicit.Hide)
SearchExplicit explicitContent = SearchExplicit.Hide)
{
this.query = string.IsNullOrEmpty(query) ? string.Empty : System.Uri.EscapeDataString(query);
this.ruleset = ruleset;
@ -67,7 +67,7 @@ namespace osu.Game.Online.API.Requests
Extra = extra;
Ranks = ranks;
Played = played;
Explicit = explicitMaps;
ExplicitContent = explicitContent;
}
protected override WebRequest CreateWebRequest()
@ -97,7 +97,7 @@ namespace osu.Game.Online.API.Requests
if (Played != SearchPlayed.Any)
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);

View File

@ -141,7 +141,7 @@ namespace osu.Game.Overlays.BeatmapListing
searchControl.Extra.CollectionChanged += (_, __) => queueUpdateSearch();
searchControl.Ranks.CollectionChanged += (_, __) => queueUpdateSearch();
searchControl.Played.BindValueChanged(_ => queueUpdateSearch());
searchControl.Explicit.BindValueChanged(_ => queueUpdateSearch());
searchControl.ExplicitContent.BindValueChanged(_ => queueUpdateSearch());
sortCriteria.BindValueChanged(_ => queueUpdateSearch());
sortDirection.BindValueChanged(_ => queueUpdateSearch());
@ -195,7 +195,7 @@ namespace osu.Game.Overlays.BeatmapListing
searchControl.Extra,
searchControl.Ranks,
searchControl.Played.Value,
searchControl.Explicit.Value);
searchControl.ExplicitContent.Value);
getSetsRequest.Success += response =>
{

View File

@ -43,7 +43,7 @@ namespace osu.Game.Overlays.BeatmapListing
public Bindable<SearchPlayed> Played => playedFilter.Current;
public Bindable<SearchExplicit> Explicit => explicitFilter.Current;
public Bindable<SearchExplicit> ExplicitContent => explicitContentFilter.Current;
public BeatmapSetInfo BeatmapSet
{
@ -68,7 +68,7 @@ namespace osu.Game.Overlays.BeatmapListing
private readonly BeatmapSearchMultipleSelectionFilterRow<SearchExtra> extraFilter;
private readonly BeatmapSearchScoreFilterRow ranksFilter;
private readonly BeatmapSearchFilterRow<SearchPlayed> playedFilter;
private readonly BeatmapSearchFilterRow<SearchExplicit> explicitFilter;
private readonly BeatmapSearchFilterRow<SearchExplicit> explicitContentFilter;
private readonly Box background;
private readonly UpdateableBeatmapSetCover beatmapCover;
@ -130,7 +130,7 @@ namespace osu.Game.Overlays.BeatmapListing
extraFilter = new BeatmapSearchMultipleSelectionFilterRow<SearchExtra>(@"Extra"),
ranksFilter = new BeatmapSearchScoreFilterRow(),
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;
allowExplicitContent = config.GetBindable<bool>(OsuSetting.AllowExplicitContent);
allowExplicitContent = config.GetBindable<bool>(OsuSetting.ShowOnlineExplicitContent);
allowExplicitContent.BindValueChanged(allow =>
{
Explicit.Value = allow.NewValue ? SearchExplicit.Show : SearchExplicit.Hide;
ExplicitContent.Value = allow.NewValue ? SearchExplicit.Show : SearchExplicit.Hide;
}, true);
}

View File

@ -205,7 +205,7 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
if (SetInfo.OnlineInfo?.HasExplicitContent ?? false)
{
titleContainer.Add(new ExplicitBeatmapPill
titleContainer.Add(new ExplicitContentBeatmapPill
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,

View File

@ -219,7 +219,7 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
if (SetInfo.OnlineInfo?.HasExplicitContent ?? false)
{
titleContainer.Add(new ExplicitBeatmapPill
titleContainer.Add(new ExplicitContentBeatmapPill
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,

View File

@ -10,9 +10,9 @@ using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.BeatmapSet
{
public class ExplicitBeatmapPill : CompositeDrawable
public class ExplicitContentBeatmapPill : CompositeDrawable
{
public ExplicitBeatmapPill()
public ExplicitContentBeatmapPill()
{
AutoSizeAxes = Axes.Both;
}

View File

@ -34,7 +34,7 @@ namespace osu.Game.Overlays.BeatmapSet
private readonly Box coverGradient;
private readonly OsuSpriteText title, artist;
private readonly AuthorInfo author;
private readonly ExplicitBeatmapPill explicitPill;
private readonly ExplicitContentBeatmapPill explicitContentPill;
private readonly FillFlowContainer downloadButtonsContainer;
private readonly BeatmapAvailability beatmapAvailability;
private readonly BeatmapSetOnlineStatusPill onlineStatusPill;
@ -147,7 +147,7 @@ namespace osu.Game.Overlays.BeatmapSet
Origin = Anchor.BottomLeft,
Margin = new MarginPadding { Left = 5, Bottom = 4 }, // To better lineup with the font
},
explicitPill = new ExplicitBeatmapPill
explicitContentPill = new ExplicitContentBeatmapPill
{
Alpha = 0f,
Anchor = Anchor.BottomLeft,
@ -261,7 +261,7 @@ namespace osu.Game.Overlays.BeatmapSet
title.Text = setInfo.NewValue.Metadata.Title ?? 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.Status = setInfo.NewValue.OnlineInfo.Status;

View File

@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Settings.Sections.Online
{
LabelText = "Hide warnings for explicit content in beatmaps",
Keywords = new[] { "nsfw", "18+", "offensive" },
Current = config.GetBindable<bool>(OsuSetting.AllowExplicitContent),
Current = config.GetBindable<bool>(OsuSetting.ShowOnlineExplicitContent),
}
};
}

View File

@ -42,7 +42,7 @@ namespace osu.Game.Screens.OnlinePlay
private Container difficultyIconContainer;
private LinkFlowContainer beatmapText;
private LinkFlowContainer authorText;
private ExplicitBeatmapPill explicitPill;
private ExplicitContentBeatmapPill explicitContentPill;
private ModDisplay modDisplay;
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;
explicitPill.Alpha = hasExplicitContent ? 1 : 0;
explicitContentPill.Alpha = hasExplicitContent ? 1 : 0;
modDisplay.Current.Value = requiredMods.ToArray();
}
@ -181,7 +181,7 @@ namespace osu.Game.Screens.OnlinePlay
Children = new Drawable[]
{
authorText = new LinkFlowContainer { AutoSizeAxes = Axes.Both },
explicitPill = new ExplicitBeatmapPill
explicitContentPill = new ExplicitContentBeatmapPill
{
Alpha = 0f,
Anchor = Anchor.CentreLeft,