mirror of
https://github.com/ppy/osu.git
synced 2025-03-23 07:18:45 +08:00
Refactor PaginatedScoreContainer to use new components
This commit is contained in:
parent
4964505c3e
commit
6e776d02f8
@ -15,14 +15,12 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
{
|
||||
public class PaginatedScoreContainer : PaginatedContainer<APILegacyScoreInfo>
|
||||
{
|
||||
private readonly bool includeWeight;
|
||||
private readonly ScoreType type;
|
||||
|
||||
public PaginatedScoreContainer(ScoreType type, Bindable<User> user, string header, string missing, bool includeWeight = false)
|
||||
public PaginatedScoreContainer(ScoreType type, Bindable<User> user, string header, string missing)
|
||||
: base(user, header, missing)
|
||||
{
|
||||
this.type = type;
|
||||
this.includeWeight = includeWeight;
|
||||
|
||||
ItemsPerPage = 5;
|
||||
|
||||
@ -43,10 +41,10 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
switch (type)
|
||||
{
|
||||
default:
|
||||
return new DrawablePerformanceScore(model.CreateScoreInfo(Rulesets), includeWeight ? Math.Pow(0.95, ItemsContainer.Count) : (double?)null);
|
||||
return new ProfileScore(model.CreateScoreInfo(Rulesets));
|
||||
|
||||
case ScoreType.Recent:
|
||||
return new DrawableTotalScore(model.CreateScoreInfo(Rulesets));
|
||||
case ScoreType.Best:
|
||||
return new ProfileWeightedScore(model.CreateScoreInfo(Rulesets), Math.Pow(0.95, ItemsContainer.Count));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,12 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
||||
Spacing = new Vector2(15, 0),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
CreateDrawableAccuracy(),
|
||||
new Container
|
||||
{
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Width = 60,
|
||||
Child = CreateDrawableAccuracy()
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Profile.Sections
|
||||
{
|
||||
Children = new[]
|
||||
{
|
||||
new PaginatedScoreContainer(ScoreType.Best, User, "Best Performance", "No performance records. :(", true),
|
||||
new PaginatedScoreContainer(ScoreType.Best, User, "Best Performance", "No performance records. :("),
|
||||
new PaginatedScoreContainer(ScoreType.Firsts, User, "First Place Ranks", "No awesome performance records yet. :("),
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user