mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Add support for changing dimensions of difficulty spectrum display
This commit is contained in:
@ -13,6 +13,8 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
||||
{
|
||||
public class TestSceneDifficultySpectrumDisplay : OsuTestScene
|
||||
{
|
||||
private DifficultySpectrumDisplay display;
|
||||
|
||||
private static APIBeatmapSet createBeatmapSetWith(params (int rulesetId, double stars)[] difficulties) => new APIBeatmapSet
|
||||
{
|
||||
Beatmaps = difficulties.Select(difficulty => new APIBeatmap
|
||||
@ -74,7 +76,31 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
||||
createDisplay(beatmapSet);
|
||||
}
|
||||
|
||||
private void createDisplay(IBeatmapSetInfo beatmapSetInfo) => AddStep("create spectrum display", () => Child = new DifficultySpectrumDisplay(beatmapSetInfo)
|
||||
[Test]
|
||||
public void TestAdjustableDotSize()
|
||||
{
|
||||
var beatmapSet = createBeatmapSetWith(
|
||||
(rulesetId: 0, stars: 2.0),
|
||||
(rulesetId: 3, stars: 2.3),
|
||||
(rulesetId: 0, stars: 3.2),
|
||||
(rulesetId: 1, stars: 4.3),
|
||||
(rulesetId: 0, stars: 5.6));
|
||||
|
||||
createDisplay(beatmapSet);
|
||||
|
||||
AddStep("change dot dimensions", () =>
|
||||
{
|
||||
display.DotSize = new Vector2(8, 12);
|
||||
display.DotSpacing = 2;
|
||||
});
|
||||
AddStep("change dot dimensions back", () =>
|
||||
{
|
||||
display.DotSize = new Vector2(4, 8);
|
||||
display.DotSpacing = 1;
|
||||
});
|
||||
}
|
||||
|
||||
private void createDisplay(IBeatmapSetInfo beatmapSetInfo) => AddStep("create spectrum display", () => Child = display = new DifficultySpectrumDisplay(beatmapSetInfo)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
Reference in New Issue
Block a user