mirror of
https://github.com/ppy/osu.git
synced 2026-05-17 10:42:55 +08:00
0aff50fbf5
This aims to bring some conformity to naming to make it easier to understand component structure for new components. Renames are pulled out of the song select v2 changes and are more relevant there due to many new classes being added. - `V2` suffix is dropped, with v2 components being moved to a relevant V2 namespace. - Related classes have a prefix of the area they are used. - Experimenting with using partial/nested classes in the song select v2 implementation. Not committing to this yet but want to see how it plays out. - Moved base carousel components to a generic namespace to avoid confusion with actual beatmap carousel implementation.
121 lines
4.6 KiB
C#
121 lines
4.6 KiB
C#
// 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;
|
|
using NUnit.Framework;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Game.Overlays;
|
|
using osu.Game.Graphics.Carousel;
|
|
using osu.Game.Screens.SelectV2;
|
|
using osu.Game.Tests.Visual.UserInterface;
|
|
using osuTK;
|
|
|
|
namespace osu.Game.Tests.Visual.SongSelectV2
|
|
{
|
|
public partial class TestScenePanelGroup : ThemeComparisonTestScene
|
|
{
|
|
public TestScenePanelGroup()
|
|
: base(false)
|
|
{
|
|
}
|
|
|
|
[Test]
|
|
public void TestGeneral()
|
|
{
|
|
AddStep("general", () => CreateThemedContent(OverlayColourScheme.Aquamarine));
|
|
}
|
|
|
|
[Test]
|
|
public void TestStars()
|
|
{
|
|
for (int i = 0; i <= 10; i++)
|
|
{
|
|
int star = i;
|
|
|
|
AddStep($"display {i} star(s)", () =>
|
|
{
|
|
ContentContainer.Child = new DependencyProvidingContainer
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
CachedDependencies = new (Type, object)[]
|
|
{
|
|
(typeof(OverlayColourProvider), new OverlayColourProvider(OverlayColourScheme.Aquamarine))
|
|
},
|
|
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 PanelGroupStarDifficulty
|
|
{
|
|
Item = new CarouselItem(new GroupDefinition(star, star.ToString()))
|
|
},
|
|
new PanelGroupStarDifficulty
|
|
{
|
|
Item = new CarouselItem(new GroupDefinition(star, star.ToString())),
|
|
KeyboardSelected = { Value = true },
|
|
},
|
|
new PanelGroupStarDifficulty
|
|
{
|
|
Item = new CarouselItem(new GroupDefinition(star, star.ToString())),
|
|
Expanded = { Value = true },
|
|
},
|
|
new PanelGroupStarDifficulty
|
|
{
|
|
Item = new CarouselItem(new GroupDefinition(star, star.ToString())),
|
|
Expanded = { Value = true },
|
|
KeyboardSelected = { Value = true },
|
|
},
|
|
},
|
|
}
|
|
};
|
|
});
|
|
}
|
|
}
|
|
|
|
protected override Drawable CreateContent()
|
|
{
|
|
return 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 Drawable[]
|
|
{
|
|
new PanelGroup
|
|
{
|
|
Item = new CarouselItem(new GroupDefinition('A', "Group A"))
|
|
},
|
|
new PanelGroup
|
|
{
|
|
Item = new CarouselItem(new GroupDefinition('A', "Group A")),
|
|
KeyboardSelected = { Value = true }
|
|
},
|
|
new PanelGroup
|
|
{
|
|
Item = new CarouselItem(new GroupDefinition('A', "Group A")),
|
|
Expanded = { Value = true }
|
|
},
|
|
new PanelGroup
|
|
{
|
|
Item = new CarouselItem(new GroupDefinition('A', "Group A")),
|
|
KeyboardSelected = { Value = true },
|
|
Expanded = { Value = true }
|
|
},
|
|
}
|
|
};
|
|
}
|
|
}
|
|
}
|