mirror of
https://github.com/ppy/osu.git
synced 2026-06-06 01:33:50 +08:00
Add a new test for Rank Achieved panels
This commit is contained in:
@@ -3,12 +3,14 @@
|
||||
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Graphics.Carousel;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.SelectV2;
|
||||
using osu.Game.Tests.Visual.UserInterface;
|
||||
using osuTK;
|
||||
@@ -86,6 +88,64 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestRanks()
|
||||
{
|
||||
for (int i = -1; i <= 7; i++)
|
||||
{
|
||||
ScoreRank rank = (ScoreRank)i;
|
||||
|
||||
AddStep($"display rank {rank}", () =>
|
||||
{
|
||||
ContentContainer.Child = new DependencyProvidingContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
CachedDependencies = new (Type, object)[]
|
||||
{
|
||||
(typeof(OverlayColourProvider), new OverlayColourProvider(OverlayColourScheme.Aquamarine))
|
||||
},
|
||||
Child = new OsuContextMenuContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Child = new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Width = 0.5f,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0f, 5f),
|
||||
Children = new[]
|
||||
{
|
||||
new PanelGroupRankDisplay
|
||||
{
|
||||
Item = new CarouselItem(new RankDisplayGroupDefinition(0, $"{rank.GetDescription()}", rank))
|
||||
},
|
||||
new PanelGroupRankDisplay
|
||||
{
|
||||
Item = new CarouselItem(new RankDisplayGroupDefinition(1, $"{rank.GetDescription()}", rank)),
|
||||
KeyboardSelected = { Value = true },
|
||||
},
|
||||
new PanelGroupRankDisplay
|
||||
{
|
||||
Item = new CarouselItem(new RankDisplayGroupDefinition(2, $"{rank.GetDescription()}", rank)),
|
||||
Expanded = { Value = true },
|
||||
},
|
||||
new PanelGroupRankDisplay
|
||||
{
|
||||
Item = new CarouselItem(new RankDisplayGroupDefinition(3, $"{rank.GetDescription()}", rank)),
|
||||
Expanded = { Value = true },
|
||||
KeyboardSelected = { Value = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected override Drawable CreateContent()
|
||||
{
|
||||
return new OsuContextMenuContainer
|
||||
|
||||
Reference in New Issue
Block a user