From fa3373e5f306e0f64afeccefa9977c02584b2f5c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 14 May 2020 14:24:43 +0900 Subject: [PATCH] Reorder file and change naming slightly --- .../BeatmapListingFilterControl.cs | 30 +++++++++---------- osu.Game/Overlays/BeatmapListingOverlay.cs | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/osu.Game/Overlays/BeatmapListing/BeatmapListingFilterControl.cs b/osu.Game/Overlays/BeatmapListing/BeatmapListingFilterControl.cs index ac5ad96f7c..92822794b7 100644 --- a/osu.Game/Overlays/BeatmapListing/BeatmapListingFilterControl.cs +++ b/osu.Game/Overlays/BeatmapListing/BeatmapListingFilterControl.cs @@ -36,6 +36,9 @@ namespace osu.Game.Overlays.BeatmapListing private BeatmapListingPager beatmapListingPager; + private ScheduledDelegate queryChangedDebounce; + private ScheduledDelegate queryPagingDebounce; + public BeatmapListingFilterControl() { RelativeSizeAxes = Axes.X; @@ -113,8 +116,17 @@ namespace osu.Game.Overlays.BeatmapListing sortDirection.BindValueChanged(_ => queueUpdateSearch()); } - private ScheduledDelegate queryChangedDebounce; - private ScheduledDelegate queryPagingDebounce; + public void TakeFocus() => searchControl.TakeFocus(); + + public void ShowMore() + { + if (beatmapListingPager == null || !beatmapListingPager.CanFetchNextPage) + return; + if (queryPagingDebounce != null) + return; + + beatmapListingPager.FetchNextPage(); + } private void queueUpdateSearch(bool queryTextChanged = false) { @@ -142,7 +154,7 @@ namespace osu.Game.Overlays.BeatmapListing queryPagingDebounce = null; beatmapListingPager.PageFetched += onSearchFinished; - AddPageToResult(); + ShowMore(); } private void onSearchFinished(List beatmaps) @@ -165,17 +177,5 @@ namespace osu.Game.Overlays.BeatmapListing base.Dispose(isDisposing); } - - public void TakeFocus() => searchControl.TakeFocus(); - - public void AddPageToResult() - { - if (beatmapListingPager == null || !beatmapListingPager.CanFetchNextPage) - return; - if (queryPagingDebounce != null) - return; - - beatmapListingPager.FetchNextPage(); - } } } diff --git a/osu.Game/Overlays/BeatmapListingOverlay.cs b/osu.Game/Overlays/BeatmapListingOverlay.cs index e26f084ea4..4aa754491c 100644 --- a/osu.Game/Overlays/BeatmapListingOverlay.cs +++ b/osu.Game/Overlays/BeatmapListingOverlay.cs @@ -247,7 +247,7 @@ namespace osu.Game.Overlays base.Update(); if (shouldAddNextPage) - filterControl.AddPageToResult(); + filterControl.ShowMore(); } } }