2020-01-17 23:58:10 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using System;
|
2021-10-29 06:14:52 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2020-01-17 23:58:10 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-10-29 06:14:52 +00:00
|
|
|
|
using osu.Game.Online.API;
|
|
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
2020-01-27 09:55:19 +00:00
|
|
|
|
using osu.Game.Overlays;
|
2021-10-29 06:14:52 +00:00
|
|
|
|
using osu.Game.Overlays.Profile.Sections.Ranks;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Mods;
|
|
|
|
|
using osu.Game.Scoring;
|
|
|
|
|
using osuTK;
|
2020-01-17 23:58:10 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Online
|
|
|
|
|
{
|
|
|
|
|
public class TestSceneUserProfileScores : OsuTestScene
|
|
|
|
|
{
|
|
|
|
|
public TestSceneUserProfileScores()
|
|
|
|
|
{
|
2021-12-10 07:01:41 +00:00
|
|
|
|
var firstScore = new APIScore
|
2020-02-16 05:16:02 +00:00
|
|
|
|
{
|
|
|
|
|
PP = 1047.21,
|
|
|
|
|
Rank = ScoreRank.SH,
|
2021-10-29 06:14:52 +00:00
|
|
|
|
Beatmap = new APIBeatmap
|
2020-02-16 05:16:02 +00:00
|
|
|
|
{
|
2021-11-01 08:12:15 +00:00
|
|
|
|
BeatmapSet = new APIBeatmapSet
|
2020-02-16 05:16:02 +00:00
|
|
|
|
{
|
|
|
|
|
Title = "JUSTadICE (TV Size)",
|
2021-10-29 06:14:52 +00:00
|
|
|
|
Artist = "Oomori Seiko",
|
2020-02-16 05:16:02 +00:00
|
|
|
|
},
|
2021-10-29 06:14:52 +00:00
|
|
|
|
DifficultyName = "Extreme"
|
2020-02-16 05:16:02 +00:00
|
|
|
|
},
|
|
|
|
|
Date = DateTimeOffset.Now,
|
2021-10-29 06:14:52 +00:00
|
|
|
|
Mods = new[]
|
2020-02-16 05:16:02 +00:00
|
|
|
|
{
|
2021-10-29 06:14:52 +00:00
|
|
|
|
new APIMod { Acronym = new OsuModHidden().Acronym },
|
|
|
|
|
new APIMod { Acronym = new OsuModHardRock().Acronym },
|
|
|
|
|
new APIMod { Acronym = new OsuModDoubleTime().Acronym },
|
2020-02-16 05:16:02 +00:00
|
|
|
|
},
|
|
|
|
|
Accuracy = 0.9813
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-10 07:01:41 +00:00
|
|
|
|
var secondScore = new APIScore
|
2020-01-17 23:58:10 +00:00
|
|
|
|
{
|
|
|
|
|
PP = 134.32,
|
|
|
|
|
Rank = ScoreRank.A,
|
2021-10-29 06:14:52 +00:00
|
|
|
|
Beatmap = new APIBeatmap
|
2020-01-17 23:58:10 +00:00
|
|
|
|
{
|
2021-11-01 08:12:15 +00:00
|
|
|
|
BeatmapSet = new APIBeatmapSet
|
2020-01-17 23:58:10 +00:00
|
|
|
|
{
|
|
|
|
|
Title = "Triumph & Regret",
|
2021-10-29 06:14:52 +00:00
|
|
|
|
Artist = "typeMARS",
|
2020-01-17 23:58:10 +00:00
|
|
|
|
},
|
2021-10-29 06:14:52 +00:00
|
|
|
|
DifficultyName = "[4K] Regret"
|
2020-01-17 23:58:10 +00:00
|
|
|
|
},
|
|
|
|
|
Date = DateTimeOffset.Now,
|
2021-10-29 06:14:52 +00:00
|
|
|
|
Mods = new[]
|
2020-01-17 23:58:10 +00:00
|
|
|
|
{
|
2021-10-29 06:14:52 +00:00
|
|
|
|
new APIMod { Acronym = new OsuModHardRock().Acronym },
|
|
|
|
|
new APIMod { Acronym = new OsuModDoubleTime().Acronym },
|
2020-01-17 23:58:10 +00:00
|
|
|
|
},
|
|
|
|
|
Accuracy = 0.998546
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-10 07:01:41 +00:00
|
|
|
|
var thirdScore = new APIScore
|
2020-02-15 15:05:15 +00:00
|
|
|
|
{
|
|
|
|
|
PP = 96.83,
|
|
|
|
|
Rank = ScoreRank.S,
|
2021-10-29 06:14:52 +00:00
|
|
|
|
Beatmap = new APIBeatmap
|
2020-02-15 15:05:15 +00:00
|
|
|
|
{
|
2021-11-01 08:12:15 +00:00
|
|
|
|
BeatmapSet = new APIBeatmapSet
|
2020-02-15 15:05:15 +00:00
|
|
|
|
{
|
|
|
|
|
Title = "Idolize",
|
2021-10-29 06:14:52 +00:00
|
|
|
|
Artist = "Creo",
|
2020-02-15 15:05:15 +00:00
|
|
|
|
},
|
2021-10-29 06:14:52 +00:00
|
|
|
|
DifficultyName = "Insane"
|
2020-02-15 15:05:15 +00:00
|
|
|
|
},
|
|
|
|
|
Date = DateTimeOffset.Now,
|
|
|
|
|
Accuracy = 0.9726
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-10 07:01:41 +00:00
|
|
|
|
var noPPScore = new APIScore
|
2020-01-17 23:58:10 +00:00
|
|
|
|
{
|
|
|
|
|
Rank = ScoreRank.B,
|
2021-10-29 06:14:52 +00:00
|
|
|
|
Beatmap = new APIBeatmap
|
2020-01-17 23:58:10 +00:00
|
|
|
|
{
|
2021-11-01 08:12:15 +00:00
|
|
|
|
BeatmapSet = new APIBeatmapSet
|
2020-01-17 23:58:10 +00:00
|
|
|
|
{
|
|
|
|
|
Title = "C18H27NO3(extend)",
|
2021-10-29 06:14:52 +00:00
|
|
|
|
Artist = "Team Grimoire",
|
2020-01-17 23:58:10 +00:00
|
|
|
|
},
|
2021-10-29 06:14:52 +00:00
|
|
|
|
DifficultyName = "[4K] Cataclysmic Hypernova"
|
2020-01-17 23:58:10 +00:00
|
|
|
|
},
|
|
|
|
|
Date = DateTimeOffset.Now,
|
|
|
|
|
Accuracy = 0.55879
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Add(new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Spacing = new Vector2(0, 10),
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
2020-02-16 05:16:02 +00:00
|
|
|
|
new ColourProvidedContainer(OverlayColourScheme.Green, new DrawableProfileScore(firstScore)),
|
|
|
|
|
new ColourProvidedContainer(OverlayColourScheme.Green, new DrawableProfileScore(secondScore)),
|
2020-01-27 09:55:19 +00:00
|
|
|
|
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileScore(noPPScore)),
|
2020-02-16 05:16:02 +00:00
|
|
|
|
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(firstScore, 0.97)),
|
|
|
|
|
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(secondScore, 0.85)),
|
|
|
|
|
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(thirdScore, 0.66)),
|
2020-01-17 23:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2020-01-27 09:55:19 +00:00
|
|
|
|
|
|
|
|
|
private class ColourProvidedContainer : Container
|
|
|
|
|
{
|
|
|
|
|
[Cached]
|
|
|
|
|
private readonly OverlayColourProvider colourProvider;
|
|
|
|
|
|
|
|
|
|
public ColourProvidedContainer(OverlayColourScheme colourScheme, DrawableProfileScore score)
|
|
|
|
|
{
|
|
|
|
|
colourProvider = new OverlayColourProvider(colourScheme);
|
|
|
|
|
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
Add(score);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-01-17 23:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|