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