2023-01-16 23:57:18 +08: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.
|
|
|
|
|
2023-09-23 10:56:33 +08:00
|
|
|
using System;
|
2023-01-16 23:57:18 +08:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2023-01-17 00:35:27 +08:00
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
2023-01-16 23:57:18 +08:00
|
|
|
using osu.Game.Online.Leaderboards;
|
2023-01-23 18:35:42 +08:00
|
|
|
using osu.Game.Rulesets.Mania;
|
2023-01-17 00:35:27 +08:00
|
|
|
using osu.Game.Rulesets.Mods;
|
|
|
|
using osu.Game.Rulesets.Osu;
|
|
|
|
using osu.Game.Rulesets.Osu.Mods;
|
|
|
|
using osu.Game.Scoring;
|
|
|
|
using osu.Game.Users;
|
2023-01-17 00:15:37 +08:00
|
|
|
using osuTK;
|
2023-01-16 23:57:18 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.SongSelect
|
|
|
|
{
|
|
|
|
public partial class TestSceneLeaderboardScoreV2 : OsuTestScene
|
|
|
|
{
|
2023-09-23 06:39:40 +08:00
|
|
|
private FillFlowContainer fillFlow = null!;
|
|
|
|
|
2023-01-16 23:57:18 +08:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
2023-01-17 00:35:27 +08:00
|
|
|
var scores = new[]
|
|
|
|
{
|
|
|
|
new ScoreInfo
|
|
|
|
{
|
|
|
|
Position = 999,
|
|
|
|
Rank = ScoreRank.XH,
|
|
|
|
Accuracy = 1,
|
|
|
|
MaxCombo = 244,
|
|
|
|
TotalScore = 1707827,
|
2023-01-17 02:16:35 +08:00
|
|
|
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), new OsuModAlternate(), new OsuModFlashlight(), new OsuModFreezeFrame() },
|
2023-01-17 00:35:27 +08:00
|
|
|
Ruleset = new OsuRuleset().RulesetInfo,
|
|
|
|
User = new APIUser
|
|
|
|
{
|
|
|
|
Id = 6602580,
|
|
|
|
Username = @"waaiiru",
|
|
|
|
CountryCode = CountryCode.ES,
|
2023-09-23 07:34:06 +08:00
|
|
|
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c1.jpg",
|
2023-01-17 00:35:27 +08:00
|
|
|
},
|
2023-09-23 10:56:33 +08:00
|
|
|
Date = DateTimeOffset.Now.AddYears(-2),
|
2023-01-17 00:35:27 +08:00
|
|
|
},
|
|
|
|
new ScoreInfo
|
|
|
|
{
|
|
|
|
Position = 22333,
|
|
|
|
Rank = ScoreRank.S,
|
2023-01-17 02:03:17 +08:00
|
|
|
Accuracy = 0.1f,
|
2023-01-18 03:13:50 +08:00
|
|
|
MaxCombo = 32040,
|
2023-01-17 02:16:35 +08:00
|
|
|
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), new OsuModAlternate(), new OsuModFlashlight(), new OsuModFreezeFrame(), new OsuModClassic() },
|
2023-01-17 00:35:27 +08:00
|
|
|
TotalScore = 1707827,
|
|
|
|
Ruleset = new OsuRuleset().RulesetInfo,
|
|
|
|
User = new APIUser
|
|
|
|
{
|
|
|
|
Id = 1541390,
|
|
|
|
Username = @"Toukai",
|
|
|
|
CountryCode = CountryCode.CA,
|
2023-09-23 07:34:06 +08:00
|
|
|
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c2.jpg",
|
2023-01-17 00:35:27 +08:00
|
|
|
},
|
2023-09-23 10:56:33 +08:00
|
|
|
Date = DateTimeOffset.Now.AddMonths(-6),
|
2023-01-23 18:35:42 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
new ScoreInfo
|
|
|
|
{
|
|
|
|
Position = 110000,
|
|
|
|
Rank = ScoreRank.X,
|
|
|
|
Accuracy = 1,
|
|
|
|
MaxCombo = 244,
|
|
|
|
TotalScore = 17078279,
|
|
|
|
Ruleset = new ManiaRuleset().RulesetInfo,
|
|
|
|
User = new APIUser
|
|
|
|
{
|
2023-09-23 07:34:06 +08:00
|
|
|
Username = @"No cover",
|
2023-01-23 18:35:42 +08:00
|
|
|
CountryCode = CountryCode.BR,
|
|
|
|
},
|
2023-09-23 10:56:33 +08:00
|
|
|
Date = DateTimeOffset.Now,
|
2023-01-23 18:35:42 +08:00
|
|
|
},
|
2023-01-17 00:35:27 +08:00
|
|
|
};
|
|
|
|
|
2023-09-23 06:39:40 +08:00
|
|
|
Child = fillFlow = new FillFlowContainer
|
2023-01-16 23:57:18 +08:00
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
2023-01-17 00:15:37 +08:00
|
|
|
Spacing = new Vector2(0, 10),
|
2023-09-23 06:39:40 +08:00
|
|
|
RelativeSizeAxes = Axes.X,
|
2023-01-16 23:57:18 +08:00
|
|
|
AutoSizeAxes = Axes.Y,
|
2023-01-17 00:15:37 +08:00
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
2023-01-17 05:51:46 +08:00
|
|
|
new LeaderboardScoreV2(scores[0], 1),
|
2023-01-23 18:35:42 +08:00
|
|
|
new LeaderboardScoreV2(scores[1], null, true),
|
2023-09-23 07:34:06 +08:00
|
|
|
new LeaderboardScoreV2(scores[2], null, true),
|
|
|
|
new LeaderboardScoreV2(scores[2], null),
|
2023-01-17 00:15:37 +08:00
|
|
|
}
|
2023-01-16 23:57:18 +08:00
|
|
|
};
|
2023-09-23 06:39:40 +08:00
|
|
|
|
2023-09-23 10:56:33 +08:00
|
|
|
foreach (var score in fillFlow.Children)
|
|
|
|
score.Show();
|
|
|
|
|
2023-09-23 06:39:40 +08:00
|
|
|
AddSliderStep("change relative width", 0, 1f, 0.6f, v =>
|
|
|
|
{
|
|
|
|
fillFlow.Width = v;
|
|
|
|
});
|
2023-01-16 23:57:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|