2020-08-01 12:04:39 +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.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics;
|
2020-08-03 02:47:09 +08:00
|
|
|
|
using osu.Game.Overlays.Dashboard.Home;
|
2020-08-01 12:04:39 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Overlays;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using System;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using System.Collections.Generic;
|
2021-10-20 17:43:48 +08:00
|
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
2021-11-04 17:02:44 +08:00
|
|
|
|
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
2020-08-01 12:04:39 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.UserInterface
|
|
|
|
|
{
|
|
|
|
|
public class TestSceneDashboardBeatmapListing : OsuTestScene
|
|
|
|
|
{
|
|
|
|
|
[Cached]
|
|
|
|
|
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
|
|
|
|
|
|
|
|
|
|
private readonly Container content;
|
|
|
|
|
|
|
|
|
|
public TestSceneDashboardBeatmapListing()
|
|
|
|
|
{
|
|
|
|
|
Add(content = new Container
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Width = 300,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Colour = colourProvider.Background4
|
|
|
|
|
},
|
2020-08-03 02:44:34 +08:00
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Padding = new MarginPadding { Horizontal = 10 },
|
|
|
|
|
Child = new DashboardBeatmapListing(new_beatmaps, popular_beatmaps)
|
|
|
|
|
}
|
2020-08-01 12:04:39 +08:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
|
|
AddStep("Set width to 500", () => content.ResizeWidthTo(500, 500));
|
|
|
|
|
AddStep("Set width to 300", () => content.ResizeWidthTo(300, 500));
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-01 15:02:00 +08:00
|
|
|
|
private static readonly List<APIBeatmapSet> new_beatmaps = new List<APIBeatmapSet>
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
new APIBeatmapSet
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Title = "Very Long Title (TV size) [TATOE]",
|
|
|
|
|
Artist = "This artist has a really long name how is this possible",
|
2021-11-04 17:02:44 +08:00
|
|
|
|
Author = new APIUser
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Username = "author",
|
|
|
|
|
Id = 100
|
2020-08-01 12:04:39 +08:00
|
|
|
|
},
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Covers = new BeatmapSetOnlineCovers
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Cover = "https://assets.ppy.sh/beatmaps/1189904/covers/cover.jpg?1595456608",
|
|
|
|
|
},
|
|
|
|
|
Ranked = DateTimeOffset.Now
|
2020-08-01 12:04:39 +08:00
|
|
|
|
},
|
2021-11-01 15:02:00 +08:00
|
|
|
|
new APIBeatmapSet
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Title = "Very Long Title (TV size) [TATOE]",
|
|
|
|
|
Artist = "This artist has a really long name how is this possible",
|
2021-11-04 17:02:44 +08:00
|
|
|
|
Author = new APIUser
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Username = "author",
|
|
|
|
|
Id = 100
|
2020-08-01 12:04:39 +08:00
|
|
|
|
},
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Covers = new BeatmapSetOnlineCovers
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Cover = "https://assets.ppy.sh/beatmaps/1189904/covers/cover.jpg?1595456608",
|
|
|
|
|
},
|
|
|
|
|
Ranked = DateTimeOffset.Now
|
2020-08-01 12:04:39 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2021-11-01 15:02:00 +08:00
|
|
|
|
private static readonly List<APIBeatmapSet> popular_beatmaps = new List<APIBeatmapSet>
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
new APIBeatmapSet
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Title = "Very Long Title (TV size) [TATOE]",
|
|
|
|
|
Artist = "This artist has a really long name how is this possible",
|
2021-11-04 17:02:44 +08:00
|
|
|
|
Author = new APIUser
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Username = "author",
|
|
|
|
|
Id = 100
|
2020-08-01 12:04:39 +08:00
|
|
|
|
},
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Covers = new BeatmapSetOnlineCovers
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Cover = "https://assets.ppy.sh/beatmaps/1189904/covers/cover.jpg?1595456608",
|
|
|
|
|
},
|
|
|
|
|
Ranked = DateTimeOffset.Now
|
2020-08-01 12:04:39 +08:00
|
|
|
|
},
|
2021-11-01 15:02:00 +08:00
|
|
|
|
new APIBeatmapSet
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Title = "Very Long Title (TV size) [TATOE]",
|
|
|
|
|
Artist = "This artist has a really long name how is this possible",
|
2021-11-04 17:02:44 +08:00
|
|
|
|
Author = new APIUser
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Username = "author",
|
|
|
|
|
Id = 100
|
2020-08-01 12:04:39 +08:00
|
|
|
|
},
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Covers = new BeatmapSetOnlineCovers
|
2020-08-01 12:04:39 +08:00
|
|
|
|
{
|
2021-11-01 15:02:00 +08:00
|
|
|
|
Cover = "https://assets.ppy.sh/beatmaps/1189904/covers/cover.jpg?1595456608",
|
|
|
|
|
},
|
|
|
|
|
Ranked = DateTimeOffset.Now
|
2020-08-01 12:04:39 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|