1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 21:53:22 +08:00

Resolve remaining InspectCode issues

> CI should now pass build test
This commit is contained in:
「空白」 2020-05-14 01:57:03 +09:00
parent 1ac9c7c15a
commit 43450b5485
4 changed files with 11 additions and 11 deletions

View File

@ -6,11 +6,13 @@ using osu.Framework.Extensions.IEnumerableExtensions;
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using JetBrains.Annotations;
namespace osu.Game.Extensions namespace osu.Game.Extensions
{ {
public class Cursor public class Cursor
{ {
[UsedImplicitly]
[JsonExtensionData] [JsonExtensionData]
public IDictionary<string, JToken> Properties; public IDictionary<string, JToken> Properties;
} }

View File

@ -11,15 +11,15 @@ namespace osu.Game.Online.API.Requests
{ {
public class SearchBeatmapSetsRequest : APIRequest<SearchBeatmapSetsResponse> public class SearchBeatmapSetsRequest : APIRequest<SearchBeatmapSetsResponse>
{ {
public SearchCategory SearchCategory { get; set; } public SearchCategory SearchCategory { get; }
public SortCriteria SortCriteria { get; set; } public SortCriteria SortCriteria { get; }
public SortDirection SortDirection { get; set; } public SortDirection SortDirection { get; }
public SearchGenre Genre { get; set; } public SearchGenre Genre { get; }
public SearchLanguage Language { get; set; } public SearchLanguage Language { get; }
private readonly string query; private readonly string query;
private readonly RulesetInfo ruleset; private readonly RulesetInfo ruleset;
@ -27,8 +27,7 @@ namespace osu.Game.Online.API.Requests
private string directionString => SortDirection == SortDirection.Descending ? @"desc" : @"asc"; private string directionString => SortDirection == SortDirection.Descending ? @"desc" : @"asc";
public SearchBeatmapSetsRequest(string query, RulesetInfo ruleset, Cursor cursor = null, public SearchBeatmapSetsRequest(string query, RulesetInfo ruleset, Cursor cursor = null, SearchCategory searchCategory = SearchCategory.Any, SortCriteria sortCriteria = SortCriteria.Ranked, SortDirection sortDirection = SortDirection.Descending)
SearchCategory searchCategory = SearchCategory.Any, SortCriteria sortCriteria = SortCriteria.Ranked, SortDirection sortDirection = SortDirection.Descending)
{ {
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;

View File

@ -24,9 +24,9 @@ namespace osu.Game.Overlays.BeatmapListing
private SearchBeatmapSetsRequest getSetsRequest; private SearchBeatmapSetsRequest getSetsRequest;
private SearchBeatmapSetsResponse lastResponse; private SearchBeatmapSetsResponse lastResponse;
private bool isLastPageFetched = false; private bool isLastPageFetched;
private bool isFetching => getSetsRequest != null; private bool isFetching => getSetsRequest != null;
public bool IsPastFirstPage { get; private set; } = false; public bool IsPastFirstPage { get; private set; }
public bool CanFetchNextPage => !isLastPageFetched && !isFetching; public bool CanFetchNextPage => !isLastPageFetched && !isFetching;
public BeatmapListingPager(IAPIProvider api, RulesetStore rulesets, string query, RulesetInfo ruleset, SearchCategory searchCategory = SearchCategory.Any, SortCriteria sortCriteria = SortCriteria.Ranked, SortDirection sortDirection = SortDirection.Descending) public BeatmapListingPager(IAPIProvider api, RulesetStore rulesets, string query, RulesetInfo ruleset, SearchCategory searchCategory = SearchCategory.Any, SortCriteria sortCriteria = SortCriteria.Ranked, SortDirection sortDirection = SortDirection.Descending)

View File

@ -184,8 +184,7 @@ namespace osu.Game.Overlays
// If the auto-size computation is delayed until fade out completes, the background remain high for too long making the resulting transition to the smaller height look weird. // If the auto-size computation is delayed until fade out completes, the background remain high for too long making the resulting transition to the smaller height look weird.
// At the same time, if the last content's height is bypassed immediately, there is a period where the new content is at Alpha = 0 when the auto-sized height will be 0. // At the same time, if the last content's height is bypassed immediately, there is a period where the new content is at Alpha = 0 when the auto-sized height will be 0.
// To resolve both of these issues, the bypass is delayed until a point when the content transitions (fade-in and fade-out) overlap and it looks good to do so. // To resolve both of these issues, the bypass is delayed until a point when the content transitions (fade-in and fade-out) overlap and it looks good to do so.
lastContent.Delay(25).Schedule(() => lastContent.BypassAutoSizeAxes = Axes.Y) lastContent.Delay(25).Schedule(() => lastContent.BypassAutoSizeAxes = Axes.Y).Then().Schedule(() => panelTarget.Remove(lastContent));
.Then().Schedule(() => panelTarget.Remove(lastContent));
} }
if (!content.IsAlive) if (!content.IsAlive)