Apply class renaming

This commit is contained in:
Dean Herbert 2020-04-21 15:13:19 +09:00
parent 477d519df3
commit 89320b510c
6 changed files with 33 additions and 34 deletions

View File

@ -14,7 +14,7 @@ namespace osu.Game.Tests.Visual.Online
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(BeatmapListingOverlay),
typeof(BeatmapListingSearchHandler)
typeof(BeatmapListingFilterControl)
};
protected override bool UseOnlineAPI => true;

View File

@ -15,19 +15,19 @@ using osuTK;
namespace osu.Game.Tests.Visual.UserInterface
{
public class TestSceneBeatmapListingSearchSection : OsuTestScene
public class TestSceneBeatmapListingSearchControl : OsuTestScene
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(BeatmapListingSearchSection),
typeof(BeatmapListingSearchControl),
};
[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
private readonly BeatmapListingSearchSection section;
private readonly BeatmapListingSearchControl control;
public TestSceneBeatmapListingSearchSection()
public TestSceneBeatmapListingSearchControl()
{
OsuSpriteText query;
OsuSpriteText ruleset;
@ -35,7 +35,7 @@ namespace osu.Game.Tests.Visual.UserInterface
OsuSpriteText genre;
OsuSpriteText language;
Add(section = new BeatmapListingSearchSection
Add(control = new BeatmapListingSearchControl
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@ -56,19 +56,19 @@ namespace osu.Game.Tests.Visual.UserInterface
}
});
section.Query.BindValueChanged(q => query.Text = $"Query: {q.NewValue}", true);
section.Ruleset.BindValueChanged(r => ruleset.Text = $"Ruleset: {r.NewValue}", true);
section.Category.BindValueChanged(c => category.Text = $"Category: {c.NewValue}", true);
section.Genre.BindValueChanged(g => genre.Text = $"Genre: {g.NewValue}", true);
section.Language.BindValueChanged(l => language.Text = $"Language: {l.NewValue}", true);
control.Query.BindValueChanged(q => query.Text = $"Query: {q.NewValue}", true);
control.Ruleset.BindValueChanged(r => ruleset.Text = $"Ruleset: {r.NewValue}", true);
control.Category.BindValueChanged(c => category.Text = $"Category: {c.NewValue}", true);
control.Genre.BindValueChanged(g => genre.Text = $"Genre: {g.NewValue}", true);
control.Language.BindValueChanged(l => language.Text = $"Language: {l.NewValue}", true);
}
[Test]
public void TestCovers()
{
AddStep("Set beatmap", () => section.BeatmapSet = beatmap_set);
AddStep("Set beatmap (no cover)", () => section.BeatmapSet = no_cover_beatmap_set);
AddStep("Set null beatmap", () => section.BeatmapSet = null);
AddStep("Set beatmap", () => control.BeatmapSet = beatmap_set);
AddStep("Set beatmap (no cover)", () => control.BeatmapSet = no_cover_beatmap_set);
AddStep("Set null beatmap", () => control.BeatmapSet = null);
}
private static readonly BeatmapSetInfo beatmap_set = new BeatmapSetInfo

View File

@ -13,18 +13,17 @@ using osuTK;
namespace osu.Game.Tests.Visual.UserInterface
{
public class TestSceneBeatmapListingSort : OsuTestScene
public class TestSceneBeatmapListingSortTabControl : OsuTestScene
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(BeatmapListingSortTabControl),
typeof(OverlaySortTabControl<>),
};
[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
public TestSceneBeatmapListingSort()
public TestSceneBeatmapListingSortTabControl()
{
BeatmapListingSortTabControl control;
OsuSpriteText current;

View File

@ -21,7 +21,7 @@ using osuTK.Graphics;
namespace osu.Game.Overlays.BeatmapListing
{
public class BeatmapListingSearchHandler : CompositeDrawable
public class BeatmapListingFilterControl : CompositeDrawable
{
public Action<List<BeatmapSetInfo>> SearchFinished;
public Action SearchStarted;
@ -32,13 +32,13 @@ namespace osu.Game.Overlays.BeatmapListing
[Resolved]
private RulesetStore rulesets { get; set; }
private readonly BeatmapListingSearchSection searchSection;
private readonly BeatmapListingSearchControl searchControl;
private readonly BeatmapListingSortTabControl sortControl;
private readonly Box sortControlBackground;
private SearchBeatmapSetsRequest getSetsRequest;
public BeatmapListingSearchHandler()
public BeatmapListingFilterControl()
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
@ -62,7 +62,7 @@ namespace osu.Game.Overlays.BeatmapListing
Radius = 3,
Offset = new Vector2(0f, 1f),
},
Child = searchSection = new BeatmapListingSearchSection(),
Child = searchControl = new BeatmapListingSearchControl(),
},
new Container
{
@ -99,17 +99,17 @@ namespace osu.Game.Overlays.BeatmapListing
var sortCriteria = sortControl.Current;
var sortDirection = sortControl.SortDirection;
searchSection.Query.BindValueChanged(query =>
searchControl.Query.BindValueChanged(query =>
{
sortCriteria.Value = string.IsNullOrEmpty(query.NewValue) ? DirectSortCriteria.Ranked : DirectSortCriteria.Relevance;
sortDirection.Value = SortDirection.Descending;
queueUpdateSearch(true);
});
searchSection.Ruleset.BindValueChanged(_ => queueUpdateSearch());
searchSection.Category.BindValueChanged(_ => queueUpdateSearch());
searchSection.Genre.BindValueChanged(_ => queueUpdateSearch());
searchSection.Language.BindValueChanged(_ => queueUpdateSearch());
searchControl.Ruleset.BindValueChanged(_ => queueUpdateSearch());
searchControl.Category.BindValueChanged(_ => queueUpdateSearch());
searchControl.Genre.BindValueChanged(_ => queueUpdateSearch());
searchControl.Language.BindValueChanged(_ => queueUpdateSearch());
sortCriteria.BindValueChanged(_ => queueUpdateSearch());
sortDirection.BindValueChanged(_ => queueUpdateSearch());
@ -129,13 +129,13 @@ namespace osu.Game.Overlays.BeatmapListing
private void updateSearch()
{
getSetsRequest = new SearchBeatmapSetsRequest(searchSection.Query.Value, searchSection.Ruleset.Value)
getSetsRequest = new SearchBeatmapSetsRequest(searchControl.Query.Value, searchControl.Ruleset.Value)
{
SearchCategory = searchSection.Category.Value,
SearchCategory = searchControl.Category.Value,
SortCriteria = sortControl.Current.Value,
SortDirection = sortControl.SortDirection.Value,
Genre = searchSection.Genre.Value,
Language = searchSection.Language.Value
Genre = searchControl.Genre.Value,
Language = searchControl.Language.Value
};
getSetsRequest.Success += response => Schedule(() => onSearchFinished(response));
@ -147,7 +147,7 @@ namespace osu.Game.Overlays.BeatmapListing
{
var beatmaps = response.BeatmapSets.Select(r => r.ToBeatmapSet(rulesets)).ToList();
searchSection.BeatmapSet = response.Total == 0 ? null : beatmaps.First();
searchControl.BeatmapSet = response.Total == 0 ? null : beatmaps.First();
SearchFinished?.Invoke(beatmaps);
}

View File

@ -17,7 +17,7 @@ using osu.Game.Rulesets;
namespace osu.Game.Overlays.BeatmapListing
{
public class BeatmapListingSearchSection : CompositeDrawable
public class BeatmapListingSearchControl : CompositeDrawable
{
public Bindable<string> Query => textBox.Current;
@ -53,7 +53,7 @@ namespace osu.Game.Overlays.BeatmapListing
private readonly Box background;
private readonly UpdateableBeatmapSetCover beatmapCover;
public BeatmapListingSearchSection()
public BeatmapListingSearchControl()
{
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;

View File

@ -57,7 +57,7 @@ namespace osu.Game.Overlays
Children = new Drawable[]
{
new BeatmapListingHeader(),
new BeatmapListingSearchHandler
new BeatmapListingFilterControl
{
SearchStarted = onSearchStarted,
SearchFinished = onSearchFinished,