mirror of
https://github.com/ppy/osu
synced 2025-01-17 03:21:09 +00:00
Merge pull request #12663 from Joehuu/fix-profile-subsection-counters
This commit is contained in:
commit
d8d2c731ee
@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
|
||||
private readonly BeatmapSetType type;
|
||||
|
||||
public PaginatedBeatmapContainer(BeatmapSetType type, Bindable<User> user, string headerText)
|
||||
: base(user, headerText, "", CounterVisibilityState.AlwaysVisible)
|
||||
: base(user, headerText)
|
||||
{
|
||||
this.type = type;
|
||||
ItemsPerPage = 6;
|
||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||
public class PaginatedMostPlayedBeatmapContainer : PaginatedProfileSubsection<APIUserMostPlayedBeatmap>
|
||||
{
|
||||
public PaginatedMostPlayedBeatmapContainer(Bindable<User> user)
|
||||
: base(user, "Most Played Beatmaps", "No records. :(", CounterVisibilityState.AlwaysVisible)
|
||||
: base(user, "Most Played Beatmaps")
|
||||
{
|
||||
ItemsPerPage = 5;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Profile.Sections
|
||||
{
|
||||
new PlayHistorySubsection(User),
|
||||
new PaginatedMostPlayedBeatmapContainer(User),
|
||||
new PaginatedScoreContainer(ScoreType.Recent, User, "Recent Plays (24h)", CounterVisibilityState.VisibleWhenZero),
|
||||
new PaginatedScoreContainer(ScoreType.Recent, User, "Recent Plays (24h)"),
|
||||
new ReplaysSubsection(User)
|
||||
};
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ namespace osu.Game.Overlays.Profile.Sections
|
||||
private OsuSpriteText missing;
|
||||
private readonly string missingText;
|
||||
|
||||
protected PaginatedProfileSubsection(Bindable<User> user, string headerText = "", string missingText = "", CounterVisibilityState counterVisibilityState = CounterVisibilityState.AlwaysHidden)
|
||||
: base(user, headerText, counterVisibilityState)
|
||||
protected PaginatedProfileSubsection(Bindable<User> user, string headerText = "", string missingText = "")
|
||||
: base(user, headerText, CounterVisibilityState.AlwaysVisible)
|
||||
{
|
||||
this.missingText = missingText;
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
{
|
||||
private readonly ScoreType type;
|
||||
|
||||
public PaginatedScoreContainer(ScoreType type, Bindable<User> user, string headerText, CounterVisibilityState counterVisibilityState, string missingText = "")
|
||||
: base(user, headerText, missingText, counterVisibilityState)
|
||||
public PaginatedScoreContainer(ScoreType type, Bindable<User> user, string headerText)
|
||||
: base(user, headerText)
|
||||
{
|
||||
this.type = type;
|
||||
|
||||
@ -36,9 +36,15 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ScoreType.Best:
|
||||
return user.ScoresBestCount;
|
||||
|
||||
case ScoreType.Firsts:
|
||||
return user.ScoresFirstCount;
|
||||
|
||||
case ScoreType.Recent:
|
||||
return user.ScoresRecentCount;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@ -50,9 +56,6 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
drawableItemIndex = 0;
|
||||
|
||||
base.OnItemsReceived(items);
|
||||
|
||||
if (type == ScoreType.Recent)
|
||||
SetCount(items.Count);
|
||||
}
|
||||
|
||||
protected override APIRequest<List<APILegacyScoreInfo>> CreateRequest() =>
|
||||
|
@ -16,8 +16,8 @@ namespace osu.Game.Overlays.Profile.Sections
|
||||
{
|
||||
Children = new[]
|
||||
{
|
||||
new PaginatedScoreContainer(ScoreType.Best, User, "Best Performance", CounterVisibilityState.AlwaysHidden, "No performance records. :("),
|
||||
new PaginatedScoreContainer(ScoreType.Firsts, User, "First Place Ranks", CounterVisibilityState.AlwaysVisible)
|
||||
new PaginatedScoreContainer(ScoreType.Best, User, "Best Performance"),
|
||||
new PaginatedScoreContainer(ScoreType.Firsts, User, "First Place Ranks")
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -144,9 +144,15 @@ namespace osu.Game.Users
|
||||
[JsonProperty(@"unranked_beatmapset_count")]
|
||||
public int UnrankedBeatmapsetCount;
|
||||
|
||||
[JsonProperty(@"scores_best_count")]
|
||||
public int ScoresBestCount;
|
||||
|
||||
[JsonProperty(@"scores_first_count")]
|
||||
public int ScoresFirstCount;
|
||||
|
||||
[JsonProperty(@"scores_recent_count")]
|
||||
public int ScoresRecentCount;
|
||||
|
||||
[JsonProperty(@"beatmap_playcounts_count")]
|
||||
public int BeatmapPlaycountsCount;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user