1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 18:42:56 +08:00

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[] public override IReadOnlyList<Type> RequiredTypes => new[]
{ {
typeof(BeatmapListingOverlay), typeof(BeatmapListingOverlay),
typeof(BeatmapListingSearchHandler) typeof(BeatmapListingFilterControl)
}; };
protected override bool UseOnlineAPI => true; protected override bool UseOnlineAPI => true;

View File

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

View File

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

View File

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

View File

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

View File

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